Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967324AbdCXUKh (ORCPT ); Fri, 24 Mar 2017 16:10:37 -0400 Received: from mga14.intel.com ([192.55.52.115]:46679 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbdCXUKa (ORCPT ); Fri, 24 Mar 2017 16:10:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,216,1486454400"; d="scan'208";a="70391333" From: "Dilger, Andreas" To: Greg Kroah-Hartman CC: Arushi Singhal , "Drokin, Oleg" , James Simmons , lustre-devel , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "outreachy-kernel@googlegroups.com" Subject: Re: [PATCH] staging: lustre: Remove redundant code Thread-Topic: [PATCH] staging: lustre: Remove redundant code Thread-Index: AQHSpJNii76Tx9AJcUqBXYmKYFF0vaGkddqAgABrmYA= Date: Fri, 24 Mar 2017 20:10:16 +0000 Message-ID: <9D55D2DC-3CEB-471E-B37F-1721D1B328DA@intel.com> References: <20170324113952.GA31427@arushi-HP-Pavilion-Notebook> <20170324134459.GA26275@kroah.com> In-Reply-To: <20170324134459.GA26275@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.110.27] Content-Type: text/plain; charset="us-ascii" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v2OKAgiH021657 Content-Length: 1940 Lines: 54 On Mar 24, 2017, at 07:44, Greg Kroah-Hartman wrote: > > On Fri, Mar 24, 2017 at 05:09:53PM +0530, Arushi Singhal wrote: >> Remove the code which do not have any value. >> >> Signed-off-by: Arushi Singhal >> --- >> drivers/staging/lustre/lnet/lnet/net_fault.c | 5 ----- >> 1 file changed, 5 deletions(-) >> >> diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c >> index 18183cbb9859..b60261db9e67 100644 >> --- a/drivers/staging/lustre/lnet/lnet/net_fault.c >> +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c >> @@ -997,11 +997,6 @@ lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data) >> int >> lnet_fault_init(void) >> { >> - BUILD_BUG_ON(LNET_PUT_BIT != 1 << LNET_MSG_PUT); >> - BUILD_BUG_ON(LNET_ACK_BIT != 1 << LNET_MSG_ACK); >> - BUILD_BUG_ON(LNET_GET_BIT != 1 << LNET_MSG_GET); >> - BUILD_BUG_ON(LNET_REPLY_BIT != 1 << LNET_MSG_REPLY); > > Why does this not have any value? How are you ensuring that these > requirements are now being met? It was my recommendation to remove these checks, though on closer review I might have been a bit premature. For some reason I thought the LNET_*_BIT constants were defined in terms of LNET_MSG_*, but I see they are not. In conjunction with this change, the definition of LNET_*_BIT should be changed to be defined in terms of the LNET_MSG_* constants: #define LNET_PUT_BIT BIT(LNET_MSG_PUT) #define LNET_ACK_BIT BIT(LNET_MSG_ACK) #define LNET_GET_BIT BIT(LNET_MSG_GET) #define LNET_REPLY_BIT BIT(LNET_MSG_REPLY) The alternative would be to remove the LNET_*_BIT constants and use BIT(LNET_MSG_*) directly in the code, since that is easy enough to read compared to (1 << LNET_MSG_*) everywhere. There don't seem to be a lot of users, so this wouldn't be a giant patch. Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation