[PATCH] i2c: busses: make i2c_adapter_quirks const

Wolfram Sang wsa at the-dreams.de
Wed Aug 30 06:33:40 AEST 2017


On Mon, Aug 21, 2017 at 05:42:04PM +0530, Bhumika Goyal wrote:
> Make these const as they are only stored as a reference in the quirks
> field of an i2c_adapter structure, which is const.
> 
> Done using Coccinelle:
> @match disable optional_qualifier@
> identifier s;
> @@
> static struct i2c_adapter_quirks s = {...};
> 
> @ref@
> position p;
> identifier match.s;
> @@
> s at p
> 
> @good1@
> identifier y;
> position ref.p;
> identifier match.s;
> @@
> struct i2c_adapter y = {...,.quirks=&s at p,...};
> 
> @good2@
> struct i2c_adapter y;
> identifier match.s;
> position ref.p;
> @@
> y.quirks = &s at p
> 
> @bad depends on  !good1 && !good2@
> position ref.p;
> identifier match.s;
> @@
> s at p
> 
> @depends on forall !bad disable optional_qualifier@
> identifier match.s;
> @@
> static
> + const
> struct i2c_adapter_quirks s;
> 
> Signed-off-by: Bhumika Goyal <bhumirks at gmail.com>

Removed the cocci script from the commit message and applied to
for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20170829/66323457/attachment.sig>


More information about the Linuxppc-dev mailing list