Re: [PATCH] afs: fsclient.c sparse endian annotations of operation_ID

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Howells
Date: Wednesday, August 27, 2008 - 4:12 am

Harvey Harrison <harvey.harrison@gmail.com> wrote:


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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] afs: fsclient.c sparse endian annotations of o ..., David Howells, (Wed Aug 27, 4:12 am)