[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210830012811.3384-1-xu.xin16@zte.com.cn>
Date: Sun, 29 Aug 2021 18:28:11 -0700
From: cgel.zte@...il.com
To: phil@...lpotter.co.uk
Cc: Larry.Finger@...inger.net, straube.linux@...il.com,
martin@...ser.cx, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org, xu xin <xu.xin16@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] staging: r8118eu: remove useless parts of judgements from os_dep/ioctl_linux.
From: xu xin <xu.xin16@....com.cn>
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@....com.cn>
Signed-off-by: xu xin <xu.xin16@....com.cn>
Thansk-to: Pavel Skripkin <paskripkin@...il.com>
---
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index ab4a9200f079..d2f7a77357f1 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -4340,11 +4340,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 {
@@ -4356,7 +4355,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 {
--
2.25.1
Powered by blists - more mailing lists