diff options
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r-- | drivers/char/ipmi/bt-bmc.c | 13 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 4 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 6 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 7 |
4 files changed, 11 insertions, 19 deletions
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c index 70d434bc1cbf..6edfaa72b98b 100644 --- a/drivers/char/ipmi/bt-bmc.c +++ b/drivers/char/ipmi/bt-bmc.c @@ -204,9 +204,6 @@ static ssize_t bt_bmc_read(struct file *file, char __user *buf, ssize_t ret = 0; ssize_t nread; - if (!access_ok(VERIFY_WRITE, buf, count)) - return -EFAULT; - WARN_ON(*ppos); if (wait_event_interruptible(bt_bmc->queue, @@ -277,9 +274,6 @@ static ssize_t bt_bmc_write(struct file *file, const char __user *buf, if (count < 5) return -EINVAL; - if (!access_ok(VERIFY_READ, buf, count)) - return -EFAULT; - WARN_ON(*ppos); /* @@ -373,9 +367,9 @@ static const struct file_operations bt_bmc_fops = { .unlocked_ioctl = bt_bmc_ioctl, }; -static void poll_timer(unsigned long data) +static void poll_timer(struct timer_list *t) { - struct bt_bmc *bt_bmc = (void *)data; + struct bt_bmc *bt_bmc = from_timer(bt_bmc, t, poll_timer); bt_bmc->poll_timer.expires += msecs_to_jiffies(500); wake_up(&bt_bmc->queue); @@ -493,8 +487,7 @@ static int bt_bmc_probe(struct platform_device *pdev) dev_info(dev, "Using IRQ %d\n", bt_bmc->irq); } else { dev_info(dev, "No IRQ; using timer\n"); - setup_timer(&bt_bmc->poll_timer, poll_timer, - (unsigned long)bt_bmc); + timer_setup(&bt_bmc->poll_timer, poll_timer, 0); bt_bmc->poll_timer.expires = jiffies + msecs_to_jiffies(10); add_timer(&bt_bmc->poll_timer); } diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 9de189db2cc3..f45732a2cb3e 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -4766,7 +4766,7 @@ static struct timer_list ipmi_timer; static atomic_t stop_operation; -static void ipmi_timeout(unsigned long data) +static void ipmi_timeout(struct timer_list *unused) { ipmi_smi_t intf; int nt = 0; @@ -5172,7 +5172,7 @@ static int ipmi_init_msghandler(void) #endif /* CONFIG_IPMI_PROC_INTERFACE */ - setup_timer(&ipmi_timer, ipmi_timeout, 0); + timer_setup(&ipmi_timer, ipmi_timeout, 0); mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); atomic_notifier_chain_register(&panic_notifier_list, &panic_block); diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 99b0513bb55b..71fad747c0c7 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -1090,9 +1090,9 @@ static void set_need_watch(void *send_info, bool enable) spin_unlock_irqrestore(&smi_info->si_lock, flags); } -static void smi_timeout(unsigned long data) +static void smi_timeout(struct timer_list *t) { - struct smi_info *smi_info = (struct smi_info *) data; + struct smi_info *smi_info = from_timer(smi_info, t, si_timer); enum si_sm_result smi_result; unsigned long flags; unsigned long jiffies_now; @@ -1165,7 +1165,7 @@ static int smi_start_processing(void *send_info, new_smi->intf = intf; /* Set up the timer that drives the interface. */ - setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi); + timer_setup(&new_smi->si_timer, smi_timeout, 0); new_smi->timer_can_start = true; smi_mod_timer(new_smi, jiffies + SI_TIMEOUT_JIFFIES); diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 466b3a1c0adf..3cfaec728604 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -551,9 +551,9 @@ static void start_get(struct ssif_info *ssif_info) } } -static void retry_timeout(unsigned long data) +static void retry_timeout(struct timer_list *t) { - struct ssif_info *ssif_info = (void *) data; + struct ssif_info *ssif_info = from_timer(ssif_info, t, retry_timer); unsigned long oflags, *flags; bool waiting; @@ -1691,8 +1691,7 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id) spin_lock_init(&ssif_info->lock); ssif_info->ssif_state = SSIF_NORMAL; - setup_timer(&ssif_info->retry_timer, retry_timeout, - (unsigned long)ssif_info); + timer_setup(&ssif_info->retry_timer, retry_timeout, 0); for (i = 0; i < SSIF_NUM_STATS; i++) atomic_set(&ssif_info->stats[i], 0); |