From 9675a1b4adea26b7ead7338408fcc5c61e85f3f2 Mon Sep 17 00:00:00 2001 From: xu xin Date: Sun, 29 Aug 2021 18:28:11 -0700 Subject: [PATCH] staging: r8118eu: remove useless parts of judgements from os_dep/ioctl_linux. 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 Signed-off-by: xu xin Thanks-to: Pavel Skripkin Link: https://lore.kernel.org/r/20210830012811.3384-1-xu.xin16@zte.com.cn Signed-off-by: Greg Kroah-Hartman --- 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 81d4255d1785c..61e4b2d76b3e9 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -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 { -- 2.30.2