From 2708f2957ce70037d3eab8a45523d4445404ecb4 Mon Sep 17 00:00:00 2001 From: Don Brace Date: Tue, 22 Dec 2015 10:36:36 -0600 Subject: [PATCH] hpsa: fix path_info_show Left off some changes from Rasmus Villemoes where he changed snprintf to scnprintf. Suggested-by: Rasmus Villemoes Reviewed-by: Justin Lindley Reviewed-by: Kevin Barnett Reviewed-by: Scott Teel Reviewed-by: Rasmus Villemoes Reviewed-by: Hannes Reinecke Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen --- drivers/scsi/hpsa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 6a8f95808ee0..9ad546e8e148 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -795,7 +795,7 @@ static ssize_t path_info_show(struct device *dev, if (hdev->external || hdev->devtype == TYPE_RAID || is_logical_device(hdev)) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "%s\n", active); continue; @@ -809,28 +809,28 @@ static ssize_t path_info_show(struct device *dev, if (phys_connector[1] < '0') phys_connector[1] = '0'; if (hdev->phys_connector[i] > 0) - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "PORT: %.2s ", phys_connector); if (hdev->devtype == TYPE_DISK && hdev->expose_device) { if (box == 0 || box == 0xFF) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BAY: %hhu %s\n", bay, active); } else { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BOX: %hhu BAY: %hhu %s\n", box, bay, active); } } else if (box != 0 && box != 0xFF) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BOX: %hhu %s\n", box, active); } else - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "%s\n", active); }