Staging: brcm80211: fix usage of roundup in structures
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Oct 2010 16:55:53 +0000 (09:55 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Oct 2010 16:55:53 +0000 (09:55 -0700)
Now that the roundup macro is sane, it can't be used in structure
definitions, or the build breaks..  For now, create a "broken_roundup()"
macro to get everything building again, but in the end, fixing these
structures to use a proper size value is the correct thing to do.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/sys/wlc_event.c
drivers/staging/brcm80211/sys/wlc_key.h

index 7c17e5f..7e1bf0e 100644 (file)
@@ -47,7 +47,7 @@ struct wlc_eventq {
        bool workpending;
        struct wl_timer *timer;
        wlc_eventq_cb_t cb;
-       u8 event_inds_mask[roundup(WLC_E_LAST, NBBY) / NBBY];
+       u8 event_inds_mask[broken_roundup(WLC_E_LAST, NBBY) / NBBY];
 };
 
 /*
index d4f1b91..6678c69 100644 (file)
@@ -105,8 +105,9 @@ typedef struct wsec_key {
 
 } wsec_key_t;
 
+#define broken_roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
 typedef struct {
-       u8 vec[roundup(WSEC_MAX_KEYS, NBBY) / NBBY];    /* bitvec of wsec_key indexes */
+       u8 vec[broken_roundup(WSEC_MAX_KEYS, NBBY) / NBBY];     /* bitvec of wsec_key indexes */
 } wsec_key_vec_t;
 
 /* For use with wsec_key_t.flags */