Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751662AbbHOKN5 (ORCPT ); Sat, 15 Aug 2015 06:13:57 -0400 Received: from mga02.intel.com ([134.134.136.20]:27078 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbbHOKNz convert rfc822-to-8bit (ORCPT ); Sat, 15 Aug 2015 06:13:55 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,683,1432623600"; d="scan'208";a="626002118" From: "Drokin, Oleg" To: Maxime Lorrillere CC: "Dilger, Andreas" , Greg Kroah-Hartman , "" Subject: Re: [PATCH v2] staging: lustre: fix symbol redeclared with different type in libcfs Thread-Topic: [PATCH v2] staging: lustre: fix symbol redeclared with different type in libcfs Thread-Index: AQHQ1zVYJvs+xEh+90ahOtzyPHrgG54NTR4A Date: Sat, 15 Aug 2015 10:13:53 +0000 Message-ID: <138C4E5D-DD96-488D-97B0-CC44006DABBF@intel.com> References: <1439627720-20748-1-git-send-email-maxime.lorrillere@gmail.com> In-Reply-To: <1439627720-20748-1-git-send-email-maxime.lorrillere@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.252.192.119] Content-Type: text/plain; charset="us-ascii" Content-ID: <5CAEFD765212E54B9157EF98F9CB5C96@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1997 Lines: 46 On Aug 15, 2015, at 4:35 AM, Maxime Lorrillere wrote: > lbug_with_loc is declared with __attribute__((noreturn)) in libcfs_private.h > and without this attribute in linux-debug.c. This generates the following > sparse error: >>>> drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:149:6: error: symbol 'lbug_with_loc' redeclared with different type (originally declared at drivers/staging/lustre/lustre/libcfs/linux/../../../include/linux/libcfs/libcfs_private.h:82) - different modifiers > > This patches removes this attribute in libcfs_private.h as it seems to me that > this optimization is not necessary. Well, the whole idea is that the attribute tells the compiler and thing like static analysis tools that there's no return from this function. This helps us to highlight dead code and also certain false positive warnings abut stuff possibly used not-initialized and the like. I'd rather prefer the actual function to be declared as no-return. Thanks. > > Signed-off-by: Maxime Lorrillere > --- > drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > index 9544860..e60b92b 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > @@ -79,7 +79,7 @@ do { \ > > #define KLASSERT(e) LASSERT(e) > > -void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn)); > +void lbug_with_loc(struct libcfs_debug_msg_data *); > > #define LBUG() \ > do { \ > -- > 2.5.0 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/