linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-dev@sang-engineering.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	kernel-janitors@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [2/2] i2c: constify i2c_adapter_quirks structures
Date: Fri, 18 Nov 2016 02:00:08 +0100	[thread overview]
Message-ID: <20161118010008.GA24025@katana> (raw)
In-Reply-To: <1476552722-12352-3-git-send-email-Julia.Lawall@lip6.fr>

[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

On Sat, Oct 15, 2016 at 07:32:02PM +0200, Julia Lawall wrote:
> Check for i2c_adapter_quirks structures that are only stored in the
> quirks field of an i2c_adapter structure.  This field is declared
> const, so i2c_adapter_quirks structures that have this property can be
> declared as const also.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct i2c_adapter_quirks i@p = { ... };
> 
> @ok@
> identifier r.i;
> struct i2c_adapter e;
> position p;
> @@
> e.quirks = &i@p;
> 
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct i2c_adapter_quirks e;
> @@
> e@i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct i2c_adapter_quirks i = { ... };
> // </smpl>
> 
> The effect on the layout of the .o files is shown by the following
> output of the size command, first before then after the
> transformation:
> 
>    text    data     bss     dec     hex filename
>    3651     472       8    4131    1023 drivers/i2c/busses/i2c-axxia.o
>    3683     440       8    4131    1023 drivers/i2c/busses/i2c-axxia.o
> 
>    text    data     bss     dec     hex filename
>    1069     216       0    1285     505 drivers/i2c/busses/i2c-dln2.o
>    1101     192       0    1293     50d drivers/i2c/busses/i2c-dln2.o
> 
>    text    data     bss     dec     hex filename
>    3211     484       1    3696     e70 drivers/i2c/busses/i2c-viperboard.o
>    3243     460       1    3704     e78 drivers/i2c/busses/i2c-viperboard.o
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Squashed with the other similar patch and applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-11-18  1:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15 17:32 [PATCH 0/2] constify i2c_adapter_quirks structures Julia Lawall
2016-10-15 17:32 ` [PATCH 1/2] i2c: bcm-iproc: " Julia Lawall
2016-10-17 17:49   ` Ray Jui
2016-10-15 17:32 ` [PATCH 2/2] i2c: " Julia Lawall
2016-11-18  1:00   ` Wolfram Sang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161118010008.GA24025@katana \
    --to=wsa-dev@sang-engineering.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).