netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vxge: Fix rts_mac_en config parameter check
@ 2017-09-24 18:50 Christos Gkekas
  2017-09-24 19:10 ` Christos Gkekas
  0 siblings, 1 reply; 2+ messages in thread
From: Christos Gkekas @ 2017-09-24 18:50 UTC (permalink / raw)
  To: Jon Mason, netdev, linux-kernel; +Cc: 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.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
 drivers/net/ethernet/neterion/vxge/vxge-config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index 6223930..c694f97 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -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++) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vxge: Fix rts_mac_en config parameter check
  2017-09-24 18:50 [PATCH] vxge: Fix rts_mac_en config parameter check Christos Gkekas
@ 2017-09-24 19:10 ` Christos Gkekas
  0 siblings, 0 replies; 2+ messages in thread
From: Christos Gkekas @ 2017-09-24 19:10 UTC (permalink / raw)
  To: Jon Mason, netdev, linux-kernel

On 24/09/17 19:50:21 +0100, Christos Gkekas wrote:
> 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.
> 
> Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
> ---
>  drivers/net/ethernet/neterion/vxge/vxge-config.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
> index 6223930..c694f97 100644
> --- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
> +++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
> @@ -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++) {
> -- 
> 2.7.4
>

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

Thanks,
Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-24 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-24 18:50 [PATCH] vxge: Fix rts_mac_en config parameter check Christos Gkekas
2017-09-24 19:10 ` Christos Gkekas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).