All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Helge Deller <deller@gmx.de>, David Miller <davem@davemloft.net>,
	jaswinder@kernel.org, mingo@elte.hu, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
	Kyle McMartin <kyle@mcmartin.ca>
Subject: Re: Confusion in usr/include/asm-generic/fcntl.h
Date: Wed, 21 Jan 2009 18:28:37 +0100	[thread overview]
Message-ID: <20090121172837.GA4386@uranus.ravnborg.org> (raw)
In-Reply-To: <200901211313.17394.arnd@arndb.de>

On Wed, Jan 21, 2009 at 01:13:16PM +0100, Arnd Bergmann wrote:
> On Wednesday 21 January 2009, Sam Ravnborg wrote:
> > Could we add a new symbol for this?
> > We know we are going to use this in several places so a simpler var=
iant
> > would be more readable.
> >=20
> > Something like:
> >=20
> > #ifdef __64BIT
> > ...
> > #endif
> >=20
> > When we define __64BIT we would use the =A0__BITS_PER_LONG =3D=3D 6=
4 check.
>=20
> I would prefer using the __BITS_PER_LONG =3D=3D 64 check directly, be=
cause
> it gives you a warning when __BITS_PER_LONG is undefined, whereas the
> #ifdef check gets easily fooled by include order problems. Note that
> this is not a problem in the kernel for CONFIG_* symbols which are
> always defined before the first #include.

It gives the warning only if you add -Wundef which IIRC is not default
with -Wall. And using the "__BITS_PER_LONG =3D=3D 64" the risk of gitti=
ng
the expression wrong is much higher than the simpler variant where
you only write:

    __64BIT

But I have no strong feelings for it.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Helge Deller <deller@gmx.de>, David Miller <davem@davemloft.net>,
	jaswinder@kernel.org, mingo@elte.hu, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
	Kyle McMartin <kyle@mcmartin.ca>
Subject: Re: Confusion in usr/include/asm-generic/fcntl.h
Date: Wed, 21 Jan 2009 18:28:37 +0100	[thread overview]
Message-ID: <20090121172837.GA4386@uranus.ravnborg.org> (raw)
In-Reply-To: <200901211313.17394.arnd@arndb.de>

On Wed, Jan 21, 2009 at 01:13:16PM +0100, Arnd Bergmann wrote:
> On Wednesday 21 January 2009, Sam Ravnborg wrote:
> > Could we add a new symbol for this?
> > We know we are going to use this in several places so a simpler variant
> > would be more readable.
> > 
> > Something like:
> > 
> > #ifdef __64BIT
> > ...
> > #endif
> > 
> > When we define __64BIT we would use the  __BITS_PER_LONG == 64 check.
> 
> I would prefer using the __BITS_PER_LONG == 64 check directly, because
> it gives you a warning when __BITS_PER_LONG is undefined, whereas the
> #ifdef check gets easily fooled by include order problems. Note that
> this is not a problem in the kernel for CONFIG_* symbols which are
> always defined before the first #include.

It gives the warning only if you add -Wundef which IIRC is not default
with -Wall. And using the "__BITS_PER_LONG == 64" the risk of gitting
the expression wrong is much higher than the simpler variant where
you only write:

    __64BIT

But I have no strong feelings for it.

	Sam

  parent reply	other threads:[~2009-01-21 17:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21  0:04 Confusion in usr/include/asm-generic/fcntl.h Jaswinder Singh Rajput
2009-01-21  0:16 ` David Miller
2009-01-21  0:24   ` Arnd Bergmann
2009-01-21  0:32     ` David Miller
2009-01-21  8:13       ` Helge Deller
2009-01-21  8:24         ` Arnd Bergmann
2009-01-21 11:38           ` Sam Ravnborg
2009-01-21 12:13             ` Arnd Bergmann
2009-01-21 12:13               ` Arnd Bergmann
2009-01-21 14:29               ` Kyle McMartin
2009-01-21 14:29                 ` Kyle McMartin
2009-01-21 16:44               ` H. Peter Anvin
2009-01-21 17:28               ` Sam Ravnborg [this message]
2009-01-21 17:28                 ` Sam Ravnborg
2009-01-21 17:57                 ` H. Peter Anvin
2009-01-27 22:35           ` Helge Deller
2009-01-21 22:25     ` Grant Grundler
2009-01-21 22:43       ` John David Anglin
2009-01-22  0:46         ` H. Peter Anvin
2009-01-22  2:52           ` John David Anglin
2009-01-22  2:56             ` H. Peter Anvin
2009-01-21  0:48   ` H. Peter Anvin
2009-01-21  1:47     ` H. Peter Anvin
2009-01-23 15:18     ` Jaswinder Singh Rajput
2009-01-26 15:53       ` Arnd Bergmann
2009-01-26 16:24         ` Jaswinder Singh Rajput

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=20090121172837.GA4386@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=jaswinder@kernel.org \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.