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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vdw6gCN=45iRdKcm=qT07Z90+z6Cw=inYR+C6+5gML+_Q@mail.gmail.com>
Date: Tue, 16 Apr 2024 20:29:05 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Kate Hsuan <hpa@...hat.com>
Cc: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>, linux-leds@...r.kernel.org, 
	platform-driver-x86@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>, 
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, 
	André Apitzsch <git@...tzsch.eu>, 
	linux-kernel@...r.kernel.org, Sebastian Reichel <sre@...nel.org>, linux-pm@...r.kernel.org
Subject: Re: [PATCH v6 2/5] leds: rgb: leds-ktd202x: Get device properties
 through fwnode to support ACPI

On Tue, Apr 16, 2024 at 8:39 AM Kate Hsuan <hpa@...hat.com> wrote:
>
> This LED controller is installed on a Xiaomi pad2 and it is an x86
> platform. The original driver is based on the device tree and can't be
> used for this ACPI based system. This patch migrated the driver to use
> fwnode to access the properties. Moreover, the fwnode API supports the
> device tree so this work won't affect the original implementations.

..

> -       int num_channels;
> +       int num_channels = 0;

Split this assignment, so...

>         int i = 0;

> -       num_channels = of_get_available_child_count(np);

..it become

  num_channels = 0;

here.

> +       fwnode_for_each_available_child_node(fwnode, child)
> +               num_channels++;

..

> -static int ktd202x_add_led(struct ktd202x *chip, struct device_node *np, unsigned int index)
> +static int ktd202x_add_led(struct ktd202x *chip,
> +                          struct fwnode_handle *fwnode,
> +                          unsigned int index)

Why split over 3 lines? I believe it can be still two or one
(depending if you use a relaxed limit).

..

>  static int ktd202x_probe_dt(struct ktd202x *chip)

Perhaps you want to rename this to something like ktd202x_probe_fw().

..

> +       fwnode = dev_fwnode(dev);

Will be no use if the bellow applied, right?

..

> -       for_each_available_child_of_node(np, child) {
> +       fwnode_for_each_available_child_node(fwnode, child) {

Use device_for_each_child_node() instead.

>         }

..

> -       .shutdown = ktd202x_shutdown,
> +       .shutdown = ktd202x_shutdown

Stray change.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ