On Wed, Aug 27, 2008 at 04:17:05AM -0700, David Miller wrote:
quoted text > From: David Howells <dhowells@redhat.com>
> Date: Wed, 27 Aug 2008 12:12:24 +0100
>
> > Harvey Harrison <harvey.harrison@gmail.com> wrote:
> >
> > > + if (call->operation_ID != __constant_htonl(FSFETCHDATA64)) {
> >
> > Doesn't htonl() resolve to this for a constant argument? Following through
> > the definitions, it certainly looks like it ought to:
>
> Yes it does.
>
> The __constant_*() interfaces should only be uses for things that
> must be evaluated at compile time (static data initializations,
> switch statement case values etc.).
It's not just "must be evaluated at compile time"; it's "must be C constant
expressions", which is much stricter. And no, in the case quoted above
__constant_ form is not needed. Just use htonl()...
--
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/
Messages in current thread:
Re: [PATCH] afs: fsclient.c sparse endian annotations of o ... , Al Viro , (Wed Aug 27, 7:22 pm)