From: David Howells <dhowells@redhat.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: dhowells@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] afs: fsclient.c sparse endian annotations of operation_ID
Date: Wed, 27 Aug 2008 12:12:24 +0100 [thread overview]
Message-ID: <28254.1219835544@redhat.com> (raw)
In-Reply-To: <1219788326.6069.40.camel@brick>
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:
<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
next prev parent reply other threads:[~2008-08-27 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-26 22:05 [PATCH] afs: fsclient.c sparse endian annotations of operation_ID Harvey Harrison
2008-08-27 11:12 ` David Howells [this message]
2008-08-27 11:17 ` David Miller
2008-08-28 2:22 ` Al Viro
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=28254.1219835544@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox