public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: zab@zabbo.net
Cc: jgarzik@pobox.com, greg@kroah.com, kristen.c.accardi@intel.com,
	linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 6700/6702PXH quirk
Date: Mon, 08 Aug 2005 10:45:30 -0700 (PDT)	[thread overview]
Message-ID: <20050808.104530.85410060.davem@davemloft.net> (raw)
In-Reply-To: <42F7998D.8030606@zabbo.net>

From: Zach Brown <zab@zabbo.net>
Date: Mon, 08 Aug 2005 10:42:37 -0700

> 	if (!foo->enabled)
> 	if (!(foo->flags & FOO_FLAG_ENABLED)

You can hide the "complexity" of the second line behind
macros.  And this is what is done in most places.

Alternatively, you can use the existing bitops interfaces,
and in that case you define bit numbers only then use the
bitops.h interfaces to do all the work (probably the __set_bit()
et al. non-atomic variants in this case).

Really, I think it's worth it.  I absolutely refuse to put sets of
boolean states into C bitfields or even worse integer members.
Just define a u32 bitmask and be done with it.

  reply	other threads:[~2005-08-08 17:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05 16:27 [PATCH] 6700/6702PXH quirk Kristen Accardi
2005-08-05 17:12 ` Bjorn Helgaas
2005-08-05 17:20   ` Kristen Accardi
2005-08-05 18:35 ` Greg KH
2005-08-05 19:10   ` Kristen Accardi
2005-08-05 22:05   ` Kristen Accardi
2005-08-05 22:26     ` Andrew Morton
2005-08-05 22:40       ` Kristen Accardi
2005-08-05 22:51         ` Andrew Morton
2005-08-05 22:57     ` Greg KH
2005-08-06  3:34       ` Jeff Garzik
2005-08-06  8:50         ` Matthew Wilcox
2005-08-06 15:57           ` Jeff Garzik
2005-08-07 15:46             ` Denis Vlasenko
2005-08-08 17:42         ` Zach Brown
2005-08-08 17:45           ` David S. Miller [this message]
2005-08-08 17:53             ` Zach Brown
2005-08-05 22:50   ` Jeff Garzik
2005-08-05 23:51     ` Kristen Accardi
2005-08-08 16:36       ` Bjorn Helgaas
2005-08-08 17:57         ` Kristen Accardi

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=20050808.104530.85410060.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=jgarzik@pobox.com \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=zab@zabbo.net \
    /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