From patchwork Fri Jul 14 20:17:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9841635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3F33602D8 for ; Fri, 14 Jul 2017 20:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E50B0287C3 for ; Fri, 14 Jul 2017 20:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D95B3287CA; Fri, 14 Jul 2017 20:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71570287C3 for ; Fri, 14 Jul 2017 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751049AbdGNURM (ORCPT ); Fri, 14 Jul 2017 16:17:12 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35353 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbdGNURL (ORCPT ); Fri, 14 Jul 2017 16:17:11 -0400 Received: by mail-oi0-f67.google.com with SMTP id l130so11382772oib.2; Fri, 14 Jul 2017 13:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2w/GyUriUnJGlSYRaPW7P7eJTa7T1OywjX5jBnp1Ack=; b=RtG2kRGNjr0/NN+vyfsYIC+qJ6zOgfNglHiv9Qx4ZdooLTW52Xjs/eAMjFNnxXEcAR wnHGt8gbq3Sq+FWHEr4YbokMFihbvFPyKf9oi0AWkl+TiRSfKB1bGjAsHo0m2cFfSy0j Q599UKOwP+4rqTuvF74iLl6r41RoNC/0EZyQvm5sAxu1btlvlPTqijMSYcE8yTDEgALl OAtHfYy7vrMghJChvq0C73LQw7wyD+HTIkU9RBd8I0HVOBSN70N7T4XwuRmaS7qUGNwR 6Y7j8MVsbDkeCQHyBkSo4g192AGSy7Q1L7jlrnUnltVl+2ayHhBlEXcKfYdrBoPNPHob hrrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2w/GyUriUnJGlSYRaPW7P7eJTa7T1OywjX5jBnp1Ack=; b=FxA3HYi1oJ8adxZJMMwOUqbbj0yh/ZVui/UjsqdtwbqsPPnWNsVY4HCuj7xKPoJpaC OpVSD+INSOynF858DFTaxx5gdae4RHTphq7O2UadM4HwBRs16y6VWaG3hhHwcljVoLKG j3mcbRhDSdLXTr2/clV83nxC7BOIhTcXsDGfF9nrdlbDpcGZ0q7eDM8+dATopbxpKv5F J9hHXjrA5DgW0VoyEJjnsRIgpDMLmDEHeU9XLnr6D7qzBKDJVQmp2RXQ8SeUnP+0z3c6 30OtOOuarS1XvOOJSiAZCJw9zJvuN5JaK6UwsWK9Cd9lwMBC2dxOzlHg8BcHsb07lsh3 dkcg== X-Gm-Message-State: AIVw112Pj6pzdz/AOFWHL0Hzfci9nwiy+Sww+ldb+4eMBMvLnzWWx5nb qiwF9jtELNNR5Qx+E99N3XIfc0LqCA== X-Received: by 10.202.105.147 with SMTP id e141mr6430576oic.66.1500063430600; Fri, 14 Jul 2017 13:17:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.80.170 with HTTP; Fri, 14 Jul 2017 13:17:10 -0700 (PDT) In-Reply-To: References: <20170714092540.1217397-1-arnd@arndb.de> <20170714092540.1217397-9-arnd@arndb.de> From: Arnd Bergmann Date: Fri, 14 Jul 2017 22:17:10 +0200 X-Google-Sender-Auth: vSzMQxOM_zIIQXFzaxCR4dzAML4 Message-ID: Subject: Re: [PATCH 08/14] Input: adxl34x - fix gcc-7 -Wint-in-bool-context warning To: Linus Torvalds Cc: Linux Kernel Mailing List , Michael Hennerich , Dmitry Torokhov , Greg Kroah-Hartman , Tejun Heo , Guenter Roeck , IDE-ML , Linux Media Mailing List , Andrew Morton , DRI , "linux-input@vger.kernel.org" Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jul 14, 2017 at 9:24 PM, Linus Torvalds wrote: > On Fri, Jul 14, 2017 at 2:25 AM, Arnd Bergmann wrote: >> FIFO_MODE is an macro expression with a '<<' operator, which >> gcc points out could be misread as a '<': > > Yeah, no, NAK again. > > We don't make the code look worse just because gcc is being a f*cking > moron about things. > > This warning is clearly pure garbage. > I looked at this one again and found a better approach, matching the check that is done a few lines later. Unless you find something wrong with that one, I'd resubmit it with the fixup below. Arnd --- a/drivers/input/misc/adxl34x.c +++ b/drivers/input/misc/adxl34x.c @@ -789,21 +789,21 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq, __set_bit(pdata->ev_code_ff, input_dev->keybit); } if (pdata->ev_code_act_inactivity) __set_bit(pdata->ev_code_act_inactivity, input_dev->keybit); ac->int_mask |= ACTIVITY | INACTIVITY; if (pdata->watermark) { ac->int_mask |= WATERMARK; - if (FIFO_MODE(pdata->fifo_mode) == 0) + if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS) ac->pdata.fifo_mode |= FIFO_STREAM; } else { ac->int_mask |= DATA_READY; } if (pdata->tap_axis_control & (TAP_X_EN | TAP_Y_EN | TAP_Z_EN)) ac->int_mask |= SINGLE_TAP | DOUBLE_TAP; if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS) ac->fifo_delay = false;