lkml.org 
[lkml]   [2020]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 00/16] constify copied structure
Date
Make const static structures that are just copied into other structures.

The semantic patch that detects the opportunity for this change is as
follows: (http://coccinelle.lip6.fr/)

<smpl>
@r disable optional_qualifier@
identifier i,j;
position p;
@@
static struct i j@p = { ... };

@upd@
position p1;
identifier r.j;
expression e;
@@
e = j@p1

@ref@
position p2 != {r.p,upd.p1};
identifier r.j;
@@
j@p2

@script:ocaml depends on upd && !ref@
i << r.i;
j << r.j;
p << r.p;
@@
if j = (List.hd p).current_element
then Coccilib.print_main i p
</smpl>

---

arch/powerpc/sysdev/mpic.c | 4 ++--
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 2 +-
drivers/media/i2c/mt9v111.c | 2 +-
drivers/media/platform/davinci/isif.c | 2 +-
drivers/media/usb/cx231xx/cx231xx-dvb.c | 2 +-
drivers/media/usb/dvb-usb-v2/anysee.c | 4 ++--
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 +-
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 2 +-
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 2 +-
drivers/ptp/ptp_clockmatrix.c | 2 +-
drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +-
drivers/video/fbdev/sa1100fb.c | 2 +-
net/sunrpc/xdr.c | 2 +-
sound/isa/ad1816a/ad1816a_lib.c | 2 +-
sound/pci/hda/hda_controller.c | 2 +-
sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
16 files changed, 18 insertions(+), 18 deletions(-)

\
 
 \ /
  Last update: 2020-01-01 09:21    [W:0.133 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site