[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28254.1219835544@redhat.com>
Date: Wed, 27 Aug 2008 12:12:24 +0100
From: David Howells <dhowells@...hat.com>
To: Harvey Harrison <harvey.harrison@...il.com>
Cc: dhowells@...hat.com, Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] afs: fsclient.c sparse endian annotations of operation_ID
Harvey Harrison <harvey.harrison@...il.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:
<linux/byteorder/generic.h>
#undef htonl
#define ___htonl(x) __cpu_to_be32(x)
<linux/byteorder/little_endian.h>
#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
<linux/byteorder/swab.h>
# define __swab32(x) \
(__builtin_constant_p((__u32)(x)) ? \
___constant_swab32((x)) : \
__fswab32((x)))
at least for GCC with optimisation enabled.
Of course, linux/byteorder.h and linux/swab.h seem to do much the same. Any
idea why we have both sets? There seems to be unnecessary redundancy.
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists