lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170111001419.vefa3knfkynnmflr@piout.net>
Date:   Wed, 11 Jan 2017 01:14:19 +0100
From:   Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:     Bhumika Goyal <bhumirks@...il.com>
Cc:     julia.lawall@...6.fr, a.zummo@...ertech.it,
        rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: constify rtc_class_ops structures

On 05/01/2017 at 22:25:05 +0530, Bhumika Goyal wrote :
> Declare rtc_class_ops structures as const as they are only passed
> as an argument to the function devm_rtc_device_register. This argument
> is of type const struct rtc_class_ops *, so rtc_class_ops structures
> having this property can be declared const.
> Done using Coccinelle:
> 
> @r1 disable optional_qualifier @
> identifier i;
> position p;
> @@
> static struct rtc_class_ops i@p = {...};
> 
> @ok1@
> identifier r1.i;
> position p;
> @@
> devm_rtc_device_register(...,&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 rtc_class_ops i;
> 
> File size details:
> 
>    text	   data	    bss	    dec	    hex	filename
>     559	    320	      0	    879	    36f	drivers/rtc/rtc-dm355evm.o
>     671	    192	      0	    863	    35f	drivers/rtc/rtc-dm355evm.o
> 
>    4727	    320	      0	   5047	   13b7	drivers/rtc/rtc-imxdi.o
>    4855	    192	      0	   5047	   13b7	drivers/rtc/rtc-imxdi.o
> 
>    1269     192       0    1461     5b5 drivers/rtc/rtc-mxc.o
> 
> File size remains unchanged for : drivers/rtc/rtc-mxc.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@...il.com>
> ---
>  drivers/rtc/rtc-dm355evm.c | 2 +-
>  drivers/rtc/rtc-imxdi.c    | 2 +-
>  drivers/rtc/rtc-mxc.c      | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ