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: <20190424140128.GD14360@amd>
Date:   Wed, 24 Apr 2019 16:01:28 +0200
From:   Pavel Machek <pavel@....cz>
To:     Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc:     linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, robh@...nel.org, dtor@...gle.com,
        linux@...ck-us.net, Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: Re: [PATCH v4 22/26] leds: as3645a: Use generic support for
 composing LED names

Hi!

> Switch to using generic LED support for composing LED class
> device name.
> 
> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@...il.com>
> Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>

> +static int as3645a_led_class_setup(struct as3645a *flash)
>  {
>  	struct led_classdev *fled_cdev = &flash->fled.led_cdev;
>  	struct led_classdev *iled_cdev = &flash->iled_cdev;
> +	struct led_init_data init_data;

Not initialized.

>  	struct led_flash_setting *cfg;
>  	int rval;
>  
> -	iled_cdev->name = names->indicator;
>  	iled_cdev->brightness_set_blocking = as3645a_set_indicator_brightness;
>  	iled_cdev->max_brightness =
>  		flash->cfg.indicator_max_ua / AS_INDICATOR_INTENSITY_STEP;
>  	iled_cdev->flags = LED_CORE_SUSPENDRESUME;
>  
> -	rval = led_classdev_register(&flash->client->dev, iled_cdev);
> +	init_data.fwnode = flash->indicator_node;
> +	init_data.devicename = AS_NAME;
> +	init_data.default_label = "indicator";

And struct has one more field:

	 +       /*
	 +        * indicates if LED name should always comprise
         devicename section;
	 +        * only LEDs exposed by drivers of hot-pluggable
         devices should
	 +        * set it to true
	 +        */
	 +       bool devname_mandatory;
	  };

I believe it would be cleaner to always initialize struct with zeros;
that way you can also expand it in future.
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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