From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>,
dmurphy@ti.com, linux-leds@vger.kernel.org,
linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH] leds: tlc591xx: update the maximum brightness
Date: Sun, 13 Oct 2019 18:36:01 +0200 [thread overview]
Message-ID: <844845d6-01fe-50c4-94cd-e19ce8a5d060@gmail.com> (raw)
In-Reply-To: <20191013114508.GI5653@amd>
On 10/13/19 1:45 PM, Pavel Machek wrote:
> Hi!
>
>>> @@ -112,11 +113,11 @@ tlc591xx_brightness_set(struct led_classdev *led_cdev,
>>> struct tlc591xx_priv *priv = led->priv;
>>> int err;
>>>
>>> - switch (brightness) {
>>> + switch ((int)brightness) {
>>> case 0:
>
> Can we get a rid of the cast here? Do we need to move away from the
> enum for the brightness?
I at first also wanted to ask for dropping the cast but first tried
to do it myself. Then I found out compiler (or sparse, I don't recall
exactly) complains about TLC591XX_MAX_BRIGHTNESS not being a value of
enum led_brighteess type. That's the reason for the cast Jean added,
I presume.
>> Added tag:
>>
>> Fixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c
>> LED driver")
>>
>> and applied to the for-5.5 branch.
>
> Actually, careful with the Fixes tag. -stable people will want to
> apply it, and it may not be a good idea in this case. Maximum
> brightness of 256 is pretty unusual, so I'd call this "a bit risky".
I entirely disagree. Not seeing anything risky in that since
max_brightness is also initialized to this value. If userspace properly
uses the ABI, then it will be safe.
> Best regards,
> Pavel
>
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2019-10-13 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 10:02 [PATCH] leds: tlc591xx: update the maximum brightness Jean-Jacques Hiblot
2019-09-24 19:26 ` Jacek Anaszewski
2019-10-13 11:45 ` Pavel Machek
2019-10-13 16:36 ` Jacek Anaszewski [this message]
2019-10-14 10:37 ` Jean-Jacques Hiblot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=844845d6-01fe-50c4-94cd-e19ce8a5d060@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=andrew@lunn.ch \
--cc=dmurphy@ti.com \
--cc=jjhiblot@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox