From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751878AbdITTOD (ORCPT ); Wed, 20 Sep 2017 15:14:03 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33379 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbdITTOA (ORCPT ); Wed, 20 Sep 2017 15:14:00 -0400 X-Google-Smtp-Source: AOwi7QDDboVchHIz8LQ/JRyRX0jE1ANW2xpUJ06zyym9VP0eyHKsriib/x5Yv6RxdBcLNuMcPBOgYg== Date: Wed, 20 Sep 2017 12:13:57 -0700 From: Dmitry Torokhov To: Arnd Bergmann Cc: Michael Hennerich , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Input: adxl34x - fix gcc-7 -Wint-in-bool-context warning Message-ID: <20170920191357.GC6770@dtor-ws> References: <20170717114359.849493-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170717114359.849493-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 17, 2017 at 01:43:51PM +0200, Arnd Bergmann wrote: > FIFO_MODE is an macro expression with a '<<' operator, which > gcc points out could be misread as a '<': > > drivers/input/misc/adxl34x.c: In function 'adxl34x_probe': > drivers/input/misc/adxl34x.c:799:36: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context] > > This converts the test to an explicit comparison with FIFO_BYPASS, > making it clearer to gcc and the reader what is intended. > > Fixes: e27c729219ad ("Input: add driver for ADXL345/346 Digital Accelerometers") > Signed-off-by: Arnd Bergmann > --- > v2: use FIFO_BYPASS instead of 0 Applied, thank you. > > drivers/input/misc/adxl34x.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c > index 2b2d02f408bb..a3e79bf5a04b 100644 > --- a/drivers/input/misc/adxl34x.c > +++ b/drivers/input/misc/adxl34x.c > @@ -796,7 +796,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq, > > if (pdata->watermark) { > ac->int_mask |= WATERMARK; > - if (!FIFO_MODE(pdata->fifo_mode)) > + if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS) > ac->pdata.fifo_mode |= FIFO_STREAM; > } else { > ac->int_mask |= DATA_READY; > -- > 2.9.0 > -- Dmitry