From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-leds@vger.kernel.org
Subject: Re: [PATCH v2 1/4] leds: core: add generic support for color LED's
Date: Tue, 23 Feb 2016 19:58:47 +0100 [thread overview]
Message-ID: <56CCABE7.9010908@gmail.com> (raw)
In-Reply-To: <56C71FAF.50602@samsung.com>
Am 19.02.2016 um 14:59 schrieb Jacek Anaszewski:
> On 02/18/2016 09:34 PM, Heiner Kallweit wrote:
> [...]
>>>>>> /* Time to switch the LED on. */
>>>>>> brightness = led_cdev->blink_brightness;
>>>>>> delay = led_cdev->blink_delay_on;
>>>>>> @@ -133,8 +133,8 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
>>>>>> if (current_brightness)
>>>>>> led_cdev->blink_brightness = current_brightness;
>>>>>> if (!led_cdev->blink_brightness)
>>>>>> - led_cdev->blink_brightness = led_cdev->max_brightness;
>>>>>> -
>>>>>> + led_cdev->blink_brightness =
>>>>>> + led_validate_brightness(led_cdev, LED_FULL);
>>>>>
>>>>> This function name doesn't fit here, since term "validation" usually
>>>>> refers to validating user provided data.
>>>>>
>>>>> led_confine_brightness() ?
>>>>>
>>>>> And why LED_FULL and not led_cdev->max_brightness?
>>>>>
>>>> LED_FULL is reduced to max_brightness anyway by led_validate_brightness.
>>>> IMHO LED_FULL makes clearer that the intention is: switch it on.
>>>> max_brightness is a device-specific property that I'd like to hide
>>>> as far as possible in the generic core code.
>>>
>>> Without checking led_validate_brightness() internals it looks like this
>>> patch was changing led_set_software_blink() semantics.
>>>
>> As far as I can see it doesn't. In monochrome mode
>> led_validate_brightness(led_cdev, LED_FULL) evaluates to
>> led_cdev->max_brightness.
>
> I meant that looking at this change alone makes such an impression.
> Besides, if we now have led_confine_brightness(), then it implies that
> brightness will be limited up to LED_FULL level, whereas in fact
> the upper limit will be max_brightness for monochrome LEDs.
>
Ah, now I get you. Yes, at a first glance it seems like the semantics were
changed. However I don't see this as a bad thing if we interpret LED_FULL
as "maximum brightness of a device".
prev parent reply other threads:[~2016-02-23 18:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 19:27 [PATCH v2 1/4] leds: core: add generic support for color LED's Heiner Kallweit
2016-02-17 12:33 ` Jacek Anaszewski
2016-02-17 20:40 ` Heiner Kallweit
2016-02-18 10:17 ` Jacek Anaszewski
2016-02-18 20:34 ` Heiner Kallweit
2016-02-19 13:59 ` Jacek Anaszewski
2016-02-23 18:58 ` Heiner Kallweit [this message]
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=56CCABE7.9010908@gmail.com \
--to=hkallweit1@gmail.com \
--cc=j.anaszewski@samsung.com \
--cc=linux-leds@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).