b43legacy: fix B43legacy_WARN_ON macro
Fix the B43legacy_WARN_ON macro so that it will evaluate expressions. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
a297170dae
commit
4688be308f
|
@ -330,15 +330,7 @@ enum {
|
||||||
# undef assert
|
# undef assert
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_B43LEGACY_DEBUG
|
#ifdef CONFIG_B43LEGACY_DEBUG
|
||||||
# define B43legacy_WARN_ON(expr) \
|
# define B43legacy_WARN_ON(x) WARN_ON(x)
|
||||||
do { \
|
|
||||||
if (unlikely((expr))) { \
|
|
||||||
printk(KERN_INFO PFX "Test (%s) failed at:" \
|
|
||||||
" %s:%d:%s()\n", \
|
|
||||||
#expr, __FILE__, \
|
|
||||||
__LINE__, __FUNCTION__); \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
# define B43legacy_BUG_ON(expr) \
|
# define B43legacy_BUG_ON(expr) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely((expr))) { \
|
if (unlikely((expr))) { \
|
||||||
|
@ -349,7 +341,9 @@ enum {
|
||||||
} while (0)
|
} while (0)
|
||||||
# define B43legacy_DEBUG 1
|
# define B43legacy_DEBUG 1
|
||||||
#else
|
#else
|
||||||
# define B43legacy_WARN_ON(x) do { /* nothing */ } while (0)
|
/* This will evaluate the argument even if debugging is disabled. */
|
||||||
|
static inline bool __b43legacy_warn_on_dummy(bool x) { return x; }
|
||||||
|
# define B43_WARN_ON(x) __b43legacy_warn_on_dummy(unlikely(!!(x)))
|
||||||
# define B43legacy_BUG_ON(x) do { /* nothing */ } while (0)
|
# define B43legacy_BUG_ON(x) do { /* nothing */ } while (0)
|
||||||
# define B43legacy_DEBUG 0
|
# define B43legacy_DEBUG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1068,10 +1068,8 @@ static const u8 *b43legacy_generate_probe_resp(struct b43legacy_wldev *dev,
|
||||||
B43legacy_WARN_ON(ie_start != offsetof(struct ieee80211_mgmt,
|
B43legacy_WARN_ON(ie_start != offsetof(struct ieee80211_mgmt,
|
||||||
u.beacon.variable));
|
u.beacon.variable));
|
||||||
|
|
||||||
if (src_size < ie_start) {
|
if (B43legacy_WARN_ON(src_size < ie_start))
|
||||||
B43legacy_WARN_ON(1);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
dest_data = kmalloc(src_size, GFP_ATOMIC);
|
dest_data = kmalloc(src_size, GFP_ATOMIC);
|
||||||
if (unlikely(!dest_data))
|
if (unlikely(!dest_data))
|
||||||
|
|
Loading…
Reference in New Issue