Skip to content

Commit c76bce9

Browse files
nathanchancegregkh
authored andcommitted
mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO
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: 5e6e3a9 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Link: ClangBuiltLinux/linux#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>
1 parent 8358739 commit c76bce9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/net/wireless/marvell/mwifiex/cmdevt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
323323

324324
adapter->seq_num++;
325325
sleep_cfm_buf->seq_num =
326-
cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
326+
cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
327327
(adapter->seq_num, priv->bss_num,
328-
priv->bss_type)));
328+
priv->bss_type));
329329

330330
mwifiex_dbg(adapter, CMD,
331331
"cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",

drivers/net/wireless/marvell/mwifiex/fw.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,10 @@ enum mwifiex_channel_flags {
498498

499499
#define RF_ANTENNA_AUTO 0xFFFF
500500

501-
#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
502-
(((seq) & 0x00ff) | \
503-
(((num) & 0x000f) << 8)) | \
504-
(((type) & 0x000f) << 12); }
501+
#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
502+
((((seq) & 0x00ff) | \
503+
(((num) & 0x000f) << 8)) | \
504+
(((type) & 0x000f) << 12))
505505

506506
#define HostCmd_GET_SEQ_NO(seq) \
507507
((seq) & HostCmd_SEQ_NUM_MASK)

0 commit comments

Comments
 (0)