diff mbox series

[net] leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded'

Message ID 20230821121453.30203-1-kabel@kernel.org (mailing list archive)
State Accepted
Commit 44f0fb8dfe263e27ac95d502a58586fe95fd5958
Delegated to: Netdev Maintainers
Headers show
Series [net] leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded' | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1328 this patch: 1328
netdev/cc_maintainers fail 2 blamed authors not CCed: lee@kernel.org kalesh-anakkur.purayil@broadcom.com; 5 maintainers not CCed: pavel@ucw.cz lee@kernel.org davem@davemloft.net kalesh-anakkur.purayil@broadcom.com linux-leds@vger.kernel.org
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 72 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Marek Behún Aug. 21, 2023, 12:14 p.m. UTC
Commit b655892ffd6d ("leds: trigger: netdev: expose hw_control status
via sysfs") exposed to sysfs the flag that tells whether the LED trigger
is offloaded to hardware, under the name "hw_control", since that is the
name under which this setting is called in the code.

Everywhere else in kernel when some work that is normally done in
software can be made to be done by hardware instead, we use the word
"offloading" to describe this, e.g. "LED blinking is offloaded to
hardware".

Normally renaming sysfs entries is a no-go because of backwards
compatibility. But since this patch was not yet released in a stable
kernel, I think it is still possible to rename it, if there is
consensus.

Fixes: b655892ffd6d ("leds: trigger: netdev: expose hw_control status via sysfs")
Signed-off-by: Marek Behún <kabel@kernel.org>
---
Andrew, Ansuel, Jakub: since I came late to this show, I will understand
if you do not agree with this.

Marek
---
 .../testing/sysfs-class-led-trigger-netdev    | 20 +++++++++----------
 drivers/leds/trigger/ledtrig-netdev.c         |  8 ++++----
 2 files changed, 14 insertions(+), 14 deletions(-)

Comments

Andrew Lunn Aug. 21, 2023, 1:20 p.m. UTC | #1
On Mon, Aug 21, 2023 at 02:14:53PM +0200, Marek Behún wrote:
> Commit b655892ffd6d ("leds: trigger: netdev: expose hw_control status
> via sysfs") exposed to sysfs the flag that tells whether the LED trigger
> is offloaded to hardware, under the name "hw_control", since that is the
> name under which this setting is called in the code.
> 
> Everywhere else in kernel when some work that is normally done in
> software can be made to be done by hardware instead, we use the word
> "offloading" to describe this, e.g. "LED blinking is offloaded to
> hardware".

I agree with your reasoning.

> Normally renaming sysfs entries is a no-go because of backwards
> compatibility. But since this patch was not yet released in a stable
> kernel, I think it is still possible to rename it, if there is
> consensus.

As you say, this is still in net and so -rc7, not a released
kernel. But we are very close to the release.
 
> Fixes: b655892ffd6d ("leds: trigger: netdev: expose hw_control status via sysfs")
> Signed-off-by: Marek Behún <kabel@kernel.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
patchwork-bot+netdevbpf@kernel.org Aug. 22, 2023, 6:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 21 Aug 2023 14:14:53 +0200 you wrote:
> Commit b655892ffd6d ("leds: trigger: netdev: expose hw_control status
> via sysfs") exposed to sysfs the flag that tells whether the LED trigger
> is offloaded to hardware, under the name "hw_control", since that is the
> name under which this setting is called in the code.
> 
> Everywhere else in kernel when some work that is normally done in
> software can be made to be done by hardware instead, we use the word
> "offloading" to describe this, e.g. "LED blinking is offloaded to
> hardware".
> 
> [...]

Here is the summary with links:
  - [net] leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded'
    https://git.kernel.org/netdev/net/c/44f0fb8dfe26

You are awesome, thank you!
diff mbox series

Patch

diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev
index 78b62a23b14a..f6d9d72ce77b 100644
--- a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev
+++ b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev
@@ -13,7 +13,7 @@  Description:
 		Specifies the duration of the LED blink in milliseconds.
 		Defaults to 50 ms.
 
-		With hw_control ON, the interval value MUST be set to the
+		When offloaded is true, the interval value MUST be set to the
 		default value and cannot be changed.
 		Trying to set any value in this specific mode will return
 		an EINVAL error.
@@ -44,8 +44,8 @@  Description:
 		If set to 1, the LED will blink for the milliseconds specified
 		in interval to signal transmission.
 
-		With hw_control ON, the blink interval is controlled by hardware
-		and won't reflect the value set in interval.
+		When offloaded is true, the blink interval is controlled by
+		hardware and won't reflect the value set in interval.
 
 What:		/sys/class/leds/<led>/rx
 Date:		Dec 2017
@@ -59,21 +59,21 @@  Description:
 		If set to 1, the LED will blink for the milliseconds specified
 		in interval to signal reception.
 
-		With hw_control ON, the blink interval is controlled by hardware
-		and won't reflect the value set in interval.
+		When offloaded is true, the blink interval is controlled by
+		hardware and won't reflect the value set in interval.
 
-What:		/sys/class/leds/<led>/hw_control
+What:		/sys/class/leds/<led>/offloaded
 Date:		Jun 2023
 KernelVersion:	6.5
 Contact:	linux-leds@vger.kernel.org
 Description:
-		Communicate whether the LED trigger modes are driven by hardware
-		or software fallback is used.
+		Communicate whether the LED trigger modes are offloaded to
+		hardware or whether software fallback is used.
 
 		If 0, the LED is using software fallback to blink.
 
-		If 1, the LED is using hardware control to blink and signal the
-		requested modes.
+		If 1, the LED blinking in requested mode is offloaded to
+		hardware.
 
 What:		/sys/class/leds/<led>/link_10
 Date:		Jun 2023
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index c9bc5a91ec83..03c58e50cc44 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -406,15 +406,15 @@  static ssize_t interval_store(struct device *dev,
 
 static DEVICE_ATTR_RW(interval);
 
-static ssize_t hw_control_show(struct device *dev,
-			       struct device_attribute *attr, char *buf)
+static ssize_t offloaded_show(struct device *dev,
+			      struct device_attribute *attr, char *buf)
 {
 	struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
 
 	return sprintf(buf, "%d\n", trigger_data->hw_control);
 }
 
-static DEVICE_ATTR_RO(hw_control);
+static DEVICE_ATTR_RO(offloaded);
 
 static struct attribute *netdev_trig_attrs[] = {
 	&dev_attr_device_name.attr,
@@ -427,7 +427,7 @@  static struct attribute *netdev_trig_attrs[] = {
 	&dev_attr_rx.attr,
 	&dev_attr_tx.attr,
 	&dev_attr_interval.attr,
-	&dev_attr_hw_control.attr,
+	&dev_attr_offloaded.attr,
 	NULL
 };
 ATTRIBUTE_GROUPS(netdev_trig);