/// Remove an open coded simple_open() function /// and replace file operations references to the function /// with simple_open() instead. /// // Confidence: High // Comments: // Options: --no-includes --include-headers virtual patch virtual report @ open depends on patch @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ..., -.open = open_f, +.open = simple_open, ... }; @ openr depends on report @ identifier open_f != simple_open; identifier i, f; position p; @@ int open_f@p(struct inode *i, struct file *f) { ( if (i->i_private) f->private_data = i->i_private; | f->private_data = i->i_private; ) return 0; } @ has_openr depends on openr @ identifier fops; identifier openr.open_f; position p; @@ struct file_operations fops = { ..., .open = open_f@p, ... }; @script:python@ pf << openr.p; ps << has_openr.p; @@ coccilib.report.print_report(pf[0],"WARNING opportunity for simple_open, see also structure on line %s"%(ps[0].line)) option value='packet-loop-back'>packet-loop-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/include/drm/drm_mode_object.h
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2017-01-25 00:54:07 +0530
committerDan Williams <dan.j.williams@intel.com>2017-01-31 18:16:30 -0800
commit970d14e3989160ee9e97c7d75ecbc893fd29dab9 (patch)
tree4a731cac4efedb17f86a912ec56c151d26792abe /include/drm/drm_mode_object.h
parent7a308bb3016f57e5be11a677d15b821536419d36 (diff)
nvdimm: constify device_type structures
Declare device_type structure as const as it is only stored in the type field of a device structure. This field is of type const, so add const to declaration of device_type structure. File size before: text data bss dec hex filename 19278 3199 16 22493 57dd nvdimm/namespace_devs.o File size after: text data bss dec hex filename 19929 3160 16 23105 5a41 nvdimm/namespace_devs.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/drm/drm_mode_object.h')