staging: rtl8723bs: Fix Coverity warning in rtw_dbg_port()
authorHans de Goede <hdegoede@redhat.com>
Tue, 21 May 2019 19:54:12 +0000 (21:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 12:32:41 +0000 (14:32 +0200)
Fix the following Coverity warning:

File: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c in function
rtw_dbg_port():

CID 18480: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
dead_error_condition: The condition (extra_arg & 7U) > 7U cannot be true.

        if ((extra_arg & 0x07) > 0x07)
                padapter->driver_ampdu_spacing = 0xFF;
        else
                padapter->driver_ampdu_spacing = extra_arg;

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c

index 74a7328..bfbbcf0 100644 (file)
@@ -3096,7 +3096,7 @@ static int rtw_dbg_port(struct net_device *dev,
 
                                                        DBG_871X("enable driver ctrl ampdu density = %d\n", extra_arg);
 
-                                                       if ((extra_arg & 0x07) > 0x07)
+                                                       if (extra_arg > 0x07)
                                                                padapter->driver_ampdu_spacing = 0xFF;
                                                        else
                                                                padapter->driver_ampdu_spacing = extra_arg;