Commit a4256252 authored by Kevin Barnett's avatar Kevin Barnett Committed by Martin K. Petersen

scsi: smartpqi: Convert snprintf() to scnprintf()

The entire Linux kernel has been slowly migrating from snprintf() to
scnprintf(), so we are doing our part. This article explains the rationale
for this change:

   https: //lwn.net/Articles/69419/

Link: https://lore.kernel.org/r/161549383357.25025.12363435617789964291.stgit@brunhildaReviewed-by: default avatarScott Benesh <scott.benesh@microchip.com>
Reviewed-by: default avatarMike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: default avatarScott Teel <scott.teel@microchip.com>
Reviewed-by: default avatarMartin Wilck <mwilck@suse.com>
Signed-off-by: default avatarKevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3268b8a8
......@@ -1749,7 +1749,7 @@ static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info,
ssize_t count;
char buffer[PQI_DEV_INFO_BUFFER_LENGTH];
count = snprintf(buffer, PQI_DEV_INFO_BUFFER_LENGTH,
count = scnprintf(buffer, PQI_DEV_INFO_BUFFER_LENGTH,
"%d:%d:", ctrl_info->scsi_host->host_no, device->bus);
if (device->target_lun_valid)
......@@ -6382,14 +6382,13 @@ static ssize_t pqi_firmware_version_show(struct device *dev,
shost = class_to_shost(dev);
ctrl_info = shost_to_hba(shost);
return snprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->firmware_version);
return scnprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->firmware_version);
}
static ssize_t pqi_driver_version_show(struct device *dev,
struct device_attribute *attr, char *buffer)
{
return snprintf(buffer, PAGE_SIZE, "%s\n",
DRIVER_VERSION BUILD_TIMESTAMP);
return scnprintf(buffer, PAGE_SIZE, "%s\n", DRIVER_VERSION BUILD_TIMESTAMP);
}
static ssize_t pqi_serial_number_show(struct device *dev,
......@@ -6401,7 +6400,7 @@ static ssize_t pqi_serial_number_show(struct device *dev,
shost = class_to_shost(dev);
ctrl_info = shost_to_hba(shost);
return snprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->serial_number);
return scnprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->serial_number);
}
static ssize_t pqi_model_show(struct device *dev,
......@@ -6413,7 +6412,7 @@ static ssize_t pqi_model_show(struct device *dev,
shost = class_to_shost(dev);
ctrl_info = shost_to_hba(shost);
return snprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->model);
return scnprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->model);
}
static ssize_t pqi_vendor_show(struct device *dev,
......@@ -6425,7 +6424,7 @@ static ssize_t pqi_vendor_show(struct device *dev,
shost = class_to_shost(dev);
ctrl_info = shost_to_hba(shost);
return snprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->vendor);
return scnprintf(buffer, PAGE_SIZE, "%s\n", ctrl_info->vendor);
}
static ssize_t pqi_host_rescan_store(struct device *dev,
......@@ -6619,7 +6618,7 @@ static ssize_t pqi_unique_id_show(struct device *dev,
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
return snprintf(buffer, PAGE_SIZE,
return scnprintf(buffer, PAGE_SIZE,
"%02X%02X%02X%02X%02X%02X%02X%02X"
"%02X%02X%02X%02X%02X%02X%02X%02X\n",
unique_id[0], unique_id[1], unique_id[2], unique_id[3],
......@@ -6652,7 +6651,7 @@ static ssize_t pqi_lunid_show(struct device *dev,
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
return snprintf(buffer, PAGE_SIZE, "0x%8phN\n", lunid);
return scnprintf(buffer, PAGE_SIZE, "0x%8phN\n", lunid);
}
#define MAX_PATHS 8
......@@ -6764,7 +6763,7 @@ static ssize_t pqi_sas_address_show(struct device *dev,
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
return snprintf(buffer, PAGE_SIZE, "0x%016llx\n", sas_address);
return scnprintf(buffer, PAGE_SIZE, "0x%016llx\n", sas_address);
}
static ssize_t pqi_ssd_smart_path_enabled_show(struct device *dev,
......@@ -6822,7 +6821,7 @@ static ssize_t pqi_raid_level_show(struct device *dev,
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
return snprintf(buffer, PAGE_SIZE, "%s\n", raid_level);
return scnprintf(buffer, PAGE_SIZE, "%s\n", raid_level);
}
static ssize_t pqi_raid_bypass_cnt_show(struct device *dev,
......@@ -6849,7 +6848,7 @@ static ssize_t pqi_raid_bypass_cnt_show(struct device *dev,
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
return snprintf(buffer, PAGE_SIZE, "0x%x\n", raid_bypass_cnt);
return scnprintf(buffer, PAGE_SIZE, "0x%x\n", raid_bypass_cnt);
}
static DEVICE_ATTR(lunid, 0444, pqi_lunid_show, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment