From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Thu, 2 Feb 2017 11:43:57 +0100 Subject: [lustre-devel] [PATCH] staging: lustre: shut up clang warnings on CLASSERT() In-Reply-To: References: <20170201165314.2588373-1-arnd@arndb.de> <20170202095453.GA30437@kroah.com> Message-ID: <20170202104357.GB22904@kroah.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Arnd Bergmann Cc: "Dilger, Andreas" , "Drokin, Oleg" , James Simmons , "Eremin, Dmitry" , Lustre Development List , "devel@driverdev.osuosl.org" , LKML On Thu, Feb 02, 2017 at 11:40:32AM +0100, Arnd Bergmann wrote: > On Thu, Feb 2, 2017 at 10:54 AM, Greg Kroah-Hartman > 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 ;-) Oh nice! > I've done a semi-automated patch to replace CLASSERT() with the respective > BUILD_BUG_ON() now, but that patch is quite large. Should be easy to script, I missed that this was a build-time check. Heck, I'll take a script to do this, or I can just do it in my end. thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751148AbdBBKn7 (ORCPT ); Thu, 2 Feb 2017 05:43:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33030 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbdBBKn6 (ORCPT ); Thu, 2 Feb 2017 05:43:58 -0500 Date: Thu, 2 Feb 2017 11:43:57 +0100 From: Greg Kroah-Hartman To: Arnd Bergmann Cc: "Dilger, Andreas" , "Drokin, Oleg" , James Simmons , "Eremin, Dmitry" , Lustre Development List , "devel@driverdev.osuosl.org" , LKML Subject: Re: [PATCH] staging: lustre: shut up clang warnings on CLASSERT() Message-ID: <20170202104357.GB22904@kroah.com> References: <20170201165314.2588373-1-arnd@arndb.de> <20170202095453.GA30437@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 02, 2017 at 11:40:32AM +0100, Arnd Bergmann wrote: > On Thu, Feb 2, 2017 at 10:54 AM, Greg Kroah-Hartman > 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 ;-) Oh nice! > I've done a semi-automated patch to replace CLASSERT() with the respective > BUILD_BUG_ON() now, but that patch is quite large. Should be easy to script, I missed that this was a build-time check. Heck, I'll take a script to do this, or I can just do it in my end. thanks, greg k-h