Messages in this thread | | | Date | Sun, 1 Oct 2023 19:05:40 +0200 | From | Uwe Kleine-König <> | Subject | Re: [PATCH v5 2/2] leds: add ktd202x driver |
| |
Hello André,
On Sun, Oct 01, 2023 at 06:56:20PM +0200, André Apitzsch wrote: > Am Sonntag, dem 01.10.2023 um 17:15 +0200 schrieb Christophe JAILLET: > > Le 01/10/2023 à 15:52, André Apitzsch a écrit : > > > + for_each_available_child_of_node(np, child) { > > > + u32 mono_color = 0; > > > > Un-needed init. > > And, why is it defined here, while reg is defined out-side the loop? > > I'll move it out-side the loop (without initialization).
In my book a variable with a narrow scope is better. I didn't check, but if you can restrict both variables to the for loop, that's nicer.
Best regards Uwe
-- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [unhandled content-type:application/pgp-signature] | |