Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548727

Re: [PATCH] drivers: remoteproc: constify rproc_ops structures

From Bjorn Andersson <bjorn.andersson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] drivers: remoteproc: constify rproc_ops structures
Date 2016-12-30 21:10 +0100
Message-ID <sUbEZ-yH-5@gated-at.bofh.it> (permalink)
References <sPlvk-A6-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 17 Dec 03:29 PST 2016, Bhumika Goyal wrote:

> Declare rproc_ops structures as const as they are only passed as an
> argument to the function rproc_alloc. This argument is of type const, so
> rproc_ops structures having this property can be declared const too.
> Done using Coccinelle:
> 
> @r1 disable optional_qualifier @
> identifier i;
> position p;
> @@
> static struct rproc_ops i@p = {...};
> 
> @ok1@
> identifier r1.i;
> position p;
> @@
> rproc_alloc(...,&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 rproc_ops i;
> 
> File sizes before:
>    text	   data	    bss	    dec	    hex	filename
>    1258	    416	      0	   1674	    68a remoteproc/omap_remoteproc.o
>    2402	    240	      0	   2642	    a52 remoteproc/st_remoteproc.o
>    2064	    272	      0	   2336	    920 remoteproc/st_slim_rproc.o
>    2160	    240	      0	   2400	    960 remoteproc/wkup_m3_rproc.o
> 
> File sizes after:
>    text	   data	    bss	    dec	    hex	filename
>    1297	    368	      0	   1665	    681 remoteproc/omap_remoteproc.o
>    2434	    192	      0	   2626	    a42 remoteproc/st_remoteproc.o
>    2112	    240	      0	   2352	    930 remoteproc/st_slim_rproc.o
>    2200	    192	      0	   2392	    958 remoteproc/wkup_m3_rproc.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Thanks Bhumika, this looks good.

But as Suman already asked. Is there any reason why da8xx_remoteproc.c
did not get updated? It looks like the same change would apply there.


Unless I'm missing something, please update the patch and I'll be happy
to apply it.

Regards,
Bjorn

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] drivers: remoteproc: constify rproc_ops structures Bhumika Goyal <bhumirks@gmail.com> - 2016-12-17 12:40 +0100
  Re: [PATCH] drivers: remoteproc: constify rproc_ops structures Suman Anna <s-anna@ti.com> - 2016-12-22 22:30 +0100
  Re: [PATCH] drivers: remoteproc: constify rproc_ops structures Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-12-30 21:10 +0100
    Re: [PATCH] drivers: remoteproc: constify rproc_ops structures Bhumika Goyal <bhumirks@gmail.com> - 2016-12-31 11:50 +0100
      Re: [PATCH] drivers: remoteproc: constify rproc_ops structures Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-12-31 19:00 +0100
        Re: [PATCH] drivers: remoteproc: constify rproc_ops structures Bhumika Goyal <bhumirks@gmail.com> - 2017-01-01 07:30 +0100

csiph-web