From 5af47fb394b54c4e8ff9035d1aa590e3c7b611dd Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Wed, 25 Sep 2013 13:05:44 +0200 Subject: [PATCH] brcmfmac: fix sparse error 'bad constant expression' The definition of BRCMF_EVENTING_MASK_LEN results in a sparse error message .../fweh.c:331:22: error: bad constant expression .../fweh.c:388:22: error: bad constant expression .../dhd_common.c:256:22: error: bad constant expression This is caused by the use of roundup() in BRCMF_EVENTING_MASK_LEN and it is used to allocate an array variable on the stack. Better use DIV_ROUND_UP() macro. Reviewed-by: Franky (Zhenhui) Lin Reviewed-by: Hante Meuleman Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h index 9ee5c5159da0..14bc24dc5bae 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h @@ -115,7 +115,7 @@ enum brcmf_fweh_event_code { }; #undef BRCMF_ENUM_DEF -#define BRCMF_EVENTING_MASK_LEN (roundup(BRCMF_E_LAST, 8)/8) +#define BRCMF_EVENTING_MASK_LEN DIV_ROUND_UP(BRCMF_E_LAST, 8) /* flags field values in struct brcmf_event_msg */ #define BRCMF_EVENT_MSG_LINK 0x01 -- 2.20.1