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: <20171130094019.GA21887@amd>
Date:   Thu, 30 Nov 2017 10:40:19 +0100
From:   Pavel Machek <pavel@....cz>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Richard Purdie <rpurdie@...ys.net>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Lee Jones <lee.jones@...aro.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Linux-Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: [PATCH] leds: pm8058: Make ledtype pointer sized type

On Wed 2017-11-29 19:05:43, Bjorn Andersson wrote:
> The pointer returned by of_device_get_match_data() doesn't have the same
> size as u32 on 64-bit architectures, causing issues when compile testing
> the driver on such platform. Make ledtype unsigned long instead, to
> solve this problem.
> 
> Fixes: 7f866986e705 ("leds: add PM8058 LEDs driver")
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>

Ummm... no?

extern const void *of_device_get_match_data(const struct device *dev);


> diff --git a/drivers/leds/leds-pm8058.c b/drivers/leds/leds-pm8058.c
> index a52674327857..cc2afe81720d 100644
> --- a/drivers/leds/leds-pm8058.c
> +++ b/drivers/leds/leds-pm8058.c
> @@ -29,7 +29,7 @@
>  struct pm8058_led {
>  	struct regmap *map;
>  	u32 reg;
> -	u32 ledtype;
> +	unsigned long ledtype;

Make it void *. u32 is buggy. unsigned long is merely ugly code. void
* is not nice, but certainly better than unsigned long.

Thanks,
									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