Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754505AbbFOXGn (ORCPT ); Mon, 15 Jun 2015 19:06:43 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54259 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbbFOXGf (ORCPT ); Mon, 15 Jun 2015 19:06:35 -0400 X-Sasl-enc: kCCbDJ+Jj8IoD/09ScA7pLlIWmW9oC9oMGnxdrB8mhH2 1434409594 Date: Mon, 15 Jun 2015 16:06:33 -0700 From: Greg KH To: Bilel DRIRA Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] include/uapi/linux/swab.h: define a silent macro to avoid sparse error Message-ID: <20150615230633.GA14978@kroah.com> References: <1434320613-28700-1-git-send-email-bilel.dr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434320613-28700-1-git-send-email-bilel.dr@gmail.com> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1513 Lines: 46 On Sun, Jun 14, 2015 at 11:23:32PM +0100, Bilel DRIRA wrote: > define a silent macro when _CHECKER_ is defined. > This change fixes the following sparse errors: > > include/uapi/linux/swab.h:60:16: error: undefined identifier '__builtin_bswap32' > include/uapi/linux/swab.h:60:33: error: not a function > include/uapi/linux/swab.h:71:16: error: undefined identifier '__builtin_bswap64' > include/uapi/linux/swab.h:71:33: error: not a function > include/uapi/linux/swab.h:60:33: error: not a function > > Signed-off-by: Bilel DRIRA > --- > include/uapi/linux/swab.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h > index 0e011eb..c04de49 100644 > --- a/include/uapi/linux/swab.h > +++ b/include/uapi/linux/swab.h > @@ -5,6 +5,18 @@ > #include > #include > > +#ifdef __CHECKER__ > + > +#ifdef __HAVE_BUILTIN_BSWAP64__ > +#define __builtin_bswap64(val) (0) > +#endif > + > +#ifdef __HAVE_BUILTIN_BSWAP32__ > +#define __builtin_bswap32(val) (0) > +#endif > + > +#endif /* __CHECKER__ */ Shouldn't the tool be fixed instead of papering over the issue with random defines like this? thanks, greg k-h -- 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/