linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Bhumika Goyal <bhumirks@gmail.com>
Cc: linux@prisktech.co.nz, julia.lawall@lip6.fr,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH] pwm: constify pwm_ops structures
Date: Wed, 18 Jan 2017 11:49:36 +0100	[thread overview]
Message-ID: <20170118104936.GJ18989@ulmo.ba.sec> (raw)
In-Reply-To: <1484071926-21582-1-git-send-email-bhumirks@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1766 bytes --]

On Tue, Jan 10, 2017 at 11:42:06PM +0530, Bhumika Goyal wrote:
> Declare pwm_ops structures as const as they are only stored in the ops
> field of a pwm_chip structure. This field is of type const struct pwm_ops
> *, so pwm_ops structures having this property can be declared as const.
> Done using Coccinelle:
> 
> @r1 disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct pwm_ops i@p={...};
> 
> @ok1@
> identifier r1.i;
> position p;
> struct pxa_pwm_chip pwm;
> struct bfin_pwm_chip bwm;
> struct vt8500_chip vp;
> struct imx_chip icp;
> @@
> (
> pwm.chip.ops=&i@p
> |
> bwm.chip.ops=&i@p
> |
> vp.chip.ops=&i@p
> |
> icp.chip.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 pwm_ops i;
> 
> File size details:
> 
>    text	   data	    bss	    dec	    hex	filename
>    1646	    328	      0	   1974	    7b6	drivers/pwm/pwm-imx.o
>    1742	    224	      0	   1966	    7ae	drivers/pwm/pwm-imx.o
> 
>    1941	    296	      0	   2237	    8bd	drivers/pwm/pwm-pxa.o
>    2037	    192	      0	   2229	    8b5	drivers/pwm/pwm-pxa.o
> 
>    1946	    296	      0	   2242	    8c2	drivers/pwm/pwm-vt8500.o
>    2050	    192	      0	   2242	    8c2	drivers/pwm/pwm-vt8500.o
> 
> The drivers/pwm/pwm-bfin.o file did not compile.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> File: drivers/pwm/pwm-bfin.c is not tested
> 
>  drivers/pwm/pwm-bfin.c   | 2 +-
>  drivers/pwm/pwm-imx.c    | 2 +-
>  drivers/pwm/pwm-pxa.c    | 2 +-
>  drivers/pwm/pwm-vt8500.c | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

Thierry

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2017-01-18 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 18:12 [PATCH] pwm: constify pwm_ops structures Bhumika Goyal
2017-01-18 10:49 ` Thierry Reding [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=20170118104936.GJ18989@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=bhumirks@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@prisktech.co.nz \
    /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).