[PATCH 2/2] net-sysfs: switch xps_queue_show() to sysfs_emit()

Yury Norov posted 2 patches 1 month ago
There is a newer version of this series
[PATCH 2/2] net-sysfs: switch xps_queue_show() to sysfs_emit()
Posted by Yury Norov 1 month ago
Switch the function to use the proper sysfs_emit("%pb").

Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 net/core/net-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 07624b682b08..a260f8b4d5c6 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1754,7 +1754,7 @@ static ssize_t xps_queue_show(struct net_device *dev, unsigned int index,
 out_no_maps:
 	rcu_read_unlock();
 
-	len = bitmap_print_to_pagebuf(false, buf, mask, nr_ids);
+	len = sysfs_emit(buf, "%*pb\n", nr_ids, mask);
 	bitmap_free(mask);
 
 	return len < PAGE_SIZE ? len : -EINVAL;
-- 
2.43.0

Re: [PATCH 2/2] net-sysfs: switch xps_queue_show() to sysfs_emit()
Posted by Thomas Weißschuh 1 month ago
On 2026-03-03 13:55:06-0500, Yury Norov wrote:
> Switch the function to use the proper sysfs_emit("%pb").
> 
> Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
> Signed-off-by: Yury Norov <ynorov@nvidia.com>

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>

> ---
>  net/core/net-sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index 07624b682b08..a260f8b4d5c6 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -1754,7 +1754,7 @@ static ssize_t xps_queue_show(struct net_device *dev, unsigned int index,
>  out_no_maps:
>  	rcu_read_unlock();
>  
> -	len = bitmap_print_to_pagebuf(false, buf, mask, nr_ids);
> +	len = sysfs_emit(buf, "%*pb\n", nr_ids, mask);
>  	bitmap_free(mask);
>  
>  	return len < PAGE_SIZE ? len : -EINVAL;