diff mbox series

iwlegacy: 4965-mac: Simplify the calculation of variables

Message ID 1613632814-37897-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Superseded
Delegated to: Kalle Valo
Headers show
Series iwlegacy: 4965-mac: Simplify the calculation of variables | expand

Commit Message

Jiapeng Chong Feb. 18, 2021, 7:20 a.m. UTC
Fix the following coccicheck warnings:

./drivers/net/wireless/intel/iwlegacy/4965-mac.c:2596:54-56: WARNING !A
|| A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Stanislaw Gruszka Feb. 18, 2021, 8:13 a.m. UTC | #1
On Thu, Feb 18, 2021 at 03:20:14PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
> 
> ./drivers/net/wireless/intel/iwlegacy/4965-mac.c:2596:54-56: WARNING !A
> || A && B is equivalent to !A || B.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> index 28675a4..52db532 100644
> --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
> @@ -2593,8 +2593,7 @@ struct il_mod_params il4965_mod_params = {
>  	 */
>  	if (ret != IL_INVALID_STATION &&
>  	    (!(il->stations[ret].used & IL_STA_UCODE_ACTIVE) ||
> -	     ((il->stations[ret].used & IL_STA_UCODE_ACTIVE) &&
> -	      (il->stations[ret].used & IL_STA_UCODE_INPROGRESS)))) {
> +	      (il->stations[ret].used & IL_STA_UCODE_INPROGRESS))) {
>  		IL_ERR("Requested station info for sta %d before ready.\n",
>  		       ret);
>  		ret = IL_INVALID_STATION;

This patch was already applied to wireless-drivers-next.

Stanislaw
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 28675a4..52db532 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -2593,8 +2593,7 @@  struct il_mod_params il4965_mod_params = {
 	 */
 	if (ret != IL_INVALID_STATION &&
 	    (!(il->stations[ret].used & IL_STA_UCODE_ACTIVE) ||
-	     ((il->stations[ret].used & IL_STA_UCODE_ACTIVE) &&
-	      (il->stations[ret].used & IL_STA_UCODE_INPROGRESS)))) {
+	      (il->stations[ret].used & IL_STA_UCODE_INPROGRESS))) {
 		IL_ERR("Requested station info for sta %d before ready.\n",
 		       ret);
 		ret = IL_INVALID_STATION;