All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit
@ 2024-03-15  5:52 Li Zhijian
  2024-03-15  5:52   ` Li Zhijian
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Li Zhijian @ 2024-03-15  5:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Li Zhijian, Kalle Valo, Jeff Johnson, linux-wireless, ath11k, ath10k

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Kalle Valo <kvalo@kernel.org>
CC: Jeff Johnson <jjohnson@kernel.org>
CC: linux-wireless@vger.kernel.org
CC: ath11k@lists.infradead.org
CC: ath10k@lists.infradead.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V2: subject updated

This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
Split them per subsystem so that the maintainer can review it easily
[1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
---
 drivers/net/wireless/ath/ath10k/thermal.c | 2 +-
 drivers/net/wireless/ath/ath11k/thermal.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index 31c8d7fbb095..8b15ec07b107 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -100,7 +100,7 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
 	spin_unlock_bh(&ar->data_lock);
 
 	/* display in millidegree celsius */
-	ret = snprintf(buf, PAGE_SIZE, "%d\n", temperature * 1000);
+	ret = sysfs_emit(buf, "%d\n", temperature * 1000);
 out:
 	mutex_unlock(&ar->conf_mutex);
 	return ret;
diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c
index 41e7499f075f..18d6eab5cce3 100644
--- a/drivers/net/wireless/ath/ath11k/thermal.c
+++ b/drivers/net/wireless/ath/ath11k/thermal.c
@@ -101,7 +101,7 @@ static ssize_t ath11k_thermal_show_temp(struct device *dev,
 	spin_unlock_bh(&ar->data_lock);
 
 	/* display in millidegree Celsius */
-	ret = snprintf(buf, PAGE_SIZE, "%d\n", temperature * 1000);
+	ret = sysfs_emit(buf, "%d\n", temperature * 1000);
 out:
 	mutex_unlock(&ar->conf_mutex);
 	return ret;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] wifi: b43: Convert sprintf/snprintf to sysfs_emit
  2024-03-15  5:52 [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit Li Zhijian
@ 2024-03-15  5:52   ` Li Zhijian
  2024-03-15  5:52 ` [PATCH v2 3/3] wifi: ti: " Li Zhijian
  2024-03-25 10:49 ` [PATCH v2 1/3] wifi: ath: " Kalle Valo
  2 siblings, 0 replies; 10+ messages in thread
From: Li Zhijian @ 2024-03-15  5:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Li Zhijian, Larry Finger, Kalle Valo, linux-wireless, b43-dev

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Larry Finger <Larry.Finger@lwfinger.net>
CC: Kalle Valo <kvalo@kernel.org>
CC: linux-wireless@vger.kernel.org
CC: b43-dev@lists.infradead.org
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V2:
  subject updated and wrap line style

This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
Split them per subsystem so that the maintainer can review it easily
[1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
---
 drivers/net/wireless/broadcom/b43/sysfs.c       | 13 ++++---------
 drivers/net/wireless/broadcom/b43legacy/sysfs.c | 16 ++++++----------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/sysfs.c b/drivers/net/wireless/broadcom/b43/sysfs.c
index 0679d132968f..261b2b746a9c 100644
--- a/drivers/net/wireless/broadcom/b43/sysfs.c
+++ b/drivers/net/wireless/broadcom/b43/sysfs.c
@@ -53,19 +53,14 @@ static ssize_t b43_attr_interfmode_show(struct device *dev,
 
 	switch (wldev->phy.g->interfmode) {
 	case B43_INTERFMODE_NONE:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "0 (No Interference Mitigation)\n");
+		count = sysfs_emit(buf, "0 (No Interference Mitigation)\n");
 		break;
 	case B43_INTERFMODE_NONWLAN:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "1 (Non-WLAN Interference Mitigation)\n");
+		count = sysfs_emit(buf,
+				   "1 (Non-WLAN Interference Mitigation)\n");
 		break;
 	case B43_INTERFMODE_MANUALWLAN:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "2 (WLAN Interference Mitigation)\n");
+		count = sysfs_emit(buf, "2 (WLAN Interference Mitigation)\n");
 		break;
 	default:
 		B43_WARN_ON(1);
diff --git a/drivers/net/wireless/broadcom/b43legacy/sysfs.c b/drivers/net/wireless/broadcom/b43legacy/sysfs.c
index eec087ca30e6..d988fe541bf7 100644
--- a/drivers/net/wireless/broadcom/b43legacy/sysfs.c
+++ b/drivers/net/wireless/broadcom/b43legacy/sysfs.c
@@ -75,16 +75,14 @@ static ssize_t b43legacy_attr_interfmode_show(struct device *dev,
 
 	switch (wldev->phy.interfmode) {
 	case B43legacy_INTERFMODE_NONE:
-		count = snprintf(buf, PAGE_SIZE, "0 (No Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf, "0 (No Interference Mitigation)\n");
 		break;
 	case B43legacy_INTERFMODE_NONWLAN:
-		count = snprintf(buf, PAGE_SIZE, "1 (Non-WLAN Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf,
+				   "1 (Non-WLAN Interference Mitigation)\n");
 		break;
 	case B43legacy_INTERFMODE_MANUALWLAN:
-		count = snprintf(buf, PAGE_SIZE, "2 (WLAN Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf, "2 (WLAN Interference Mitigation)\n");
 		break;
 	default:
 		B43legacy_WARN_ON(1);
@@ -155,11 +153,9 @@ static ssize_t b43legacy_attr_preamble_show(struct device *dev,
 	mutex_lock(&wldev->wl->mutex);
 
 	if (wldev->short_preamble)
-		count = snprintf(buf, PAGE_SIZE, "1 (Short Preamble"
-				 " enabled)\n");
+		count = sysfs_emit(buf, "1 (Short Preamble enabled)\n");
 	else
-		count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble"
-				 " disabled)\n");
+		count = sysfs_emit(buf, "0 (Short Preamble disabled)\n");
 
 	mutex_unlock(&wldev->wl->mutex);
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] wifi: b43: Convert sprintf/snprintf to sysfs_emit
@ 2024-03-15  5:52   ` Li Zhijian
  0 siblings, 0 replies; 10+ messages in thread
From: Li Zhijian @ 2024-03-15  5:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Li Zhijian, Larry Finger, Kalle Valo, linux-wireless, b43-dev

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Larry Finger <Larry.Finger@lwfinger.net>
CC: Kalle Valo <kvalo@kernel.org>
CC: linux-wireless@vger.kernel.org
CC: b43-dev@lists.infradead.org
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V2:
  subject updated and wrap line style

This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
Split them per subsystem so that the maintainer can review it easily
[1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
---
 drivers/net/wireless/broadcom/b43/sysfs.c       | 13 ++++---------
 drivers/net/wireless/broadcom/b43legacy/sysfs.c | 16 ++++++----------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/sysfs.c b/drivers/net/wireless/broadcom/b43/sysfs.c
index 0679d132968f..261b2b746a9c 100644
--- a/drivers/net/wireless/broadcom/b43/sysfs.c
+++ b/drivers/net/wireless/broadcom/b43/sysfs.c
@@ -53,19 +53,14 @@ static ssize_t b43_attr_interfmode_show(struct device *dev,
 
 	switch (wldev->phy.g->interfmode) {
 	case B43_INTERFMODE_NONE:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "0 (No Interference Mitigation)\n");
+		count = sysfs_emit(buf, "0 (No Interference Mitigation)\n");
 		break;
 	case B43_INTERFMODE_NONWLAN:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "1 (Non-WLAN Interference Mitigation)\n");
+		count = sysfs_emit(buf,
+				   "1 (Non-WLAN Interference Mitigation)\n");
 		break;
 	case B43_INTERFMODE_MANUALWLAN:
-		count =
-		    snprintf(buf, PAGE_SIZE,
-			     "2 (WLAN Interference Mitigation)\n");
+		count = sysfs_emit(buf, "2 (WLAN Interference Mitigation)\n");
 		break;
 	default:
 		B43_WARN_ON(1);
diff --git a/drivers/net/wireless/broadcom/b43legacy/sysfs.c b/drivers/net/wireless/broadcom/b43legacy/sysfs.c
index eec087ca30e6..d988fe541bf7 100644
--- a/drivers/net/wireless/broadcom/b43legacy/sysfs.c
+++ b/drivers/net/wireless/broadcom/b43legacy/sysfs.c
@@ -75,16 +75,14 @@ static ssize_t b43legacy_attr_interfmode_show(struct device *dev,
 
 	switch (wldev->phy.interfmode) {
 	case B43legacy_INTERFMODE_NONE:
-		count = snprintf(buf, PAGE_SIZE, "0 (No Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf, "0 (No Interference Mitigation)\n");
 		break;
 	case B43legacy_INTERFMODE_NONWLAN:
-		count = snprintf(buf, PAGE_SIZE, "1 (Non-WLAN Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf,
+				   "1 (Non-WLAN Interference Mitigation)\n");
 		break;
 	case B43legacy_INTERFMODE_MANUALWLAN:
-		count = snprintf(buf, PAGE_SIZE, "2 (WLAN Interference"
-				 " Mitigation)\n");
+		count = sysfs_emit(buf, "2 (WLAN Interference Mitigation)\n");
 		break;
 	default:
 		B43legacy_WARN_ON(1);
@@ -155,11 +153,9 @@ static ssize_t b43legacy_attr_preamble_show(struct device *dev,
 	mutex_lock(&wldev->wl->mutex);
 
 	if (wldev->short_preamble)
-		count = snprintf(buf, PAGE_SIZE, "1 (Short Preamble"
-				 " enabled)\n");
+		count = sysfs_emit(buf, "1 (Short Preamble enabled)\n");
 	else
-		count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble"
-				 " disabled)\n");
+		count = sysfs_emit(buf, "0 (Short Preamble disabled)\n");
 
 	mutex_unlock(&wldev->wl->mutex);
 
-- 
2.29.2


_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/3] wifi: ti: Convert sprintf/snprintf to sysfs_emit
  2024-03-15  5:52 [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit Li Zhijian
  2024-03-15  5:52   ` Li Zhijian
@ 2024-03-15  5:52 ` Li Zhijian
  2024-03-18  9:16   ` Kalle Valo
  2024-03-25 10:49 ` [PATCH v2 1/3] wifi: ath: " Kalle Valo
  2 siblings, 1 reply; 10+ messages in thread
From: Li Zhijian @ 2024-03-15  5:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Li Zhijian, Kalle Valo, linux-wireless

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() will be converted as weel if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Kalle Valo <kvalo@kernel.org>
CC: linux-wireless@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V2: subject updated

This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
Split them per subsystem so that the maintainer can review it easily
[1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 drivers/net/wireless/ti/wlcore/sysfs.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sysfs.c b/drivers/net/wireless/ti/wlcore/sysfs.c
index f0c7e09b314d..c07acfcbbd9c 100644
--- a/drivers/net/wireless/ti/wlcore/sysfs.c
+++ b/drivers/net/wireless/ti/wlcore/sysfs.c
@@ -19,11 +19,8 @@ static ssize_t bt_coex_state_show(struct device *dev,
 	struct wl1271 *wl = dev_get_drvdata(dev);
 	ssize_t len;
 
-	len = PAGE_SIZE;
-
 	mutex_lock(&wl->mutex);
-	len = snprintf(buf, len, "%d\n\n0 - off\n1 - on\n",
-		       wl->sg_enabled);
+	len = sysfs_emit(buf, "%d\n\n0 - off\n1 - on\n", wl->sg_enabled);
 	mutex_unlock(&wl->mutex);
 
 	return len;
@@ -78,13 +75,11 @@ static ssize_t hw_pg_ver_show(struct device *dev,
 	struct wl1271 *wl = dev_get_drvdata(dev);
 	ssize_t len;
 
-	len = PAGE_SIZE;
-
 	mutex_lock(&wl->mutex);
 	if (wl->hw_pg_ver >= 0)
-		len = snprintf(buf, len, "%d\n", wl->hw_pg_ver);
+		len = sysfs_emit(buf, "%d\n", wl->hw_pg_ver);
 	else
-		len = snprintf(buf, len, "n/a\n");
+		len = sysfs_emit(buf, "n/a\n");
 	mutex_unlock(&wl->mutex);
 
 	return len;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] wifi: ti: Convert sprintf/snprintf to sysfs_emit
  2024-03-15  5:52 ` [PATCH v2 3/3] wifi: ti: " Li Zhijian
@ 2024-03-18  9:16   ` Kalle Valo
  2024-03-18  9:42     ` Zhijian Li (Fujitsu)
  0 siblings, 1 reply; 10+ messages in thread
From: Kalle Valo @ 2024-03-18  9:16 UTC (permalink / raw)
  To: Li Zhijian; +Cc: linux-kernel, linux-wireless

Li Zhijian <lizhijian@fujitsu.com> writes:

> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
>
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
>
> sprintf() will be converted as weel if they have.
>
> Generally, this patch is generated by
> make coccicheck M=<path/to/file> MODE=patch \
> COCCI=scripts/coccinelle/api/device_attr_show.cocci
>
> No functional change intended
>
> CC: Kalle Valo <kvalo@kernel.org>
> CC: linux-wireless@vger.kernel.org
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> V2: subject updated
>
> This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
> Split them per subsystem so that the maintainer can review it easily
> [1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Please resubmit the whole patchset as v3.

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#resubmit_the_whole_patchset


-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] wifi: ti: Convert sprintf/snprintf to sysfs_emit
  2024-03-18  9:16   ` Kalle Valo
@ 2024-03-18  9:42     ` Zhijian Li (Fujitsu)
  2024-03-18 10:05       ` Kalle Valo
  0 siblings, 1 reply; 10+ messages in thread
From: Zhijian Li (Fujitsu) @ 2024-03-18  9:42 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-kernel, linux-wireless

Kalle,


On 18/03/2024 17:16, Kalle Valo wrote:
> Li Zhijian <lizhijian@fujitsu.com> writes:
> 
>> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
>> or sysfs_emit_at() when formatting the value to be returned to user space.
>>
>> coccinelle complains that there are still a couple of functions that use
>> snprintf(). Convert them to sysfs_emit().
>>
>> sprintf() will be converted as weel if they have.
>>
>> Generally, this patch is generated by
>> make coccicheck M=<path/to/file> MODE=patch \
>> COCCI=scripts/coccinelle/api/device_attr_show.cocci
>>
>> No functional change intended
>>
>> CC: Kalle Valo <kvalo@kernel.org>
>> CC: linux-wireless@vger.kernel.org
>> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
>> ---
>> V2: subject updated
>>
>> This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
>> Split them per subsystem so that the maintainer can review it easily
>> [1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
>> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> 
> Please resubmit the whole patchset as v3.


May I know what's wrong with this V2? or what update should I do in V3


> Even if just one patch has changed in a patch series resubmit the whole patchset (and remember to increase the version number), do not just resubmit that one changed patch. The reason is that it's difficult to apply patches in correct order when some of them are submitted separately.

I thought I had followed this rule. Feel free to let me know if I missed something


Thanks
Zhijian

> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#resubmit_the_whole_patchset
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] wifi: ti: Convert sprintf/snprintf to sysfs_emit
  2024-03-18  9:42     ` Zhijian Li (Fujitsu)
@ 2024-03-18 10:05       ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2024-03-18 10:05 UTC (permalink / raw)
  To: Zhijian Li (Fujitsu); +Cc: linux-kernel, linux-wireless

"Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com> writes:

> Kalle,
>
>
> On 18/03/2024 17:16, Kalle Valo wrote:
>> Li Zhijian <lizhijian@fujitsu.com> writes:
>> 
>>> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
>>> or sysfs_emit_at() when formatting the value to be returned to user space.
>>>
>>> coccinelle complains that there are still a couple of functions that use
>>> snprintf(). Convert them to sysfs_emit().
>>>
>>> sprintf() will be converted as weel if they have.
>>>
>>> Generally, this patch is generated by
>>> make coccicheck M=<path/to/file> MODE=patch \
>>> COCCI=scripts/coccinelle/api/device_attr_show.cocci
>>>
>>> No functional change intended
>>>
>>> CC: Kalle Valo <kvalo@kernel.org>
>>> CC: linux-wireless@vger.kernel.org
>>> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
>>> ---
>>> V2: subject updated
>>>
>>> This is a part of the work "Fix coccicheck device_attr_show warnings"[1]
>>> Split them per subsystem so that the maintainer can review it easily
>>> [1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fujitsu.com/
>>> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
>> 
>> Please resubmit the whole patchset as v3.
>
>
> May I know what's wrong with this V2? or what update should I do in V3

Sorry, my mistake. I didn't see patch 1 and I assumed it was not sent.
But I checked patchwork now and I do see all three patches:

https://patchwork.kernel.org/project/linux-wireless/list/?series=835497

So no need to resend anything because of this.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/3] wifi: b43: Convert sprintf/snprintf to sysfs_emit
  2024-03-15  5:52   ` Li Zhijian
@ 2024-03-21 15:08     ` Kalle Valo
  -1 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2024-03-21 15:08 UTC (permalink / raw)
  To: Li Zhijian
  Cc: linux-kernel, Li Zhijian, Larry Finger, linux-wireless, b43-dev

Li Zhijian <lizhijian@fujitsu.com> wrote:

> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
> 
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
> 
> sprintf() will be converted as weel if they have.
> 
> Generally, this patch is generated by
> make coccicheck M=<path/to/file> MODE=patch \
> COCCI=scripts/coccinelle/api/device_attr_show.cocci
> 
> No functional change intended
> 
> CC: Larry Finger <Larry.Finger@lwfinger.net>
> CC: Kalle Valo <kvalo@kernel.org>
> CC: linux-wireless@vger.kernel.org
> CC: b43-dev@lists.infradead.org
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

2 patches applied to wireless-next.git, thanks.

6db5c15c8b6a wifi: b43: Convert sprintf/snprintf to sysfs_emit
48be5774b21b wifi: ti: Convert sprintf/snprintf to sysfs_emit

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240315055211.1347548-2-lizhijian@fujitsu.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/3] wifi: b43: Convert sprintf/snprintf to sysfs_emit
@ 2024-03-21 15:08     ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2024-03-21 15:08 UTC (permalink / raw)
  To: Li Zhijian
  Cc: linux-kernel, Li Zhijian, Larry Finger, linux-wireless, b43-dev

Li Zhijian <lizhijian@fujitsu.com> wrote:

> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
> 
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
> 
> sprintf() will be converted as weel if they have.
> 
> Generally, this patch is generated by
> make coccicheck M=<path/to/file> MODE=patch \
> COCCI=scripts/coccinelle/api/device_attr_show.cocci
> 
> No functional change intended
> 
> CC: Larry Finger <Larry.Finger@lwfinger.net>
> CC: Kalle Valo <kvalo@kernel.org>
> CC: linux-wireless@vger.kernel.org
> CC: b43-dev@lists.infradead.org
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

2 patches applied to wireless-next.git, thanks.

6db5c15c8b6a wifi: b43: Convert sprintf/snprintf to sysfs_emit
48be5774b21b wifi: ti: Convert sprintf/snprintf to sysfs_emit

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240315055211.1347548-2-lizhijian@fujitsu.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit
  2024-03-15  5:52 [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit Li Zhijian
  2024-03-15  5:52   ` Li Zhijian
  2024-03-15  5:52 ` [PATCH v2 3/3] wifi: ti: " Li Zhijian
@ 2024-03-25 10:49 ` Kalle Valo
  2 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2024-03-25 10:49 UTC (permalink / raw)
  To: Li Zhijian
  Cc: linux-kernel, Li Zhijian, Jeff Johnson, linux-wireless, ath11k, ath10k

Li Zhijian <lizhijian@fujitsu.com> wrote:

> Per filesystems/sysfs.rst, show() should only use sysfs_emit()
> or sysfs_emit_at() when formatting the value to be returned to user space.
> 
> coccinelle complains that there are still a couple of functions that use
> snprintf(). Convert them to sysfs_emit().
> 
> sprintf() will be converted as weel if they have.
> 
> Generally, this patch is generated by
> make coccicheck M=<path/to/file> MODE=patch \
> COCCI=scripts/coccinelle/api/device_attr_show.cocci
> 
> No functional change intended
> 
> CC: Kalle Valo <kvalo@kernel.org>
> CC: Jeff Johnson <jjohnson@kernel.org>
> CC: linux-wireless@vger.kernel.org
> CC: ath11k@lists.infradead.org
> CC: ath10k@lists.infradead.org
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

fa1a4f15bdca wifi: ath: Convert sprintf/snprintf to sysfs_emit

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240315055211.1347548-1-lizhijian@fujitsu.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-25 10:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-15  5:52 [PATCH v2 1/3] wifi: ath: Convert sprintf/snprintf to sysfs_emit Li Zhijian
2024-03-15  5:52 ` [PATCH v2 2/3] wifi: b43: " Li Zhijian
2024-03-15  5:52   ` Li Zhijian
2024-03-21 15:08   ` Kalle Valo
2024-03-21 15:08     ` Kalle Valo
2024-03-15  5:52 ` [PATCH v2 3/3] wifi: ti: " Li Zhijian
2024-03-18  9:16   ` Kalle Valo
2024-03-18  9:42     ` Zhijian Li (Fujitsu)
2024-03-18 10:05       ` Kalle Valo
2024-03-25 10:49 ` [PATCH v2 1/3] wifi: ath: " Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.