Re: [PATCH] scsi: ibmvfc: replace snprintf with sysfs_emit

From: Joe Perches
Date: Tue Feb 08 2022 - 21:46:45 EST


On Wed, 2022-02-09 at 08:43 +0800, davidcomponentone@xxxxxxxxx wrote:
> From: Yang Guang <yang.guang5@xxxxxxxxxx>
[]
> diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
[]
> @@ -3403,7 +3403,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct device *dev,
> struct Scsi_Host *shost = class_to_shost(dev);
> struct ibmvfc_host *vhost = shost_priv(shost);
>
> - return snprintf(buf, PAGE_SIZE, "%s\n",
> + return sysfs_emit(buf, "%s\n",
> vhost->login_buf->resp.partition_name);

Rewrap please

return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.partition_name);

> }
>
> @@ -3413,7 +3413,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device *dev,
> struct Scsi_Host *shost = class_to_shost(dev);
> struct ibmvfc_host *vhost = shost_priv(shost);
>
> - return snprintf(buf, PAGE_SIZE, "%s\n",
> + return sysfs_emit(buf, "%s\n",
> vhost->login_buf->resp.device_name);

etc...