Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1701023
| From | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static |
| Date | 2017-08-01 15:20 +0200 |
| Message-ID | <u9FfA-4tk-17@gated-at.bofh.it> (permalink) |
| References | <u3C13-64w-3@gated-at.bofh.it> <u9FfB-4tk-19@gated-at.bofh.it> <u3C14-64w-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Saturday, July 15, 2017 10:07:39 PM Julia Lawall wrote: > Drop static on a local variable, when the variable is initialized before > any possible use. Thus, the static has no benefit. > > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @bad exists@ > position p; > identifier x; > type T; > @@ > static T x@p; > ... > x = <+...x...+> > > @@ > identifier x; > expression e; > type T; > position p != bad.p; > @@ > -static > T x@p; > ... when != x > when strict > ?x = e; > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Patch queued for 4.14, thanks. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-08-01 15:20 +0200
csiph-web