login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
September
»
1
Re: [PATCH 4/5] rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ON
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Benny Halevy
Subject:
Re: [PATCH 4/5] rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ON
Date: Monday, September 1, 2008 - 6:27 am
On Sep. 01, 2008, 16:21 +0300, Boaz Harrosh <bharrosh@panasas.com> wrote:
quoted text
> A "Set" of the sign-bit in an "&" operation causes a compiler warning. > Make calculations unsigned. > > [ The warning was masked by the use of (void)() cast in the old > BUILD_BUG_ON() ] > > Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> > TO: Ivo van Doorn <IvDoorn@gmail.com> > TO: John W. Linville <linville@tuxdriver.com> > CC: Ingo Molnar <mingo@elte.hu> > CC: Rusty Russell <rusty@rustcorp.com.au> > --- > drivers/net/wireless/rt2x00/rt2x00reg.h | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h > index 7e88ce5..c0e8706 100644 > --- a/drivers/net/wireless/rt2x00/rt2x00reg.h > +++ b/drivers/net/wireless/rt2x00/rt2x00reg.h > @@ -134,8 +134,8 @@ struct rt2x00_field32 { > * Note that we cannot use the is_power_of_2() function since this > * check must be done at compile-time. > */ > -#define is_power_of_two(x) ( !((x) & ((x)-1)) ) > -#define low_bit_mask(x) ( ((x)-1) & ~(x) ) > +#define is_power_of_two(x) ( !((unsigned)(x) & ((x)-1)) ) > +#define low_bit_mask(x) ( ((unsigned)(x)-1) & ~(x) )
Why not unsigned long? Benny
quoted text
> #define is_valid_mask(x) is_power_of_two(1 + (x) + low_bit_mask(x)) > > /* > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to
majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at
http://www.tux.org/lkml/
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCHSET 0/5] BUILD_BUG_ON: error on none-const expressions
, Boaz Harrosh
, (Mon Sep 1, 6:00 am)
[PATCH] debug, x86: move BUILD_BUG_ON() ARRAY_SIZE and __F ...
, Boaz Harrosh
, (Mon Sep 1, 6:07 am)
[PATCH 2/5] net/niu: Fix none-const BUILD_BUG_ON usage
, Boaz Harrosh
, (Mon Sep 1, 6:11 am)
[PATCH 3/5] virtio: Fix none-const BUILD_BUG_ON usage
, Boaz Harrosh
, (Mon Sep 1, 6:13 am)
[PATCH 4/5] rt2x00: Compiler warning unmasked by fix of BU ...
, Boaz Harrosh
, (Mon Sep 1, 6:21 am)
Re: [PATCH 4/5] rt2x00: Compiler warning unmasked by fix o ...
, Ivo Van Doorn
, (Mon Sep 1, 6:27 am)
Re: [PATCH 4/5] rt2x00: Compiler warning unmasked by fix o ...
, Benny Halevy
, (Mon Sep 1, 6:27 am)
[PATCH 5/5] debug: BUILD_BUG_ON: error on non-const expres ...
, Boaz Harrosh
, (Mon Sep 1, 6:28 am)
[PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by fix ...
, Boaz Harrosh
, (Mon Sep 1, 6:44 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const e ...
, Jan Beulich
, (Mon Sep 1, 6:55 am)
Re: [PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by ...
, Ivo Van Doorn
, (Mon Sep 1, 7:01 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const e ...
, Boaz Harrosh
, (Mon Sep 1, 7:21 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const ...
, Jan Beulich
, (Mon Sep 1, 7:36 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const ...
, Boaz Harrosh
, (Mon Sep 1, 8:00 am)
Re: [PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by ...
, Boaz Harrosh
, (Mon Sep 1, 8:17 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const ...
, Jan Beulich
, (Mon Sep 1, 8:29 am)
Re: [PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by ...
, Ivo van Doorn
, (Mon Sep 1, 9:34 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const ...
, Boaz Harrosh
, (Mon Sep 1, 9:41 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const e ...
, Jan Beulich
, (Tue Sep 2, 12:47 am)
Re: [PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by ...
, Boaz Harrosh
, (Tue Sep 2, 7:20 am)
Re: [PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by ...
, Ivo van Doorn
, (Tue Sep 2, 7:27 am)
Re: [PATCH 5/5] debug: BUILD_BUG_ON: error on non-const e ...
, Boaz Harrosh
, (Tue Sep 2, 8:19 am)
[PATCH 3/5 ver2] virtio: Fix non-const BUILD_BUG_ON usage
, Boaz Harrosh
, (Tue Sep 2, 8:53 am)
[PATCH 4/5 ver2] rt2x00: Compiler warning unmasked by fix ...
, Boaz Harrosh
, (Tue Sep 2, 8:55 am)
[PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-const e ...
, Boaz Harrosh
, (Tue Sep 2, 8:57 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Boaz Harrosh
, (Tue Sep 2, 9:06 am)
Re: [PATCH 5/5 ver3] debug: BUILD_BUG_ON: error on non-con ...
, Boaz Harrosh
, (Tue Sep 2, 9:07 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Jan Beulich
, (Tue Sep 2, 9:11 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Boaz Harrosh
, (Wed Sep 3, 1:57 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Jan Beulich
, (Wed Sep 3, 3:19 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Boaz Harrosh
, (Wed Sep 3, 3:52 am)
Re: [PATCHSET 0/5] BUILD_BUG_ON: error on none-const expre ...
, Ingo Molnar
, (Sat Sep 6, 9:01 am)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Rusty Russell
, (Wed Oct 1, 10:35 pm)
Re: [PATCH 5/5 ver2] debug: BUILD_BUG_ON: error on non-con ...
, Boaz Harrosh
, (Sun Oct 5, 2:34 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate