Skip to content
  • Bhumika Goyal's avatar
    mfd: constify regmap_irq_chip structures · 24e34b9d
    Bhumika Goyal authored
    
    
    Declare regmap_irq_chip structures as const as they are only stored
    in the regmap_irq_chip field of a rk808 structure. This field is of
    type const, so regmap_irq_chip structures having this property can be
    made const too.
    Done using Coccinelle:
    
    @r disable optional_qualifier@
    identifier x;
    position p;
    @@
    static struct regmap_irq_chip x@p={...};
    
    @ok@
    struct rk808 a;
    identifier r.x;
    position p;
    @@
    a.regmap_irq_chip=&x@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.x;
    @@
    x@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.x;
    @@
    +const
    struct regmap_irq_chip x;
    
    File size before:
       text	   data	    bss	    dec	    hex	filename
       5033	    584	     16	   5633	   1601	drivers/mfd/rk808.o
    
    File size after:
       text	   data	    bss	    dec	    hex	filename
       5225	    392	     16	   5633	   1601	drivers/mfd/rk808.o
    
    Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    24e34b9d