Skip to contentSkip to conversation

vxge: Fix rts_mac_en config parameter check

PATCH In review Christos Gkekas 1 participant 2 messages Sep 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxge: Fix rts_mac_en config parameter check

Current checks return VXGE_HW_BADCFG_RTS_MAC_EN if rts_mac_en is not equal to DISABLE *and* not equal to ENABLE. This condition is always false and the check should change to *or* to properly verify the value.

---
 drivers/net/ethernet/neterion/vxge/vxge-config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/neterion/vxge/vxge-config.c +2 -2
index 6223930..c694f97 100644
@@ -1286,8 +1286,8 @@ __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config)
 	    (new_config->intr_mode != VXGE_HW_INTR_MODE_DEF))
 		return VXGE_HW_BADCFG_INTR_MODE;
 
-	if ((new_config->rts_mac_en != VXGE_HW_RTS_MAC_DISABLE) &&
-	    (new_config->rts_mac_en != VXGE_HW_RTS_MAC_ENABLE))
+	if (new_config->rts_mac_en != VXGE_HW_RTS_MAC_DISABLE ||
+	    new_config->rts_mac_en != VXGE_HW_RTS_MAC_ENABLE)
 		return VXGE_HW_BADCFG_RTS_MAC_EN;
 
 	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 27 lines · Christos Gkekas

Current checks return VXGE_HW_BADCFG_RTS_MAC_EN if rts_mac_en is not equal to DISABLE *and* not equal to ENABLE. This condition is always false and the check should change to *or* to properly verify the value.

---
 drivers/net/ethernet/neterion/vxge/vxge-config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/neterion/vxge/vxge-config.c +2 -2
index 6223930..c694f97 100644
@@ -1286,8 +1286,8 @@ __vxge_hw_device_config_check(struct vxge_hw_device_config *new_config)
 	    (new_config->intr_mode != VXGE_HW_INTR_MODE_DEF))
 		return VXGE_HW_BADCFG_INTR_MODE;
 
-	if ((new_config->rts_mac_en != VXGE_HW_RTS_MAC_DISABLE) &&
-	    (new_config->rts_mac_en != VXGE_HW_RTS_MAC_ENABLE))
+	if (new_config->rts_mac_en != VXGE_HW_RTS_MAC_DISABLE ||
+	    new_config->rts_mac_en != VXGE_HW_RTS_MAC_ENABLE)
 		return VXGE_HW_BADCFG_RTS_MAC_EN;
 
 	for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
Signature · 1 line
2.7.4

Please ignore the patch above, it was sent in error.

Thanks,
Chris