From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755724AbeAOPDA (ORCPT + 1 other); Mon, 15 Jan 2018 10:03:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54434 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755483AbeAOPC6 (ORCPT ); Mon, 15 Jan 2018 10:02:58 -0500 Date: Mon, 15 Jan 2018 16:00:28 +0100 From: Greg Kroah-Hartman To: Fabian Huegel Cc: Oleg Drokin , Andreas Dilger , James Simmons , Lai Siyao , "John L . Hammond" , devel@driverdev.osuosl.org, Ben Evans , NeilBrown , Christoph Volkert , linux-kernel@i4.cs.fau.de, linux-kernel@vger.kernel.org, lustre-devel@lists.lustre.org Subject: Re: [PATCH 1/8] staging: lustre: Enclose complex macros in parentheses Message-ID: <20180115150028.GA10946@kroah.com> References: <1515691022-22729-1-git-send-email-fabian_huegel@web.de> <1515691022-22729-2-git-send-email-fabian_huegel@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515691022-22729-2-git-send-email-fabian_huegel@web.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 06:16:55PM +0100, Fabian Huegel wrote: > Checkpatch wants complex macros to be enclosed in parentheses, so we > put parentheses around these four macros. > > Signed-off-by: Fabian Huegel > Signed-off-by: Christoph Volkert > --- > drivers/staging/lustre/lustre/include/obd_class.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h > index 67c535c..5c8cf30 100644 > --- a/drivers/staging/lustre/lustre/include/obd_class.h > +++ b/drivers/staging/lustre/lustre/include/obd_class.h > @@ -294,10 +294,10 @@ struct obdo; > > void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj); > > -#define OBT(dev) (dev)->obd_type > -#define OBP(dev, op) (dev)->obd_type->typ_dt_ops->op > -#define MDP(dev, op) (dev)->obd_type->typ_md_ops->op > -#define CTXTP(ctxt, op) (ctxt)->loc_logops->lop_##op > +#define OBT(dev) ((dev)->obd_type) > +#define OBP(dev, op) ((dev)->obd_type->typ_dt_ops->op) > +#define MDP(dev, op) ((dev)->obd_type->typ_md_ops->op) > +#define CTXTP(ctxt, op) ((ctxt)->loc_logops->lop_##op) That really doesn't make any sense, as this can only be a variable in here, not any "complex expression". Sometimes checkpatch.pl isn't very smart. Also, these macros are horridly named, odds are they are not even needed... thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 16:00:28 +0100 Subject: [lustre-devel] [PATCH 1/8] staging: lustre: Enclose complex macros in parentheses In-Reply-To: <1515691022-22729-2-git-send-email-fabian_huegel@web.de> References: <1515691022-22729-1-git-send-email-fabian_huegel@web.de> <1515691022-22729-2-git-send-email-fabian_huegel@web.de> Message-ID: <20180115150028.GA10946@kroah.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Fabian Huegel Cc: Oleg Drokin , Andreas Dilger , James Simmons , Lai Siyao , "John L . Hammond" , devel@driverdev.osuosl.org, Ben Evans , NeilBrown , Christoph Volkert , linux-kernel@i4.cs.fau.de, linux-kernel@vger.kernel.org, lustre-devel@lists.lustre.org On Thu, Jan 11, 2018 at 06:16:55PM +0100, Fabian Huegel wrote: > Checkpatch wants complex macros to be enclosed in parentheses, so we > put parentheses around these four macros. > > Signed-off-by: Fabian Huegel > Signed-off-by: Christoph Volkert > --- > drivers/staging/lustre/lustre/include/obd_class.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h > index 67c535c..5c8cf30 100644 > --- a/drivers/staging/lustre/lustre/include/obd_class.h > +++ b/drivers/staging/lustre/lustre/include/obd_class.h > @@ -294,10 +294,10 @@ struct obdo; > > void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj); > > -#define OBT(dev) (dev)->obd_type > -#define OBP(dev, op) (dev)->obd_type->typ_dt_ops->op > -#define MDP(dev, op) (dev)->obd_type->typ_md_ops->op > -#define CTXTP(ctxt, op) (ctxt)->loc_logops->lop_##op > +#define OBT(dev) ((dev)->obd_type) > +#define OBP(dev, op) ((dev)->obd_type->typ_dt_ops->op) > +#define MDP(dev, op) ((dev)->obd_type->typ_md_ops->op) > +#define CTXTP(ctxt, op) ((ctxt)->loc_logops->lop_##op) That really doesn't make any sense, as this can only be a variable in here, not any "complex expression". Sometimes checkpatch.pl isn't very smart. Also, these macros are horridly named, odds are they are not even needed... thanks, greg k-h