lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ