c2port: annotate bitfield for kmemcheck
authorVegard Nossum <vegard.nossum@gmail.com>
Thu, 26 Feb 2009 13:05:59 +0000 (14:05 +0100)
committerVegard Nossum <vegard.nossum@gmail.com>
Mon, 15 Jun 2009 13:49:34 +0000 (15:49 +0200)
This silences a false positive warning with kmemcheck.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
drivers/misc/c2port/core.c
include/linux/c2port.h

index 0207dd59090d195b4d0d21027e511cf484e14121..b5346b4db91a2021d43c470b09bd53fbdc7a4170 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
+#include <linux/kmemcheck.h>
 #include <linux/ctype.h>
 #include <linux/delay.h>
 #include <linux/idr.h>
@@ -891,6 +892,7 @@ struct c2port_device *c2port_device_register(char *name,
                return ERR_PTR(-EINVAL);
 
        c2dev = kmalloc(sizeof(struct c2port_device), GFP_KERNEL);
+       kmemcheck_annotate_bitfield(c2dev, flags);
        if (unlikely(!c2dev))
                return ERR_PTR(-ENOMEM);
 
index 7b5a2388ba67412dda1740cf869950648668fd31..2a5cd867c365c3fd4e7f776ceb7e6d42d4e255f9 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/kmemcheck.h>
 
 #define C2PORT_NAME_LEN                        32
 
 /* Main struct */
 struct c2port_ops;
 struct c2port_device {
+       kmemcheck_bitfield_begin(flags);
        unsigned int access:1;
        unsigned int flash_access:1;
+       kmemcheck_bitfield_end(flags);
 
        int id;
        char name[C2PORT_NAME_LEN];