* [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures [not found] ` <20140823152015.GB2074@thin> @ 2014-08-23 15:50 ` Julia Lawall 2014-08-23 16:03 ` Josh Triplett 2014-08-26 10:43 ` Tomi Valkeinen 0 siblings, 2 replies; 3+ messages in thread From: Julia Lawall @ 2014-08-23 15:50 UTC (permalink / raw) To: Josh Triplett Cc: Paul Mackerras, kernel-janitors, Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev, linux-kernel From nobody Sat Aug 23 12:48:19 CEST 2014 From: Julia Lawall <Julia.Lawall@lip6.fr> To: Paul Mackerras <paulus@samba.org> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,Tomi Valkeinen <tomi.valkeinen@ti.com>,linux-fbdev@vger.kernel.org,linux-kernel@vger.kernel.org Subject: [PATCH 8/9] video: fbdev: aty: use c99 initializers in structures From: Julia Lawall <Julia.Lawall@lip6.fr> Use c99 initializers for structures. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @decl@ identifier i1,fld; type T; field list[n] fs; @@ struct i1 { fs T fld; ...}; @bad@ identifier decl.i1,i2; expression e; initializer list[decl.n] is; @@ struct i1 i2 = { is, + .fld = e - e ,...}; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- The patches in this series do not depend on each other. v2: Move close braces down to the next line and add trailing commas, as suggested by Josh Triplett. diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index ff60701..aedf2fb 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -324,14 +324,61 @@ struct aty128_meminfo { }; /* various memory configurations */ -static const struct aty128_meminfo sdr_128 - { 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" }; -static const struct aty128_meminfo sdr_64 - { 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" }; -static const struct aty128_meminfo sdr_sgram - { 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" }; -static const struct aty128_meminfo ddr_sgram - { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; +static const struct aty128_meminfo sdr_128 = { + .ML = 4, + .MB = 4, + .Trcd = 3, + .Trp = 3, + .Twr = 1, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 30, + .Rloop = 16, + .name = "128-bit SDR SGRAM (1:1)", +}; + +static const struct aty128_meminfo sdr_64 = { + .ML = 4, + .MB = 8, + .Trcd = 3, + .Trp = 3, + .Twr = 1, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 17, + .DspOn = 46, + .Rloop = 17, + .name = "64-bit SDR SGRAM (1:1)", +}; + +static const struct aty128_meminfo sdr_sgram = { + .ML = 4, + .MB = 4, + .Trcd = 1, + .Trp = 2, + .Twr = 1, + .CL = 2, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 24, + .Rloop = 16, + .name = "64-bit SDR SGRAM (2:1)", +}; + +static const struct aty128_meminfo ddr_sgram = { + .ML = 4, + .MB = 4, + .Trcd = 3, + .Trp = 3, + .Twr = 2, + .CL = 3, + .Tr2w = 1, + .LoopLatency = 16, + .DspOn = 31, + .Rloop = 16, + .name = "64-bit DDR SGRAM", +}; static struct fb_fix_screeninfo aty128fb_fix = { .id = "ATY Rage128", ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures 2014-08-23 15:50 ` [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures Julia Lawall @ 2014-08-23 16:03 ` Josh Triplett 2014-08-26 10:43 ` Tomi Valkeinen 1 sibling, 0 replies; 3+ messages in thread From: Josh Triplett @ 2014-08-23 16:03 UTC (permalink / raw) To: Julia Lawall Cc: Paul Mackerras, kernel-janitors, Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev, linux-kernel On Sat, Aug 23, 2014 at 05:50:28PM +0200, Julia Lawall wrote: > From: Julia Lawall <Julia.Lawall@lip6.fr> > > Use c99 initializers for structures. > > A simplified version of the semantic match that finds this problem is as > follows: (http://coccinelle.lip6.fr/) > > // <smpl> > @decl@ > identifier i1,fld; > type T; > field list[n] fs; > @@ > > struct i1 { > fs > T fld; > ...}; > > @bad@ > identifier decl.i1,i2; > expression e; > initializer list[decl.n] is; > @@ > > struct i1 i2 = { is, > + .fld = e > - e > ,...}; > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Josh Triplett <josh@joshtriplett.org> > v2: Move close braces down to the next line and add trailing commas, as > suggested by Josh Triplett. > > diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c > index ff60701..aedf2fb 100644 > --- a/drivers/video/fbdev/aty/aty128fb.c > +++ b/drivers/video/fbdev/aty/aty128fb.c > @@ -324,14 +324,61 @@ struct aty128_meminfo { > }; > > /* various memory configurations */ > -static const struct aty128_meminfo sdr_128 > - { 4, 4, 3, 3, 1, 3, 1, 16, 30, 16, "128-bit SDR SGRAM (1:1)" }; > -static const struct aty128_meminfo sdr_64 > - { 4, 8, 3, 3, 1, 3, 1, 17, 46, 17, "64-bit SDR SGRAM (1:1)" }; > -static const struct aty128_meminfo sdr_sgram > - { 4, 4, 1, 2, 1, 2, 1, 16, 24, 16, "64-bit SDR SGRAM (2:1)" }; > -static const struct aty128_meminfo ddr_sgram > - { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; > +static const struct aty128_meminfo sdr_128 = { > + .ML = 4, > + .MB = 4, > + .Trcd = 3, > + .Trp = 3, > + .Twr = 1, > + .CL = 3, > + .Tr2w = 1, > + .LoopLatency = 16, > + .DspOn = 30, > + .Rloop = 16, > + .name = "128-bit SDR SGRAM (1:1)", > +}; > + > +static const struct aty128_meminfo sdr_64 = { > + .ML = 4, > + .MB = 8, > + .Trcd = 3, > + .Trp = 3, > + .Twr = 1, > + .CL = 3, > + .Tr2w = 1, > + .LoopLatency = 17, > + .DspOn = 46, > + .Rloop = 17, > + .name = "64-bit SDR SGRAM (1:1)", > +}; > + > +static const struct aty128_meminfo sdr_sgram = { > + .ML = 4, > + .MB = 4, > + .Trcd = 1, > + .Trp = 2, > + .Twr = 1, > + .CL = 2, > + .Tr2w = 1, > + .LoopLatency = 16, > + .DspOn = 24, > + .Rloop = 16, > + .name = "64-bit SDR SGRAM (2:1)", > +}; > + > +static const struct aty128_meminfo ddr_sgram = { > + .ML = 4, > + .MB = 4, > + .Trcd = 3, > + .Trp = 3, > + .Twr = 2, > + .CL = 3, > + .Tr2w = 1, > + .LoopLatency = 16, > + .DspOn = 31, > + .Rloop = 16, > + .name = "64-bit DDR SGRAM", > +}; > > static struct fb_fix_screeninfo aty128fb_fix = { > .id = "ATY Rage128", ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures 2014-08-23 15:50 ` [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures Julia Lawall 2014-08-23 16:03 ` Josh Triplett @ 2014-08-26 10:43 ` Tomi Valkeinen 1 sibling, 0 replies; 3+ messages in thread From: Tomi Valkeinen @ 2014-08-26 10:43 UTC (permalink / raw) To: Julia Lawall, Josh Triplett Cc: Paul Mackerras, kernel-janitors, Jean-Christophe Plagniol-Villard, linux-fbdev, linux-kernel [-- Attachment #1: Type: text/plain, Size: 830 bytes --] Hi, On 23/08/14 18:50, Julia Lawall wrote: > From nobody Sat Aug 23 12:48:19 CEST 2014 > From: Julia Lawall <Julia.Lawall@lip6.fr> > To: Paul Mackerras <paulus@samba.org> > Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,Tomi Valkeinen <tomi.valkeinen@ti.com>,linux-fbdev@vger.kernel.org,linux-kernel@vger.kernel.org > Subject: [PATCH 8/9] video: fbdev: aty: use c99 initializers in structures > > From: Julia Lawall <Julia.Lawall@lip6.fr> > > Use c99 initializers for structures. > > A simplified version of the semantic match that finds this problem is as > follows: (http://coccinelle.lip6.fr/) This mail had some extra stuff above (From nobody... etc). I cleaned it up, hopefully correctly. I've applied the fbdev patches from this series, 2, 7 and 8, for v3.18. Thanks! Tomi [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-26 10:43 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1408792831-25615-1-git-send-email-Julia.Lawall@lip6.fr> [not found] ` <1408792831-25615-9-git-send-email-Julia.Lawall@lip6.fr> [not found] ` <20140823152015.GB2074@thin> 2014-08-23 15:50 ` [PATCH 8/9 v2] video: fbdev: aty: use c99 initializers in structures Julia Lawall 2014-08-23 16:03 ` Josh Triplett 2014-08-26 10:43 ` Tomi Valkeinen
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).