From patchwork Wed Aug 6 18:33:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4687951 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD331C0338 for ; Wed, 6 Aug 2014 18:33:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6E6C20145 for ; Wed, 6 Aug 2014 18:33:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB72920170 for ; Wed, 6 Aug 2014 18:33:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756182AbaHFSde (ORCPT ); Wed, 6 Aug 2014 14:33:34 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:46374 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756153AbaHFSdd (ORCPT ); Wed, 6 Aug 2014 14:33:33 -0400 Received: by mail-pa0-f41.google.com with SMTP id rd3so3885990pab.14 for ; Wed, 06 Aug 2014 11:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7T08frY3AVjIewoHdp9RzOKn5w9a0WWpscOLrqrV/kg=; b=pAExgM9EFnBwMfGbNUuBGwBLOvg+kEg4fwomPtSyK4AWl8he3EN3E2/regDGoSrKev Jjtk8ZhyLf8oQ+pVp3nnw72c6zG6xtxpTaxcAwBRXkwKUXJIKCSLcTW0bF15rknmXGk9 bHVRTF3p6z6d8CfsgYhiCnAX5gykCG997qmtcZKp5n4Gso55Eew0aHmT+TtEwi9SnoCw H3QCYpA6gTgnMj1g1BqVGQjJEIcLbKq6xH5qXSheExBJ9J9dO+lLTUD3b+sAZHmuN/0G 7GWp9xAQ/Q7e5nCPDLoYSt1C+u0ayCvQ0/MAJeF/SSwu14n2j6yvTS1+g4vmpeGN1MSA DTIg== X-Received: by 10.70.43.170 with SMTP id x10mr12968134pdl.9.1407350012953; Wed, 06 Aug 2014 11:33:32 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id f12sm6048958pat.19.2014.08.06.11.33.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Aug 2014 11:33:32 -0700 (PDT) Date: Wed, 6 Aug 2014 11:33:28 -0700 From: Guenter Roeck To: Richard Weinberger Cc: Nick Krause , Mark Brown , "open list:SPI SUBSYSTEM" , open list Subject: Re: [PATCH] spi: Fix warning about redefinition Message-ID: <20140806183328.GA5409@roeck-us.net> References: <1407344128-9754-1-git-send-email-xerofoiffy@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Aug 06, 2014 at 07:19:54PM +0200, Richard Weinberger wrote: > On Wed, Aug 6, 2014 at 6:55 PM, Nick Krause wrote: > > Fix the following warnings about redefining READ and write > > > > drivers/spi/spi-omap-100k.c:73:0: warning: "WRITE" redefined [enabled by default] > > include/linux/fs.h:193:0: note: this is the location of the previous definition > > drivers/spi/spi-omap-100k.c:74:0: warning: "READ" redefined [enabled by default] > > include/linux/fs.h:192:0: note: this is the location of the previous definition > > > > Signed-off-by: Nick Krause > > --- > > drivers/spi/spi-omap-100k.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c > > index 5e91858..eb8ae4e 100644 > > --- a/drivers/spi/spi-omap-100k.c > > +++ b/drivers/spi/spi-omap-100k.c > > @@ -70,6 +70,12 @@ > > #define SPI_STATUS_WE (1UL << 1) > > #define SPI_STATUS_RD (1UL << 0) > > > > +#ifdef WRITE > > +#undef WRITE > > +#endif > > +#ifdef READ > > +#undef READ > > +#endif > > #define WRITE 0 > > #define READ 1 > > Are these symbols even in use? > It is always fun watching those patches flow by :-) With the following patch: When compiling the resulting code with W=1, I get: drivers/spi/spi-omap-100k.c: In function 'spi100k_read_data': drivers/spi/spi-omap-100k.c:148:6: warning: variable 'dataH' set but not used [-Wunused-but-set-variable] So, one might conclude that the defines are not used. Guenter --- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c index 5e91858..f72ddfc 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -70,8 +70,8 @@ #define SPI_STATUS_WE (1UL << 1) #define SPI_STATUS_RD (1UL << 0) -#define WRITE 0 -#define READ 1 +#undef WRITE +#undef READ [ just to make sure that no existing defines are used instead of the new ones ]