• B
    char: ipmi: constify ipmi_smi_handlers structures · db3b7e13
    Bhumika Goyal 提交于
    Declare ipmi_smi_handlers structures as const as they are only passed as
    an argument to the function ipmi_register_smi. This argument is of type
    const, so ipmi_smi_handlers structures having similar properties can be
    declared const too.
    Done using Coccinelle:
    
    @r1 disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct ipmi_smi_handlers i@p={...};
    
    @ok1@
    identifier r1.i;
    position p;
    @@
    ipmi_register_smi(&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 ipmi_smi_handlers i;
    
    Size details after cross compiling the .o file for powerpc architecture
    
    File size before:
      text	   data	    bss	    dec	    hex	filename
      2777	    288	      0	   3065	    bf9	drivers/char/ipmi/ipmi_powernv.o
    
    File size after:
      text	   data	    bss	    dec	    hex	filename
       2873	    192	      0	   3065	    bf9	drivers/char/ipmi/ipmi_powernv.o
    Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
    Signed-off-by: NCorey Minyard <cminyard@mvista.com>
    db3b7e13
ipmi_powernv.c 7.5 KB