[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210820090243.GD22757@amd>
Date: Fri, 20 Aug 2021 11:02:43 +0200
From: Pavel Machek <pavel@....cz>
To: Eddie James <eajames@...ux.ibm.com>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, robh+dt@...nel.org
Subject: Re: [PATCH v2 6/7] leds: pca955x: Let the core process the fwnode
Hi!
> - err = devm_led_classdev_register(&client->dev, led);
> + init_data.fwnode = pdata->leds[i].fwnode;
> +
> + if (is_of_node(init_data.fwnode)) {
> + if (to_of_node(init_data.fwnode)->name[0] ==
> + '\0')
> + set_default_label = true;
> + else
> + set_default_label = false;
> + } else {
> + set_default_label = true;
> + }
I'd write it as
set_default_label = true;
if (... && ...)
set_default_label = false;
> + if (set_default_label) {
> + snprintf(default_label, sizeof(default_label),
> + "%d", i);
> + init_data.default_label = default_label;
> + } else {
> + init_data.default_label = NULL;
> + }
init_data.default_label = NULL;
if (...) {
set_default_label) {
> + snprintf(default_label, sizeof(default_label),
> + "%d", i);
> + init_data.default_label = default_label;
}
Thank you,
Pavel
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists