diff options
author | amit salecha <amit.salecha@qlogic.com> | 2011-02-22 22:21:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-23 17:23:33 -0500 |
commit | 9ce13ca8fc43f6fbb7ee55a283d44ff2f4ba1c06 (patch) | |
tree | cef01789947efef5431ee1fa79b18be9b7906abb /drivers/net/qlcnic | |
parent | 39fc0ce5710c53bad14aaba1a789eec810c556f9 (diff) |
qlcnic: fix checks for auto_fw_reset
o Remove checks of 1 for auto_fw_reset module parameter.
auto_fw_reset is of type int and can have value > 1.
o Remove unnecessary #define for 1
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 44e316fd67b8..fa7f794de29c 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -867,7 +867,6 @@ struct qlcnic_nic_intr_coalesce { | |||
867 | #define LINKEVENT_LINKSPEED_MBPS 0 | 867 | #define LINKEVENT_LINKSPEED_MBPS 0 |
868 | #define LINKEVENT_LINKSPEED_ENCODED 1 | 868 | #define LINKEVENT_LINKSPEED_ENCODED 1 |
869 | 869 | ||
870 | #define AUTO_FW_RESET_ENABLED 0x01 | ||
871 | /* firmware response header: | 870 | /* firmware response header: |
872 | * 63:58 - message type | 871 | * 63:58 - message type |
873 | * 57:56 - owner | 872 | * 57:56 - owner |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 37c04b4fade3..4994b947fd21 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -42,7 +42,7 @@ static int use_msi_x = 1; | |||
42 | module_param(use_msi_x, int, 0444); | 42 | module_param(use_msi_x, int, 0444); |
43 | MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled"); | 43 | MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled"); |
44 | 44 | ||
45 | static int auto_fw_reset = AUTO_FW_RESET_ENABLED; | 45 | static int auto_fw_reset = 1; |
46 | module_param(auto_fw_reset, int, 0644); | 46 | module_param(auto_fw_reset, int, 0644); |
47 | MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled"); | 47 | MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled"); |
48 | 48 | ||
@@ -2959,8 +2959,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter) | |||
2959 | if (adapter->need_fw_reset) | 2959 | if (adapter->need_fw_reset) |
2960 | goto detach; | 2960 | goto detach; |
2961 | 2961 | ||
2962 | if (adapter->reset_context && | 2962 | if (adapter->reset_context && auto_fw_reset) { |
2963 | auto_fw_reset == AUTO_FW_RESET_ENABLED) { | ||
2964 | qlcnic_reset_hw_context(adapter); | 2963 | qlcnic_reset_hw_context(adapter); |
2965 | adapter->netdev->trans_start = jiffies; | 2964 | adapter->netdev->trans_start = jiffies; |
2966 | } | 2965 | } |
@@ -2973,7 +2972,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter) | |||
2973 | 2972 | ||
2974 | qlcnic_dev_request_reset(adapter); | 2973 | qlcnic_dev_request_reset(adapter); |
2975 | 2974 | ||
2976 | if ((auto_fw_reset == AUTO_FW_RESET_ENABLED)) | 2975 | if (auto_fw_reset) |
2977 | clear_bit(__QLCNIC_FW_ATTACHED, &adapter->state); | 2976 | clear_bit(__QLCNIC_FW_ATTACHED, &adapter->state); |
2978 | 2977 | ||
2979 | dev_info(&netdev->dev, "firmware hang detected\n"); | 2978 | dev_info(&netdev->dev, "firmware hang detected\n"); |
@@ -2982,7 +2981,7 @@ detach: | |||
2982 | adapter->dev_state = (state == QLCNIC_DEV_NEED_QUISCENT) ? state : | 2981 | adapter->dev_state = (state == QLCNIC_DEV_NEED_QUISCENT) ? state : |
2983 | QLCNIC_DEV_NEED_RESET; | 2982 | QLCNIC_DEV_NEED_RESET; |
2984 | 2983 | ||
2985 | if ((auto_fw_reset == AUTO_FW_RESET_ENABLED) && | 2984 | if (auto_fw_reset && |
2986 | !test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) { | 2985 | !test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) { |
2987 | 2986 | ||
2988 | qlcnic_schedule_work(adapter, qlcnic_detach_work, 0); | 2987 | qlcnic_schedule_work(adapter, qlcnic_detach_work, 0); |