aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Brace <don.brace@pmcs.com>2015-12-22 11:36:36 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-06 15:10:35 -0500
commit2708f2957ce70037d3eab8a45523d4445404ecb4 (patch)
tree8b79caff400f7b6ae98fa1601d6e3e1dd06259d8
parenta8036dfba94d2ddf70cc9d7e9c627b179f957299 (diff)
hpsa: fix path_info_show
Left off some changes from Rasmus Villemoes where he changed snprintf to scnprintf. Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/hpsa.c12
1 files 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,
795 if (hdev->external || 795 if (hdev->external ||
796 hdev->devtype == TYPE_RAID || 796 hdev->devtype == TYPE_RAID ||
797 is_logical_device(hdev)) { 797 is_logical_device(hdev)) {
798 output_len += snprintf(buf + output_len, 798 output_len += scnprintf(buf + output_len,
799 PAGE_SIZE - output_len, 799 PAGE_SIZE - output_len,
800 "%s\n", active); 800 "%s\n", active);
801 continue; 801 continue;
@@ -809,28 +809,28 @@ static ssize_t path_info_show(struct device *dev,
809 if (phys_connector[1] < '0') 809 if (phys_connector[1] < '0')
810 phys_connector[1] = '0'; 810 phys_connector[1] = '0';
811 if (hdev->phys_connector[i] > 0) 811 if (hdev->phys_connector[i] > 0)
812 output_len += snprintf(buf + output_len, 812 output_len += scnprintf(buf + output_len,
813 PAGE_SIZE - output_len, 813 PAGE_SIZE - output_len,
814 "PORT: %.2s ", 814 "PORT: %.2s ",
815 phys_connector); 815 phys_connector);
816 if (hdev->devtype == TYPE_DISK && hdev->expose_device) { 816 if (hdev->devtype == TYPE_DISK && hdev->expose_device) {
817 if (box == 0 || box == 0xFF) { 817 if (box == 0 || box == 0xFF) {
818 output_len += snprintf(buf + output_len, 818 output_len += scnprintf(buf + output_len,
819 PAGE_SIZE - output_len, 819 PAGE_SIZE - output_len,
820 "BAY: %hhu %s\n", 820 "BAY: %hhu %s\n",
821 bay, active); 821 bay, active);
822 } else { 822 } else {
823 output_len += snprintf(buf + output_len, 823 output_len += scnprintf(buf + output_len,
824 PAGE_SIZE - output_len, 824 PAGE_SIZE - output_len,
825 "BOX: %hhu BAY: %hhu %s\n", 825 "BOX: %hhu BAY: %hhu %s\n",
826 box, bay, active); 826 box, bay, active);
827 } 827 }
828 } else if (box != 0 && box != 0xFF) { 828 } else if (box != 0 && box != 0xFF) {
829 output_len += snprintf(buf + output_len, 829 output_len += scnprintf(buf + output_len,
830 PAGE_SIZE - output_len, "BOX: %hhu %s\n", 830 PAGE_SIZE - output_len, "BOX: %hhu %s\n",
831 box, active); 831 box, active);
832 } else 832 } else
833 output_len += snprintf(buf + output_len, 833 output_len += scnprintf(buf + output_len,
834 PAGE_SIZE - output_len, "%s\n", active); 834 PAGE_SIZE - output_len, "%s\n", active);
835 } 835 }
836 836