Re: [PATCH v2 3/5] sh: mach-rsk: rsk7203: use static device properties for LEDs and GPIO buttons

Andy Shevchenko <[email protected]>
Newsgroups gmane.linux.kernel.renesas-soc,gmane.linux.ports.sh.devel,gmane.linux.kernel,gmane.linux.kernel.gpio
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Tue, Jun 02, 2026 at 04:52:37PM -0700, Dmitry Torokhov wrote:
> On Wed, Jun 03, 2026 at 02:45:34AM +0300, Andy Shevchenko wrote:
> > On Tue, Jun 02, 2026 at 03:06:14PM -0700, Dmitry Torokhov wrote:
> > > On Wed, Jun 03, 2026 at 01:02:56AM +0300, Andy Shevchenko wrote:
> > > > On Wed, May 20, 2026 at 10:13:19PM -0700, Dmitry Torokhov wrote:

...

> > > > > +	for (i = 0; i < ARRAY_SIZE(rsk7203_devices); i++) {
> > > > 
> > > > 	for (unsigned int i = 0; i < ARRAY_SIZE(rsk7203_devices); i++) {
> > > > 
> > > > ...and drop the above definition of i.
> > > 
> > > Why? I do not see coding style suggesting this. 
> > 
> > Linus Torvalds.
> 
> Context matters.
> 
> If you want this to be a universal requirement work on adding this to
> coding style and to checkpatch. Otherwise declaring loop iterator inside
> the loop can be beneficial but in many cases it does not really matter
> and can be left to the code author and the revealing style for the
> affected code area.

From the common sense perspective this makes code shorter and isolated, which
is a good thing as it makes it robust against wrong re-use of the iterator
variable.

Anyway, I replied already with a link.

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.