From: Arend van Spriel Date: Wed, 25 Sep 2013 11:05:44 +0000 (+0200) Subject: brcmfmac: fix sparse error 'bad constant expression' X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5af47fb394b54c4e8ff9035d1aa590e3c7b611dd;p=linux-beck.git 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 --- 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