staging: r8118eu: remove useless parts of judgements from os_dep/ioctl_linux.
authorxu xin <xu.xin16@zte.com.cn>
Mon, 30 Aug 2021 01:28:11 +0000 (18:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:43 +0000 (08:49 +0200)
Remove the check of the pointer 'pregpriv' that is impossible to be
NULL. There is no need to check if pregpriv is NULL.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Thanks-to: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210830012811.3384-1-xu.xin16@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/os_dep/ioctl_linux.c

index 81d4255d1785c6c1aeead854c9b7d4e69d315590..61e4b2d76b3e928d761311a6af4b2612efcd06a5 100644 (file)
@@ -4326,11 +4326,10 @@ static int rtw_dbg_port(struct net_device *dev,
                        struct registry_priv    *pregpriv = &padapter->registrypriv;
                        /*  0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g */
                        /* default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
-                       if (pregpriv &&
-                           (extra_arg == 0 ||
-                            extra_arg == 1 ||
-                            extra_arg == 2 ||
-                            extra_arg == 3)) {
+                       if (extra_arg == 0 ||
+                           extra_arg == 1 ||
+                           extra_arg == 2 ||
+                           extra_arg == 3) {
                                pregpriv->rx_stbc = extra_arg;
                                DBG_88E("set rx_stbc =%d\n", pregpriv->rx_stbc);
                        } else {
@@ -4342,7 +4341,7 @@ static int rtw_dbg_port(struct net_device *dev,
                {
                        struct registry_priv    *pregpriv = &padapter->registrypriv;
                        /*  0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) */
-                       if (pregpriv && extra_arg >= 0 && extra_arg < 3) {
+                       if (extra_arg >= 0 && extra_arg < 3) {
                                pregpriv->ampdu_enable = extra_arg;
                                DBG_88E("set ampdu_enable =%d\n", pregpriv->ampdu_enable);
                        } else {