]> git.karo-electronics.de Git - linux-beck.git/commitdiff
brcmfmac: fix sparse error 'bad constant expression'
authorArend van Spriel <arend@broadcom.com>
Wed, 25 Sep 2013 11:05:44 +0000 (13:05 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 3 Oct 2013 20:24:25 +0000 (16:24 -0400)
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 <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/fweh.h

index 9ee5c5159da0ebebda1412962fcd850c5fea59e9..14bc24dc5baeb1f8272b4da0660d893c4bfc9b48 100644 (file)
@@ -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