Re: [PATCH] net: Use a more standard macro for INET_ADDR_COOKIE

From: David Miller
Date: Wed May 14 2014 - 16:48:16 EST


From: Joe Perches <joe@xxxxxxxxxxx>
Date: Wed, 14 May 2014 13:44:09 -0700

> On Wed, 2014-05-14 at 16:08 -0400, David Miller wrote:
>> From: Joe Perches <joe@xxxxxxxxxxx>
>> Date: Tue, 13 May 2014 20:30:07 -0700
>>
>> > Missing a colon on definition use is a bit odd so
>> > change the macro for the 32 bit case to declare an
>> > __attribute__((unused)) and __deprecated variable.
>> >
>> > The __deprecated attribute will cause gcc to emit
>> > an error if the variable is actually used.
>> >
>> > Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
>>
>> This is fine, applied, thanks Joe.
>>
>> Perhaps it would have been nicer to make the macros be initializers,
>> so that it still would look like a proper variable declaration at
>> the use sites:
>>
>> const __addrpair var = INET_ADDR_COOKIE(x, y, z);
>>
>> or something like that.
>
> Maybe so, but there's no way to add an __attribute__
> before the = sign for the 32 bit case like that without
> another #define and it would then always require
> initialization too.

Good point.
--
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/