]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 1 Sep 2020 07:08:34 +0000 (00:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:19:03 +0000 (09:19 +0100)
commit 6a953dc4dbd1c7057fb765a24f37a5e953c85fb0 upstream.

A new warning in clang points out when macro expansion might result in a
GNU C statement expression. There is an instance of this in the mwifiex
driver:

drivers/net/wireless/marvell/mwifiex/cmdevt.c:217:34: warning: '}' and
')' tokens terminating statement expression appear in different macro
expansion contexts [-Wcompound-token-split-by-macro]
        host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/marvell/mwifiex/fw.h:519:46: note: expanded from
macro 'HostCmd_SET_SEQ_NO_BSS_INFO'
        (((type) & 0x000f) << 12);                  }
                                                    ^

This does not appear to be a real issue. Removing the braces and
replacing them with parentheses will fix the warning and not change the
meaning of the code.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1146
Reported-by: Andy Lavr <andy.lavr@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200901070834.1015754-1-natechancellor@gmail.com
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/marvell/mwifiex/cmdevt.c
drivers/net/wireless/marvell/mwifiex/fw.h

index 60db2b969e20d7d8f5b7119ed6636ccda132cdfd..b7ced103b814309c38541c5c321af0ef3b06da33 100644 (file)
@@ -324,9 +324,9 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
 
        adapter->seq_num++;
        sleep_cfm_buf->seq_num =
-               cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
+               cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
                                        (adapter->seq_num, priv->bss_num,
-                                        priv->bss_type)));
+                                        priv->bss_type));
 
        mwifiex_dbg(adapter, CMD,
                    "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
index 8b9d0809daf62f8202b1ba187df7a3a94ea7c8d1..076ea1c4b921d8369aed1346f065fbbe96fee37f 100644 (file)
@@ -512,10 +512,10 @@ enum mwifiex_channel_flags {
 
 #define RF_ANTENNA_AUTO                 0xFFFF
 
-#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) {   \
-       (((seq) & 0x00ff) |                             \
-        (((num) & 0x000f) << 8)) |                     \
-       (((type) & 0x000f) << 12);                  }
+#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
+       ((((seq) & 0x00ff) |                        \
+        (((num) & 0x000f) << 8)) |                 \
+       (((type) & 0x000f) << 12))
 
 #define HostCmd_GET_SEQ_NO(seq)       \
        ((seq) & HostCmd_SEQ_NUM_MASK)