diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-03-17 16:14:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-17 16:14:22 -0400 |
commit | bd257ed9f1d129b4e881f513a406b435c8852565 (patch) | |
tree | 35c3ec7633555a190e95d4924cf01610536a0770 /drivers/net/netxen | |
parent | 2ffb4558194037133121e260022baa0d21590473 (diff) |
netxen: fix firmware download warnings
Fix following warnings, by using integer firmware types.
drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_load_firmware':
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 6 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 2544129768ff..78e6228937fe 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -693,9 +693,9 @@ typedef enum { | |||
693 | #define NX_BIOS_VERSION_OFFSET (NETXEN_USER_START+0x83c) | 693 | #define NX_BIOS_VERSION_OFFSET (NETXEN_USER_START+0x83c) |
694 | #define NX_FW_MAGIC_OFFSET (NETXEN_BRDCFG_START+0x128) | 694 | #define NX_FW_MAGIC_OFFSET (NETXEN_BRDCFG_START+0x128) |
695 | #define NX_FW_MIN_SIZE (0x3fffff) | 695 | #define NX_FW_MIN_SIZE (0x3fffff) |
696 | #define NX_P2_MN_ROMIMAGE "nxromimg.bin" | 696 | #define NX_P2_MN_ROMIMAGE 0 |
697 | #define NX_P3_CT_ROMIMAGE "nx3fwct.bin" | 697 | #define NX_P3_CT_ROMIMAGE 1 |
698 | #define NX_P3_MN_ROMIMAGE "nx3fwmn.bin" | 698 | #define NX_P3_MN_ROMIMAGE 2 |
699 | 699 | ||
700 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ | 700 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ |
701 | 701 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index c89c791e281c..b24cfddd6193 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -1130,21 +1130,21 @@ netxen_validate_firmware(struct netxen_adapter *adapter, const char *fwname, | |||
1130 | return 0; | 1130 | return 0; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | static char *fw_name[] = { "nxromimg.bin", "nx3fwct.bin", "nx3fwmn.bin" }; | ||
1134 | |||
1133 | int netxen_load_firmware(struct netxen_adapter *adapter) | 1135 | int netxen_load_firmware(struct netxen_adapter *adapter) |
1134 | { | 1136 | { |
1135 | u32 capability, flashed_ver; | 1137 | u32 capability, flashed_ver; |
1136 | const struct firmware *fw; | 1138 | const struct firmware *fw; |
1137 | char *fw_name = NULL; | 1139 | int fw_type; |
1138 | struct pci_dev *pdev = adapter->pdev; | 1140 | struct pci_dev *pdev = adapter->pdev; |
1139 | int rc = 0; | 1141 | int rc = 0; |
1140 | 1142 | ||
1141 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 1143 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
1142 | fw_name = NX_P2_MN_ROMIMAGE; | 1144 | fw_type = NX_P2_MN_ROMIMAGE; |
1143 | goto request_fw; | 1145 | goto request_fw; |
1144 | } | 1146 | } else { |
1145 | 1147 | fw_type = NX_P3_CT_ROMIMAGE; | |
1146 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | ||
1147 | fw_name = NX_P3_CT_ROMIMAGE; | ||
1148 | goto request_fw; | 1148 | goto request_fw; |
1149 | } | 1149 | } |
1150 | 1150 | ||
@@ -1157,15 +1157,15 @@ request_mn: | |||
1157 | adapter->hw_read_wx(adapter, | 1157 | adapter->hw_read_wx(adapter, |
1158 | NX_PEG_TUNE_CAPABILITY, &capability, 4); | 1158 | NX_PEG_TUNE_CAPABILITY, &capability, 4); |
1159 | if (capability & NX_PEG_TUNE_MN_PRESENT) { | 1159 | if (capability & NX_PEG_TUNE_MN_PRESENT) { |
1160 | fw_name = NX_P3_MN_ROMIMAGE; | 1160 | fw_type = NX_P3_MN_ROMIMAGE; |
1161 | goto request_fw; | 1161 | goto request_fw; |
1162 | } | 1162 | } |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | request_fw: | 1165 | request_fw: |
1166 | rc = request_firmware(&fw, fw_name, &pdev->dev); | 1166 | rc = request_firmware(&fw, fw_name[fw_type], &pdev->dev); |
1167 | if (rc != 0) { | 1167 | if (rc != 0) { |
1168 | if (fw_name == NX_P3_CT_ROMIMAGE) { | 1168 | if (fw_type == NX_P3_CT_ROMIMAGE) { |
1169 | msleep(1); | 1169 | msleep(1); |
1170 | goto request_mn; | 1170 | goto request_mn; |
1171 | } | 1171 | } |
@@ -1174,11 +1174,11 @@ request_fw: | |||
1174 | goto load_fw; | 1174 | goto load_fw; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | rc = netxen_validate_firmware(adapter, fw_name, fw); | 1177 | rc = netxen_validate_firmware(adapter, fw_name[fw_type], fw); |
1178 | if (rc != 0) { | 1178 | if (rc != 0) { |
1179 | release_firmware(fw); | 1179 | release_firmware(fw); |
1180 | 1180 | ||
1181 | if (fw_name == NX_P3_CT_ROMIMAGE) { | 1181 | if (fw_type == NX_P3_CT_ROMIMAGE) { |
1182 | msleep(1); | 1182 | msleep(1); |
1183 | goto request_mn; | 1183 | goto request_mn; |
1184 | } | 1184 | } |
@@ -1187,7 +1187,7 @@ request_fw: | |||
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | load_fw: | 1189 | load_fw: |
1190 | rc = netxen_do_load_firmware(adapter, fw_name, fw); | 1190 | rc = netxen_do_load_firmware(adapter, fw_name[fw_type], fw); |
1191 | 1191 | ||
1192 | if (fw) | 1192 | if (fw) |
1193 | release_firmware(fw); | 1193 | release_firmware(fw); |