Re: [PATCH] ATA over Ethernet driver for 2.6.10-rc3-bk11

From: Ed L Cashin
Date: Tue Dec 21 2004 - 10:23:33 EST


Scott Feldman <sfeldma@xxxxxxxxx> writes:

> On Fri, 2004-12-17 at 07:38, Ed L Cashin wrote:
>
>> + ETH_P_AOE = 0x88a2,
>
> include/linux/if_ether.h already defines this as ETH_P_EDP2=0x88A2; use
> that.
>
>> +static int
>> +aoehdr_atainit(struct aoedev *d, struct aoe_hdr *h)
>> +{
>> + u16 type = __constant_cpu_to_be16(ETH_P_AOE);

> How about __constant_htons()?

Hi. Andi Kleene and you both ask why we're using the __cpu_to_be16
kind of byte-swappers.

I think it comes down to a semantics thing, and it's probably
controversial. We are using fixed-size integers, so we specify the
size of the integers. A short happens to be 16-bits wide on most
architectures, but it needn't be, esp. in the future, so it's more
clear to say what we mean.

--
Ed L Cashin <ecashin@xxxxxxxxxx>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/