Skip to contentSkip to conversation

scsi: scsi_transport_sas: Fix the following coccicheck warning:

PATCH New KaiLong Wang 1 participant 1 message Dec 27, 2022 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: scsi_transport_sas: Fix the following coccicheck warning:

drivers/scsi/scsi_transport_sas.c:525:9-17: WARNING: use scnprintf or sprintf drivers/scsi/scsi_transport_sas.c:572:8-16: WARNING: use scnprintf or sprintf drivers/scsi/scsi_transport_sas.c:1180:9-17: WARNING: use scnprintf or sprintf

---
 drivers/scsi/scsi_transport_sas.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/scsi_transport_sas.c +3 -3
index 74b99f2b0b74..5504067adcf1 100644
@@ -522,7 +522,7 @@ show_sas_device_type(struct device *dev,
 	struct sas_phy *phy = transport_class_to_phy(dev);
 
 	if (!phy->identify.device_type)
-		return snprintf(buf, 20, "none\n");
+		return sysfs_emit(buf, "none\n");
 	return get_sas_device_type_names(phy->identify.device_type, buf);
 }
 static DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL);
@@ -569,7 +569,7 @@ show_sas_phy_enable(struct device *dev, struct device_attribute *attr,
 {
 	struct sas_phy *phy = transport_class_to_phy(dev);
 
-	return snprintf(buf, 20, "%d\n", phy->enabled);
+	return sysfs_emit(buf, "%d\n", phy->enabled);
 }
 
 static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
@@ -1177,7 +1177,7 @@ show_sas_rphy_device_type(struct device *dev,
 	struct sas_rphy *rphy = transport_class_to_rphy(dev);
 
 	if (!rphy->identify.device_type)
-		return snprintf(buf, 20, "none\n");
+		return sysfs_emit(buf, "none\n");
 	return get_sas_device_type_names(
 			rphy->identify.device_type, buf);
 }
Signature · 1 line
2.36.1