diff options
author | Sawan Chandak <sawan.chandak@qlogic.com> | 2013-10-30 03:38:24 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-19 10:39:00 -0500 |
commit | 15904d763676065b3a36fa7b1d411d827d261c85 (patch) | |
tree | 0925c015cc5751eaee5ee1aed59eb29e0c0477f0 /drivers/scsi | |
parent | 9e5054ec6b6296075b757d0ea0d3e9e25784db20 (diff) |
[SCSI] qla2xxx: Use scnprintf() instead of snprintf() in the sysfs handlers.
Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index b8c15ed279aa..570c7fcc0c4d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -890,7 +890,7 @@ static ssize_t | |||
890 | qla2x00_drvr_version_show(struct device *dev, | 890 | qla2x00_drvr_version_show(struct device *dev, |
891 | struct device_attribute *attr, char *buf) | 891 | struct device_attribute *attr, char *buf) |
892 | { | 892 | { |
893 | return snprintf(buf, PAGE_SIZE, "%s\n", qla2x00_version_str); | 893 | return scnprintf(buf, PAGE_SIZE, "%s\n", qla2x00_version_str); |
894 | } | 894 | } |
895 | 895 | ||
896 | static ssize_t | 896 | static ssize_t |
@@ -901,7 +901,7 @@ qla2x00_fw_version_show(struct device *dev, | |||
901 | struct qla_hw_data *ha = vha->hw; | 901 | struct qla_hw_data *ha = vha->hw; |
902 | char fw_str[128]; | 902 | char fw_str[128]; |
903 | 903 | ||
904 | return snprintf(buf, PAGE_SIZE, "%s\n", | 904 | return scnprintf(buf, PAGE_SIZE, "%s\n", |
905 | ha->isp_ops->fw_version_str(vha, fw_str)); | 905 | ha->isp_ops->fw_version_str(vha, fw_str)); |
906 | } | 906 | } |
907 | 907 | ||
@@ -914,7 +914,7 @@ qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr, | |||
914 | uint32_t sn; | 914 | uint32_t sn; |
915 | 915 | ||
916 | if (IS_QLAFX00(vha->hw)) { | 916 | if (IS_QLAFX00(vha->hw)) { |
917 | return snprintf(buf, PAGE_SIZE, "%s\n", | 917 | return scnprintf(buf, PAGE_SIZE, "%s\n", |
918 | vha->hw->mr.serial_num); | 918 | vha->hw->mr.serial_num); |
919 | } else if (IS_FWI2_CAPABLE(ha)) { | 919 | } else if (IS_FWI2_CAPABLE(ha)) { |
920 | qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1); | 920 | qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1); |
@@ -922,7 +922,7 @@ qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr, | |||
922 | } | 922 | } |
923 | 923 | ||
924 | sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; | 924 | sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; |
925 | return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000, | 925 | return scnprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000, |
926 | sn % 100000); | 926 | sn % 100000); |
927 | } | 927 | } |
928 | 928 | ||
@@ -931,7 +931,7 @@ qla2x00_isp_name_show(struct device *dev, struct device_attribute *attr, | |||
931 | char *buf) | 931 | char *buf) |
932 | { | 932 | { |
933 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 933 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
934 | return snprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device); | 934 | return scnprintf(buf, PAGE_SIZE, "ISP%04X\n", vha->hw->pdev->device); |
935 | } | 935 | } |
936 | 936 | ||
937 | static ssize_t | 937 | static ssize_t |
@@ -942,10 +942,10 @@ qla2x00_isp_id_show(struct device *dev, struct device_attribute *attr, | |||
942 | struct qla_hw_data *ha = vha->hw; | 942 | struct qla_hw_data *ha = vha->hw; |
943 | 943 | ||
944 | if (IS_QLAFX00(vha->hw)) | 944 | if (IS_QLAFX00(vha->hw)) |
945 | return snprintf(buf, PAGE_SIZE, "%s\n", | 945 | return scnprintf(buf, PAGE_SIZE, "%s\n", |
946 | vha->hw->mr.hw_version); | 946 | vha->hw->mr.hw_version); |
947 | 947 | ||
948 | return snprintf(buf, PAGE_SIZE, "%04x %04x %04x %04x\n", | 948 | return scnprintf(buf, PAGE_SIZE, "%04x %04x %04x %04x\n", |
949 | ha->product_id[0], ha->product_id[1], ha->product_id[2], | 949 | ha->product_id[0], ha->product_id[1], ha->product_id[2], |
950 | ha->product_id[3]); | 950 | ha->product_id[3]); |
951 | } | 951 | } |
@@ -956,7 +956,7 @@ qla2x00_model_name_show(struct device *dev, struct device_attribute *attr, | |||
956 | { | 956 | { |
957 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 957 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
958 | 958 | ||
959 | return snprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number); | 959 | return scnprintf(buf, PAGE_SIZE, "%s\n", vha->hw->model_number); |
960 | } | 960 | } |
961 | 961 | ||
962 | static ssize_t | 962 | static ssize_t |
@@ -964,7 +964,7 @@ qla2x00_model_desc_show(struct device *dev, struct device_attribute *attr, | |||
964 | char *buf) | 964 | char *buf) |
965 | { | 965 | { |
966 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 966 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
967 | return snprintf(buf, PAGE_SIZE, "%s\n", | 967 | return scnprintf(buf, PAGE_SIZE, "%s\n", |
968 | vha->hw->model_desc ? vha->hw->model_desc : ""); | 968 | vha->hw->model_desc ? vha->hw->model_desc : ""); |
969 | } | 969 | } |
970 | 970 | ||
@@ -975,7 +975,7 @@ qla2x00_pci_info_show(struct device *dev, struct device_attribute *attr, | |||
975 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 975 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
976 | char pci_info[30]; | 976 | char pci_info[30]; |
977 | 977 | ||
978 | return snprintf(buf, PAGE_SIZE, "%s\n", | 978 | return scnprintf(buf, PAGE_SIZE, "%s\n", |
979 | vha->hw->isp_ops->pci_info_str(vha, pci_info)); | 979 | vha->hw->isp_ops->pci_info_str(vha, pci_info)); |
980 | } | 980 | } |
981 | 981 | ||
@@ -990,29 +990,29 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, | |||
990 | if (atomic_read(&vha->loop_state) == LOOP_DOWN || | 990 | if (atomic_read(&vha->loop_state) == LOOP_DOWN || |
991 | atomic_read(&vha->loop_state) == LOOP_DEAD || | 991 | atomic_read(&vha->loop_state) == LOOP_DEAD || |
992 | vha->device_flags & DFLG_NO_CABLE) | 992 | vha->device_flags & DFLG_NO_CABLE) |
993 | len = snprintf(buf, PAGE_SIZE, "Link Down\n"); | 993 | len = scnprintf(buf, PAGE_SIZE, "Link Down\n"); |
994 | else if (atomic_read(&vha->loop_state) != LOOP_READY || | 994 | else if (atomic_read(&vha->loop_state) != LOOP_READY || |
995 | qla2x00_reset_active(vha)) | 995 | qla2x00_reset_active(vha)) |
996 | len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n"); | 996 | len = scnprintf(buf, PAGE_SIZE, "Unknown Link State\n"); |
997 | else { | 997 | else { |
998 | len = snprintf(buf, PAGE_SIZE, "Link Up - "); | 998 | len = scnprintf(buf, PAGE_SIZE, "Link Up - "); |
999 | 999 | ||
1000 | switch (ha->current_topology) { | 1000 | switch (ha->current_topology) { |
1001 | case ISP_CFG_NL: | 1001 | case ISP_CFG_NL: |
1002 | len += snprintf(buf + len, PAGE_SIZE-len, "Loop\n"); | 1002 | len += scnprintf(buf + len, PAGE_SIZE-len, "Loop\n"); |
1003 | break; | 1003 | break; |
1004 | case ISP_CFG_FL: | 1004 | case ISP_CFG_FL: |
1005 | len += snprintf(buf + len, PAGE_SIZE-len, "FL_Port\n"); | 1005 | len += scnprintf(buf + len, PAGE_SIZE-len, "FL_Port\n"); |
1006 | break; | 1006 | break; |
1007 | case ISP_CFG_N: | 1007 | case ISP_CFG_N: |
1008 | len += snprintf(buf + len, PAGE_SIZE-len, | 1008 | len += scnprintf(buf + len, PAGE_SIZE-len, |
1009 | "N_Port to N_Port\n"); | 1009 | "N_Port to N_Port\n"); |
1010 | break; | 1010 | break; |
1011 | case ISP_CFG_F: | 1011 | case ISP_CFG_F: |
1012 | len += snprintf(buf + len, PAGE_SIZE-len, "F_Port\n"); | 1012 | len += scnprintf(buf + len, PAGE_SIZE-len, "F_Port\n"); |
1013 | break; | 1013 | break; |
1014 | default: | 1014 | default: |
1015 | len += snprintf(buf + len, PAGE_SIZE-len, "Loop\n"); | 1015 | len += scnprintf(buf + len, PAGE_SIZE-len, "Loop\n"); |
1016 | break; | 1016 | break; |
1017 | } | 1017 | } |
1018 | } | 1018 | } |
@@ -1028,10 +1028,10 @@ qla2x00_zio_show(struct device *dev, struct device_attribute *attr, | |||
1028 | 1028 | ||
1029 | switch (vha->hw->zio_mode) { | 1029 | switch (vha->hw->zio_mode) { |
1030 | case QLA_ZIO_MODE_6: | 1030 | case QLA_ZIO_MODE_6: |
1031 | len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n"); | 1031 | len += scnprintf(buf + len, PAGE_SIZE-len, "Mode 6\n"); |
1032 | break; | 1032 | break; |
1033 | case QLA_ZIO_DISABLED: | 1033 | case QLA_ZIO_DISABLED: |
1034 | len += snprintf(buf + len, PAGE_SIZE-len, "Disabled\n"); | 1034 | len += scnprintf(buf + len, PAGE_SIZE-len, "Disabled\n"); |
1035 | break; | 1035 | break; |
1036 | } | 1036 | } |
1037 | return len; | 1037 | return len; |
@@ -1071,7 +1071,7 @@ qla2x00_zio_timer_show(struct device *dev, struct device_attribute *attr, | |||
1071 | { | 1071 | { |
1072 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1072 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1073 | 1073 | ||
1074 | return snprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100); | 1074 | return scnprintf(buf, PAGE_SIZE, "%d us\n", vha->hw->zio_timer * 100); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | static ssize_t | 1077 | static ssize_t |
@@ -1101,9 +1101,9 @@ qla2x00_beacon_show(struct device *dev, struct device_attribute *attr, | |||
1101 | int len = 0; | 1101 | int len = 0; |
1102 | 1102 | ||
1103 | if (vha->hw->beacon_blink_led) | 1103 | if (vha->hw->beacon_blink_led) |
1104 | len += snprintf(buf + len, PAGE_SIZE-len, "Enabled\n"); | 1104 | len += scnprintf(buf + len, PAGE_SIZE-len, "Enabled\n"); |
1105 | else | 1105 | else |
1106 | len += snprintf(buf + len, PAGE_SIZE-len, "Disabled\n"); | 1106 | len += scnprintf(buf + len, PAGE_SIZE-len, "Disabled\n"); |
1107 | return len; | 1107 | return len; |
1108 | } | 1108 | } |
1109 | 1109 | ||
@@ -1145,7 +1145,7 @@ qla2x00_optrom_bios_version_show(struct device *dev, | |||
1145 | { | 1145 | { |
1146 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1146 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1147 | struct qla_hw_data *ha = vha->hw; | 1147 | struct qla_hw_data *ha = vha->hw; |
1148 | return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], | 1148 | return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1], |
1149 | ha->bios_revision[0]); | 1149 | ha->bios_revision[0]); |
1150 | } | 1150 | } |
1151 | 1151 | ||
@@ -1155,7 +1155,7 @@ qla2x00_optrom_efi_version_show(struct device *dev, | |||
1155 | { | 1155 | { |
1156 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1156 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1157 | struct qla_hw_data *ha = vha->hw; | 1157 | struct qla_hw_data *ha = vha->hw; |
1158 | return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], | 1158 | return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1], |
1159 | ha->efi_revision[0]); | 1159 | ha->efi_revision[0]); |
1160 | } | 1160 | } |
1161 | 1161 | ||
@@ -1165,7 +1165,7 @@ qla2x00_optrom_fcode_version_show(struct device *dev, | |||
1165 | { | 1165 | { |
1166 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1166 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1167 | struct qla_hw_data *ha = vha->hw; | 1167 | struct qla_hw_data *ha = vha->hw; |
1168 | return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], | 1168 | return scnprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1], |
1169 | ha->fcode_revision[0]); | 1169 | ha->fcode_revision[0]); |
1170 | } | 1170 | } |
1171 | 1171 | ||
@@ -1175,7 +1175,7 @@ qla2x00_optrom_fw_version_show(struct device *dev, | |||
1175 | { | 1175 | { |
1176 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1176 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1177 | struct qla_hw_data *ha = vha->hw; | 1177 | struct qla_hw_data *ha = vha->hw; |
1178 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n", | 1178 | return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n", |
1179 | ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], | 1179 | ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2], |
1180 | ha->fw_revision[3]); | 1180 | ha->fw_revision[3]); |
1181 | } | 1181 | } |
@@ -1188,9 +1188,9 @@ qla2x00_optrom_gold_fw_version_show(struct device *dev, | |||
1188 | struct qla_hw_data *ha = vha->hw; | 1188 | struct qla_hw_data *ha = vha->hw; |
1189 | 1189 | ||
1190 | if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha)) | 1190 | if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha)) |
1191 | return snprintf(buf, PAGE_SIZE, "\n"); | 1191 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1192 | 1192 | ||
1193 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%d)\n", | 1193 | return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%d)\n", |
1194 | ha->gold_fw_version[0], ha->gold_fw_version[1], | 1194 | ha->gold_fw_version[0], ha->gold_fw_version[1], |
1195 | ha->gold_fw_version[2], ha->gold_fw_version[3]); | 1195 | ha->gold_fw_version[2], ha->gold_fw_version[3]); |
1196 | } | 1196 | } |
@@ -1200,7 +1200,7 @@ qla2x00_total_isp_aborts_show(struct device *dev, | |||
1200 | struct device_attribute *attr, char *buf) | 1200 | struct device_attribute *attr, char *buf) |
1201 | { | 1201 | { |
1202 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1202 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1203 | return snprintf(buf, PAGE_SIZE, "%d\n", | 1203 | return scnprintf(buf, PAGE_SIZE, "%d\n", |
1204 | vha->qla_stats.total_isp_aborts); | 1204 | vha->qla_stats.total_isp_aborts); |
1205 | } | 1205 | } |
1206 | 1206 | ||
@@ -1214,16 +1214,16 @@ qla24xx_84xx_fw_version_show(struct device *dev, | |||
1214 | struct qla_hw_data *ha = vha->hw; | 1214 | struct qla_hw_data *ha = vha->hw; |
1215 | 1215 | ||
1216 | if (!IS_QLA84XX(ha)) | 1216 | if (!IS_QLA84XX(ha)) |
1217 | return snprintf(buf, PAGE_SIZE, "\n"); | 1217 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1218 | 1218 | ||
1219 | if (ha->cs84xx->op_fw_version == 0) | 1219 | if (ha->cs84xx->op_fw_version == 0) |
1220 | rval = qla84xx_verify_chip(vha, status); | 1220 | rval = qla84xx_verify_chip(vha, status); |
1221 | 1221 | ||
1222 | if ((rval == QLA_SUCCESS) && (status[0] == 0)) | 1222 | if ((rval == QLA_SUCCESS) && (status[0] == 0)) |
1223 | return snprintf(buf, PAGE_SIZE, "%u\n", | 1223 | return scnprintf(buf, PAGE_SIZE, "%u\n", |
1224 | (uint32_t)ha->cs84xx->op_fw_version); | 1224 | (uint32_t)ha->cs84xx->op_fw_version); |
1225 | 1225 | ||
1226 | return snprintf(buf, PAGE_SIZE, "\n"); | 1226 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | static ssize_t | 1229 | static ssize_t |
@@ -1234,9 +1234,9 @@ qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr, | |||
1234 | struct qla_hw_data *ha = vha->hw; | 1234 | struct qla_hw_data *ha = vha->hw; |
1235 | 1235 | ||
1236 | if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha)) | 1236 | if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha)) |
1237 | return snprintf(buf, PAGE_SIZE, "\n"); | 1237 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1238 | 1238 | ||
1239 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", | 1239 | return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", |
1240 | ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], | 1240 | ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], |
1241 | ha->mpi_capabilities); | 1241 | ha->mpi_capabilities); |
1242 | } | 1242 | } |
@@ -1249,9 +1249,9 @@ qla2x00_phy_version_show(struct device *dev, struct device_attribute *attr, | |||
1249 | struct qla_hw_data *ha = vha->hw; | 1249 | struct qla_hw_data *ha = vha->hw; |
1250 | 1250 | ||
1251 | if (!IS_QLA81XX(ha) && !IS_QLA8031(ha)) | 1251 | if (!IS_QLA81XX(ha) && !IS_QLA8031(ha)) |
1252 | return snprintf(buf, PAGE_SIZE, "\n"); | 1252 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1253 | 1253 | ||
1254 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n", | 1254 | return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n", |
1255 | ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); | 1255 | ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); |
1256 | } | 1256 | } |
1257 | 1257 | ||
@@ -1262,7 +1262,7 @@ qla2x00_flash_block_size_show(struct device *dev, | |||
1262 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1262 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1263 | struct qla_hw_data *ha = vha->hw; | 1263 | struct qla_hw_data *ha = vha->hw; |
1264 | 1264 | ||
1265 | return snprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); | 1265 | return scnprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); |
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | static ssize_t | 1268 | static ssize_t |
@@ -1272,9 +1272,9 @@ qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr, | |||
1272 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1272 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1273 | 1273 | ||
1274 | if (!IS_CNA_CAPABLE(vha->hw)) | 1274 | if (!IS_CNA_CAPABLE(vha->hw)) |
1275 | return snprintf(buf, PAGE_SIZE, "\n"); | 1275 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1276 | 1276 | ||
1277 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); | 1277 | return scnprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | static ssize_t | 1280 | static ssize_t |
@@ -1284,9 +1284,9 @@ qla2x00_vn_port_mac_address_show(struct device *dev, | |||
1284 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1284 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1285 | 1285 | ||
1286 | if (!IS_CNA_CAPABLE(vha->hw)) | 1286 | if (!IS_CNA_CAPABLE(vha->hw)) |
1287 | return snprintf(buf, PAGE_SIZE, "\n"); | 1287 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1288 | 1288 | ||
1289 | return snprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac); | 1289 | return scnprintf(buf, PAGE_SIZE, "%pMR\n", vha->fcoe_vn_port_mac); |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | static ssize_t | 1292 | static ssize_t |
@@ -1295,7 +1295,7 @@ qla2x00_fabric_param_show(struct device *dev, struct device_attribute *attr, | |||
1295 | { | 1295 | { |
1296 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1296 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1297 | 1297 | ||
1298 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); | 1298 | return scnprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | static ssize_t | 1301 | static ssize_t |
@@ -1316,10 +1316,10 @@ qla2x00_thermal_temp_show(struct device *dev, | |||
1316 | } | 1316 | } |
1317 | 1317 | ||
1318 | if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) | 1318 | if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS) |
1319 | return snprintf(buf, PAGE_SIZE, "%d\n", temp); | 1319 | return scnprintf(buf, PAGE_SIZE, "%d\n", temp); |
1320 | 1320 | ||
1321 | done: | 1321 | done: |
1322 | return snprintf(buf, PAGE_SIZE, "\n"); | 1322 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | static ssize_t | 1325 | static ssize_t |
@@ -1333,7 +1333,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | |||
1333 | 1333 | ||
1334 | if (IS_QLAFX00(vha->hw)) { | 1334 | if (IS_QLAFX00(vha->hw)) { |
1335 | pstate = qlafx00_fw_state_show(dev, attr, buf); | 1335 | pstate = qlafx00_fw_state_show(dev, attr, buf); |
1336 | return snprintf(buf, PAGE_SIZE, "0x%x\n", pstate); | 1336 | return scnprintf(buf, PAGE_SIZE, "0x%x\n", pstate); |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | if (qla2x00_reset_active(vha)) | 1339 | if (qla2x00_reset_active(vha)) |
@@ -1344,7 +1344,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | |||
1344 | if (rval != QLA_SUCCESS) | 1344 | if (rval != QLA_SUCCESS) |
1345 | memset(state, -1, sizeof(state)); | 1345 | memset(state, -1, sizeof(state)); |
1346 | 1346 | ||
1347 | return snprintf(buf, PAGE_SIZE, "0x%x 0x%x 0x%x 0x%x 0x%x\n", state[0], | 1347 | return scnprintf(buf, PAGE_SIZE, "0x%x 0x%x 0x%x 0x%x 0x%x\n", state[0], |
1348 | state[1], state[2], state[3], state[4]); | 1348 | state[1], state[2], state[3], state[4]); |
1349 | } | 1349 | } |
1350 | 1350 | ||
@@ -1355,9 +1355,9 @@ qla2x00_diag_requests_show(struct device *dev, | |||
1355 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1355 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1356 | 1356 | ||
1357 | if (!IS_BIDI_CAPABLE(vha->hw)) | 1357 | if (!IS_BIDI_CAPABLE(vha->hw)) |
1358 | return snprintf(buf, PAGE_SIZE, "\n"); | 1358 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1359 | 1359 | ||
1360 | return snprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); | 1360 | return scnprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | static ssize_t | 1363 | static ssize_t |
@@ -1367,9 +1367,9 @@ qla2x00_diag_megabytes_show(struct device *dev, | |||
1367 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1367 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1368 | 1368 | ||
1369 | if (!IS_BIDI_CAPABLE(vha->hw)) | 1369 | if (!IS_BIDI_CAPABLE(vha->hw)) |
1370 | return snprintf(buf, PAGE_SIZE, "\n"); | 1370 | return scnprintf(buf, PAGE_SIZE, "\n"); |
1371 | 1371 | ||
1372 | return snprintf(buf, PAGE_SIZE, "%llu\n", | 1372 | return scnprintf(buf, PAGE_SIZE, "%llu\n", |
1373 | vha->bidi_stats.transfer_bytes >> 20); | 1373 | vha->bidi_stats.transfer_bytes >> 20); |
1374 | } | 1374 | } |
1375 | 1375 | ||
@@ -1388,7 +1388,7 @@ qla2x00_fw_dump_size_show(struct device *dev, struct device_attribute *attr, | |||
1388 | else | 1388 | else |
1389 | size = ha->fw_dump_len; | 1389 | size = ha->fw_dump_len; |
1390 | 1390 | ||
1391 | return snprintf(buf, PAGE_SIZE, "%d\n", size); | 1391 | return scnprintf(buf, PAGE_SIZE, "%d\n", size); |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 1394 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |