[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141001.145615.234381013367053243.davem@davemloft.net>
Date: Wed, 01 Oct 2014 14:56:15 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: alexei.starovoitov@...il.com
Cc: eli@...lanox.com, netdev@...r.kernel.org, ogerlitz@...lanox.com,
yevgenyp@...lanox.com, joe@...ches.com
Subject: Re: [PATCH V1 net-next 2/4] net/mlx5_core: Use hardware registers
description header file
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
Date: Wed, 1 Oct 2014 10:12:10 -0700
>> +#define MLX5_SET64(typ, p, fld, v) do { \
>> + if (__mlx5_bit_sz(typ, fld) != 64) \
>> + non_existent_function(); \
>> + else if (__mlx5_bit_off(typ, fld) % 64) \
>> + non_existent_function(); \
>> + else \
>> + *((__be64 *)(p) + __mlx5_64_off(typ, fld)) = cpu_to_be64(v); \
>> +} while (0)
>
> is it possible to use BUILD_BUG_ON instead of runtime pr_info() ?
Indeed, please don't invent your own facilities for compile-time checks,
we have BUILD_BUG_ON() so please use it instead of non_existent_function()
which BTW doesn't work with some non-gcc compilers.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists