All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: megaraid: convert sysfs snprintf to sysfs_emit
@ 2022-08-31 14:03 Xuezhi Zhang
  2022-09-01  0:24 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Xuezhi Zhang @ 2022-08-31 14:03 UTC (permalink / raw)
  To: kashyap.desai, sumit.saxena, shivasharan.srikanteshwara, jejb,
	martin.petersen
  Cc: megaraidlinux.pdl, linux-scsi, linux-kernel, zhangxuezhi3, Xuezhi Zhang

From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>

Fix up all sysfs show entries to use sysfs_emit

Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
---
 drivers/scsi/megaraid/megaraid_mbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 157c3bdb50be..132de68c14e9 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -3979,7 +3979,7 @@ megaraid_mbox_app_hndl_show(struct device *dev, struct device_attribute *attr, c
 
 	app_hndl = mraid_mm_adapter_app_handle(adapter->unique_id);
 
-	return snprintf(buf, 8, "%u\n", app_hndl);
+	return sysfs_emit(buf, "%u\n", app_hndl);
 }
 
 
@@ -4048,7 +4048,7 @@ megaraid_mbox_ld_show(struct device *dev, struct device_attribute *attr, char *b
 		}
 	}
 
-	return snprintf(buf, 36, "%d %d %d %d\n", scsi_id, logical_drv,
+	return sysfs_emit(buf, "%d %d %d %d\n", scsi_id, logical_drv,
 			ldid_map, app_hndl);
 }
 
-- 
2.25.1


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

* Re: [PATCH] scsi: megaraid: convert sysfs snprintf to sysfs_emit
  2022-08-31 14:03 [PATCH] scsi: megaraid: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
@ 2022-09-01  0:24 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2022-09-01  0:24 UTC (permalink / raw)
  To: Xuezhi Zhang, kashyap.desai, sumit.saxena,
	shivasharan.srikanteshwara, jejb, martin.petersen
  Cc: megaraidlinux.pdl, linux-scsi, linux-kernel, Xuezhi Zhang

On 8/31/22 23:03, Xuezhi Zhang wrote:
> From: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
> 
> Fix up all sysfs show entries to use sysfs_emit
> 
> Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>

Looks OK.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

> ---
>  drivers/scsi/megaraid/megaraid_mbox.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
> index 157c3bdb50be..132de68c14e9 100644
> --- a/drivers/scsi/megaraid/megaraid_mbox.c
> +++ b/drivers/scsi/megaraid/megaraid_mbox.c
> @@ -3979,7 +3979,7 @@ megaraid_mbox_app_hndl_show(struct device *dev, struct device_attribute *attr, c
>  
>  	app_hndl = mraid_mm_adapter_app_handle(adapter->unique_id);
>  
> -	return snprintf(buf, 8, "%u\n", app_hndl);
> +	return sysfs_emit(buf, "%u\n", app_hndl);
>  }
>  
>  
> @@ -4048,7 +4048,7 @@ megaraid_mbox_ld_show(struct device *dev, struct device_attribute *attr, char *b
>  		}
>  	}
>  
> -	return snprintf(buf, 36, "%d %d %d %d\n", scsi_id, logical_drv,
> +	return sysfs_emit(buf, "%d %d %d %d\n", scsi_id, logical_drv,
>  			ldid_map, app_hndl);
>  }
>  

-- 
Damien Le Moal
Western Digital Research


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

end of thread, other threads:[~2022-09-01  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 14:03 [PATCH] scsi: megaraid: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
2022-09-01  0:24 ` Damien Le Moal

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.