• Bhumika Goyal's avatar
    mailbox: constify mbox_chan_ops structures · 8ce33c6f
    Bhumika Goyal authored
    Check for mbox_chan_ops structures that are only stored in the ops field
    of a mbox_controller structure. This field is of type const struct
    mbox_chan_ops *, so mbox_chan_ops structures having this property can be
    declared as const.
    Done using Coccinelle:
    
    @r1 disable optional_qualifier @
    identifier i;
    position p;
    @@
    struct mbox_chan_ops i@p = {...};
    
    @ok1@
    identifier r1.i;
    struct hi6220_mbox mbox;
    struct slimpro_mbox ctx;
    position p;
    @@
    (
    mbox.controller.ops=&i@p
    |
    ctx.mb_ctrl.ops=&i@p
    )
    
    @bad@
    position p!={r1.p,ok1.p};
    identifier r1.i;
    @@
    i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r1.i;
    @@
    +const
    struct mbox_chan_ops i;
    
    File size details:
    
       text	   data	    bss	    dec	    hex	filename
       2310	    248	      0	   2558	    9fe	drivers/mailbox/hi6220-mailbox.o
       2366	    192	      0	   2558	    9fe	drivers/mailbox/hi6220-mailbox.o
    
       1500	    248	      0	   1748	    6d4 mailbox/mailbox-xgene-slimpro.o
       1556	    192	      0	   1748	    6d4 mailbox/mailbox-xgene-slimpro.o
    Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
    Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
    8ce33c6f
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
arm_mhu.c Loading commit data...
bcm-pdc-mailbox.c Loading commit data...
bcm2835-mailbox.c Loading commit data...
hi6220-mailbox.c Loading commit data...
mailbox-altera.c Loading commit data...
mailbox-sti.c Loading commit data...
mailbox-test.c Loading commit data...
mailbox-xgene-slimpro.c Loading commit data...
mailbox.c Loading commit data...
mailbox.h Loading commit data...
omap-mailbox.c Loading commit data...
pcc.c Loading commit data...
pl320-ipc.c Loading commit data...
platform_mhu.c Loading commit data...
rockchip-mailbox.c Loading commit data...
tegra-hsp.c Loading commit data...
ti-msgmgr.c Loading commit data...