Commit c53bd2e1 authored by Vegard Nossum's avatar Vegard Nossum

c2port: annotate bitfield for kmemcheck

This silences a false positive warning with kmemcheck.
Signed-off-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
parent 9e337b0f
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kmemcheck.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/idr.h> #include <linux/idr.h>
...@@ -891,6 +892,7 @@ struct c2port_device *c2port_device_register(char *name, ...@@ -891,6 +892,7 @@ struct c2port_device *c2port_device_register(char *name,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
c2dev = kmalloc(sizeof(struct c2port_device), GFP_KERNEL); c2dev = kmalloc(sizeof(struct c2port_device), GFP_KERNEL);
kmemcheck_annotate_bitfield(c2dev, flags);
if (unlikely(!c2dev)) if (unlikely(!c2dev))
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <linux/device.h> #include <linux/device.h>
#include <linux/kmemcheck.h>
#define C2PORT_NAME_LEN 32 #define C2PORT_NAME_LEN 32
...@@ -20,8 +21,10 @@ ...@@ -20,8 +21,10 @@
/* Main struct */ /* Main struct */
struct c2port_ops; struct c2port_ops;
struct c2port_device { struct c2port_device {
kmemcheck_bitfield_begin(flags);
unsigned int access:1; unsigned int access:1;
unsigned int flash_access:1; unsigned int flash_access:1;
kmemcheck_bitfield_end(flags);
int id; int id;
char name[C2PORT_NAME_LEN]; char name[C2PORT_NAME_LEN];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment