From: David Miller <davem@davemloft.net>
To: joe@perches.com
Cc: bhutchings@solarflare.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] sfc: Replace enum efx_fc_type with a 'bitwise' type
Date: Tue, 17 May 2011 17:28:24 -0400 (EDT) [thread overview]
Message-ID: <20110517.172824.120028200915837203.davem@davemloft.net> (raw)
In-Reply-To: <1305667378.1722.65.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Tue, 17 May 2011 14:22:58 -0700
> On Tue, 2011-05-17 at 17:14 -0400, David Miller wrote:
>> Accept that the compiler currently doesn't want to allow enums to be
>> used as bit-masks, don't paper around it.
>
> A patch applied yesterday using enums as bitmasks:
> http://patchwork.ozlabs.org/patch/95802/
Thanks, fixed:
--------------------
ipv4: Don't use enums as bitmasks in ip_fragment.c
Noticed by Joe Perches.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/ip_fragment.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 9e1458d..0ad6035 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -81,12 +81,10 @@ struct ipq {
* We want to check ECN values of all fragments, do detect invalid combinations.
* In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.
*/
-enum {
- IPFRAG_ECN_NOT_ECT = 0x01, /* one frag had ECN_NOT_ECT */
- IPFRAG_ECN_ECT_1 = 0x02, /* one frag had ECN_ECT_1 */
- IPFRAG_ECN_ECT_0 = 0x04, /* one frag had ECN_ECT_0 */
- IPFRAG_ECN_CE = 0x08, /* one frag had ECN_CE */
-};
+#define IPFRAG_ECN_NOT_ECT 0x01 /* one frag had ECN_NOT_ECT */
+#define IPFRAG_ECN_ECT_1 0x02 /* one frag had ECN_ECT_1 */
+#define IPFRAG_ECN_ECT_0 0x04 /* one frag had ECN_ECT_0 */
+#define IPFRAG_ECN_CE 0x08 /* one frag had ECN_CE */
static inline u8 ip4_frag_ecn(u8 tos)
{
--
1.7.4.4
next prev parent reply other threads:[~2011-05-17 21:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 18:14 sfc: an enumeration is not a bitmask David Miller
2011-05-17 18:18 ` Ben Hutchings
2011-05-17 18:23 ` David Miller
2011-05-17 18:48 ` [PATCH net-next-2.6] sfc: Suppress warning about combining enum flags by gcc 4.5 Ben Hutchings
2011-05-17 19:26 ` David Miller
2011-05-17 21:06 ` [PATCH net-next-2.6] sfc: Replace enum efx_fc_type with a 'bitwise' type Ben Hutchings
2011-05-17 21:14 ` David Miller
2011-05-17 21:22 ` Joe Perches
2011-05-17 21:28 ` David Miller [this message]
2011-05-17 21:30 ` Michał Mirosław
2011-05-17 21:36 ` Eric Dumazet
2011-05-17 21:43 ` Joe Perches
2011-05-17 21:43 ` [PATCH net-next-2.6] sfc: Replace enum efx_fc_type with macros and type alias Ben Hutchings
2011-05-17 21:45 ` David Miller
2011-05-18 2:01 ` [PATCH net-next-2.6] sfc: Replace enum efx_fc_type with a 'bitwise' type Jeff Garzik
2011-05-18 2:23 ` David Miller
2011-05-18 2:59 ` Jeff Garzik
2011-05-17 18:57 ` sfc: an enumeration is not a bitmask Jeff Garzik
2011-05-17 19:09 ` Michał Mirosław
2011-05-17 19:22 ` Ben Hutchings
2011-05-17 22:00 ` Jeff Garzik
2011-05-17 23:19 ` Michał Mirosław
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110517.172824.120028200915837203.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bhutchings@solarflare.com \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).