From: Bagas Sanjaya <bagasdotme@gmail.com>
To: "Guilherme Giácomo Simões" <trintaeoitogc@gmail.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Linux LED Devices" <linux-leds@vger.kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, Hans de Goede <hdegoede@redhat.com>,
Lee Jones <lee@kernel.org>
Subject: Re: leds: remove led_brightness
Date: Fri, 26 Jul 2024 10:31:44 +0700 [thread overview]
Message-ID: <ZqMYoHUECmrl2Rty@archie.me> (raw)
In-Reply-To: <CAM_RzfZWcD8F+6YutbDBo7hGhFm0nbG-Wc0H7bnu4XM03W6_Tg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3526 bytes --]
On Tue, Jul 23, 2024 at 10:03:52AM -0300, Guilherme Giácomo Simões wrote:
> Hi community, I hope this email finds you well
> I maked a change in kernel linux, for fulfill a TODO in
> drivers/leds/TODO that say:
> >* On/off LEDs should have max_brightness of 1
> >* Get rid of enum led_brightness
> >
> >It is really an integer, as maximum is configurable. Get rid of it, or
> >make it into typedef or something.
>
> Then I removed the led_brightness. And in the files that enum
> led_brightness was used I replace to "int" ... And in the file
> "include/linux/leds.h" I created constants like:
> +#define LED_OFF 0
> +#define LED_ON 1
> +#define LED_HALF 127
> +#define LED_FULL 255
>
> because in some files when has a compare like "brightness == LED_OFF"
> it will work yet.
>
> The includes/linux/leds.h diff:
> -/* This is obsolete/useless. We now support variable maximum brightness. */
> -enum led_brightness {
> - LED_OFF = 0,
> - LED_ON = 1,
> - LED_HALF = 127,
> - LED_FULL = 255,
> -};
> +// default values for leds brightness
> +#define LED_OFF 0
> +#define LED_ON 1
> +#define LED_HALF 127
> +#define LED_FULL 255
>
> enum led_default_state {
> LEDS_DEFSTATE_OFF = 0,
> @@ -127,15 +125,15 @@ struct led_classdev {
> * that can sleep while setting brightness.
> */
> void (*brightness_set)(struct led_classdev *led_cdev,
> - enum led_brightness brightness);
> + int brightness);
> /*
> * Set LED brightness level immediately - it can block the caller for
> * the time required for accessing a LED device register.
> */
> int (*brightness_set_blocking)(struct led_classdev *led_cdev,
> - enum led_brightness brightness);
> + int brightness);
> /* Get LED brightness level */
> - enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);
> + int (*brightness_get)(struct led_classdev *led_cdev);
>
> /*
> * Activate hardware accelerated blink, delays are in milliseconds
> @@ -486,7 +484,7 @@ int devm_led_trigger_register(struct device *dev,
> void led_trigger_register_simple(const char *name,
> struct led_trigger **trigger);
> void led_trigger_unregister_simple(struct led_trigger *trigger);
> -void led_trigger_event(struct led_trigger *trigger, enum
> led_brightness event);
> +void led_trigger_event(struct led_trigger *trigger, int event);
> void led_trigger_blink(struct led_trigger *trigger, unsigned long delay_on,
> unsigned long delay_off);
>
>
>
> How the kernel has a lot of files that use this led_brightness, the
> change is very very big.
> I have some questions:
>
> Does my change make sense?
>
> How can I split the change into several patches for sending to
> different email lists and still have the split change make sense in
> the email lists I'm going to send it to? can I reference the commit in
> which I delete the enum?
tl;dr: send the formal patch (see Documentation/process/submitting-patches.rst
for how to do that). Make sure to Cc: relevant maintainers (see MAINTAINERS
in the kernel source tree).
Bye!
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2024-07-26 3:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 13:03 Guilherme Giácomo Simões
2024-07-26 3:31 ` Bagas Sanjaya [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=ZqMYoHUECmrl2Rty@archie.me \
--to=bagasdotme@gmail.com \
--cc=hdegoede@redhat.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=trintaeoitogc@gmail.com \
/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
all inboxes | Powered by JetHome®