Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1547495
| From | Baruch Siach <baruch@tkos.co.il> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] watchdog: constify watchdog_info structures |
| Date | 2016-12-27 06:10 +0100 |
| Message-ID | <sSSbo-6bf-5@gated-at.bofh.it> (permalink) |
| References | <sSGWB-7wy-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Bhumika Goyal,
On Mon, Dec 26, 2016 at 10:35:11PM +0530, Bhumika Goyal wrote:
> Declare watchdog_info structures as const as they are only stored in the
> info field of watchdog_device structures. This field is of type const
> struct watchdog_info *, so watchdog_info structures having this property
> can be declared const too.
> Done using Coccinelle:
>
> @r1 disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct watchdog_info i@p={...};
>
> @ok@
> identifier r1.i;
> position p;
> struct watchdog_device obj;
> @@
> obj.info=&i@p;
>
> @bad@
> position p!={r1.p,ok.p};
> identifier r1.i;
> @@
> i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> +const
> struct watchdog_info i;
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
For digicolor_wdt.c:
Acked-by: Baruch Siach <baruch@tkos.co.il>
Thanks,
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] watchdog: constify watchdog_info structures Bhumika Goyal <bhumirks@gmail.com> - 2016-12-26 18:10 +0100 Re: [PATCH v2] watchdog: constify watchdog_info structures Florian Fainelli <f.fainelli@gmail.com> - 2016-12-26 21:20 +0100 Re: [PATCH v2] watchdog: constify watchdog_info structures Baruch Siach <baruch@tkos.co.il> - 2016-12-27 06:10 +0100 Re: [PATCH v2] watchdog: constify watchdog_info structures Guenter Roeck <linux@roeck-us.net> - 2016-12-28 16:30 +0100 RE: [PATCH v2] watchdog: constify watchdog_info structures Adam Thomson <Adam.Thomson.Opensource@diasemi.com> - 2017-01-03 15:00 +0100
csiph-web