public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik•org>
To: David Miller <davem@davemloft•net>
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 22:59:02 -0400	[thread overview]
Message-ID: <4DD335F6.3010501@garzik.org> (raw)
In-Reply-To: <20110517.222302.158419141035335293.davem@davemloft.net>

On 05/17/2011 10:23 PM, David Miller wrote:
> From: Jeff Garzik<jeff@garzik•org>
>
>> On 05/17/2011 05:14 PM, 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.
>>
>> This practice is all over the kernel.
>>
>> It's a bit silly to make such a big deal, because of that.
>
> "We do something stupid everywhere" is never a good
> argument for anything.

grepping across the kernel, it is clearly a useful shorthand technique 
for defining typed, named constants, including bitmasks, used widely 
across multiple subsystems, drivers and include/linux.

Given that this technique has passed review time and again, and that 
kernel hackers -do- find it useful for valid reasons, I guess the only 
remaining defense is to call something "stupid."

	Jeff




  reply	other threads:[~2011-05-18  2:59 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
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 [this message]
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=4DD335F6.3010501@garzik.org \
    --to=jeff@garzik$(echo .)org \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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