[lustre-devel] [PATCH] staging: lustre: shut up clang warnings on CLASSERT()

Arnd Bergmann arnd at arndb.de
Thu Feb 2 02:40:32 PST 2017


On Thu, Feb 2, 2017 at 10:54 AM, Greg Kroah-Hartman
<gregkh at linuxfoundation.org> wrote:
b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
>> > index aab15d8112a4..2d5435029185 100644
>> > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
>> > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
>> > @@ -291,7 +291,7 @@ do {                                                        \
>> >  *       value  after  conversion...
>> >  *
>> >  */
>> > -#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)
>> > +#define CLASSERT(cond) do {switch (42) {case (cond): case 0: default: break; } } while (0)
>
> Ugh, why not just use the in-kernel ASSERT macro instead?

We don't have one ;-)

I've done a semi-automated patch to replace CLASSERT() with the respective
BUILD_BUG_ON() now, but that patch is quite large.

    Arnd


More information about the lustre-devel mailing list