[PATCH] hp drivers/input stuff: C99 initializers, NULL noise removal, __user annotations
authorAl Viro <viro@ftp.linux.org.uk>
Sat, 14 Oct 2006 15:52:36 +0000 (16:52 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 15 Oct 2006 18:00:58 +0000 (11:00 -0700)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/input/misc/hp_sdc_rtc.c
drivers/input/serio/hil_mlc.c
drivers/input/serio/hp_sdc.c

index 1be963961c15734bfd923c07c589ab6a1a8f2a47..ab4da79ee560d9279afc989d129715c45dd1593c 100644 (file)
@@ -60,7 +60,7 @@ static struct fasync_struct *hp_sdc_rtc_async_queue;
 
 static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
 
-static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
+static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
                               size_t count, loff_t *ppos);
 
 static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
@@ -385,14 +385,14 @@ static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd)
        return 0;
 }
 
-static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
+static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
                               size_t count, loff_t *ppos) {
        ssize_t retval;
 
         if (count < sizeof(unsigned long))
                 return -EINVAL;
 
-       retval = put_user(68, (unsigned long *)buf);
+       retval = put_user(68, (unsigned long __user *)buf);
        return retval;
 }
 
@@ -696,7 +696,7 @@ static int __init hp_sdc_rtc_init(void)
        if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
                return ret;
        misc_register(&hp_sdc_rtc_dev);
-        create_proc_read_entry ("driver/rtc", 0, 0, 
+        create_proc_read_entry ("driver/rtc", 0, NULL,
                                hp_sdc_rtc_read_proc, NULL);
 
        printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded "
index bdfde046b7410b0df4370b92c7913f96fe1c9823..49e11e2c1d5dd24e08c8c0caab91d270e805c19e 100644 (file)
@@ -391,23 +391,23 @@ static int hilse_operate(hil_mlc *mlc, int repoll) {
 }
 
 #define FUNC(funct, funct_arg, zero_rc, neg_rc, pos_rc) \
-{ HILSE_FUNC,          { func: &funct }, funct_arg, zero_rc, neg_rc, pos_rc },
+{ HILSE_FUNC,          { .func = funct }, funct_arg, zero_rc, neg_rc, pos_rc },
 #define OUT(pack) \
-{ HILSE_OUT,           { packet: pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 },
+{ HILSE_OUT,           { .packet = pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 },
 #define CTS \
-{ HILSE_CTS,           { packet: 0    }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 },
+{ HILSE_CTS,           { .packet = 0    }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 },
 #define EXPECT(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT,                { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT,                { .packet = comp }, to, got, got_wrong, timed_out },
 #define EXPECT_LAST(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT_LAST,   { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT_LAST,   { .packet = comp }, to, got, got_wrong, timed_out },
 #define EXPECT_DISC(comp, to, got, got_wrong, timed_out) \
-{ HILSE_EXPECT_DISC,   { packet: comp }, to, got, got_wrong, timed_out },
+{ HILSE_EXPECT_DISC,   { .packet = comp }, to, got, got_wrong, timed_out },
 #define IN(to, got, got_error, timed_out) \
-{ HILSE_IN,            { packet: 0    }, to, got, got_error, timed_out },
+{ HILSE_IN,            { .packet = 0    }, to, got, got_error, timed_out },
 #define OUT_DISC(pack) \
-{ HILSE_OUT_DISC,      { packet: pack }, 0, 0, 0, 0 },
+{ HILSE_OUT_DISC,      { .packet = pack }, 0, 0, 0, 0 },
 #define OUT_LAST(pack) \
-{ HILSE_OUT_LAST,      { packet: pack }, 0, 0, 0, 0 },
+{ HILSE_OUT_LAST,      { .packet = pack }, 0, 0, 0, 0 },
 
 struct hilse_node hil_mlc_se[HILSEN_END] = {
 
index ba7b920347e3f11c5b2e2b889b5c8e4d2987545c..9907ad3bea23252547a6a26c6cfd4d4dafae1269 100644 (file)
@@ -310,7 +310,7 @@ static void hp_sdc_tasklet(unsigned long foo) {
                                 * in tasklet/bh context.
                                 */
                                if (curr->act.irqhook) 
-                                       curr->act.irqhook(0, 0, 0, 0);
+                                       curr->act.irqhook(0, NULL, 0, 0);
                        }
                        curr->actidx = curr->idx;
                        curr->idx++;
@@ -525,7 +525,7 @@ actdone:
                up(curr->act.semaphore);
        }
        else if (act & HP_SDC_ACT_CALLBACK) {
-               curr->act.irqhook(0,0,0,0);
+               curr->act.irqhook(0,NULL,0,0);
        }
        if (curr->idx >= curr->endidx) { /* This transaction is over. */
                if (act & HP_SDC_ACT_DEALLOC) kfree(curr);