From patchwork Thu May 11 11:46:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9721249 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 EE7EB6031B for ; Thu, 11 May 2017 11:47:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E80E428649 for ; Thu, 11 May 2017 11:47:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCD7528666; Thu, 11 May 2017 11:47:41 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 A39D328649 for ; Thu, 11 May 2017 11:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932434AbdEKLr2 (ORCPT ); Thu, 11 May 2017 07:47:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:50227 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932250AbdEKLr1 (ORCPT ); Thu, 11 May 2017 07:47:27 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LbO0s-1dtguR2zz0-00kz58; Thu, 11 May 2017 13:47:13 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Sean Young , Hans Verkuil , Wolfram Sang , Geliang Tang , Daniel Wagner , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] V4L/DVB: ir-core: fix gcc-7 warning on bool arithmetic Date: Thu, 11 May 2017 13:46:44 +0200 Message-Id: <20170511114711.2916593-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:PWBL3xtehzpCngzcNbkOYmilynTlPkkh9Cw8QsInMPgh3CyivzC HYZ+zUdCMdnKDAIMBn4y/5rr9McJvBms4odFPrUj6Wcg4p/OIZeUx3khZO4SKNDYyPknb9W NqpvhfL26TxNd5pzowv1MaiqHbbhryRUf7tHqNneTyN0YXDY7qEq+3piAu72CWDiP8uOWbG JGwuVXKlSNeMz1FxGtaig== X-UI-Out-Filterresults: notjunk:1; V01:K0:U/DXAdtLUQ0=:Lg2GrjDlLNw1qBRFDh4Zfw vYPFiiv+8qYoVAHwPmWIQa14tcriW1EZMfk1A5PR/454jNFVyYT+793qLZUGf3uDgDLQJcc07 WtJARwsMfAfqV7USXfFtBFmcJEQvvAoMDTAhOqKMgEMbXUvHbcEtNCeaHiKAdTcC98FKf5TsP IcSSlt0IMJiRDYX/UaaCwGaJfA/6MVHK9qGae/py/ddnH/pD57SewPSBXmX3AQ+5HnlBnu1zK C2rHKS08NfGeihKwJpPiVSAQcQXE585OMjC5pUJdx/4TTFWDhOFm+pIpVh7+Ki6Hog3dAOSQ0 kFHUGjoGm231Myr+CgbBR/EEK5XlYeAPXlcik/R70YoaLtFNjEvKWc22xptIkPcTtIEByCxGt Ijtr3ltUwZdAJOfQmbXPKqf9niImbd9BAKsWj44J0S+naDfbHoZpRI5uUXpH5+K645D0FF6Y2 pm8NCxmmNirt++XutEEt7indGE1HdhUcJnIhGYZw9WmzI7NRwFiAr5ycZ2IQ04mMnLyeJLW1g dHQxosESfdTdm39SByHemEfrFCKVXtsjU/tZsw4vhSBGTHiqw6ZG+O5YBqKmkhaFNpPoVb3QO 0Uh5xaAsO9a0X69MHM9Ix5qUpdMrIv2Niqxf3v3I9zHLwQYmWm0q81uEPSAeb5Zq40K8Q25xs ZpMhehwXYkXbg7hiSuRgZEMQlcCNl8rgKowjls8ogxJL/3ZE01n+AbrlA3NoSxN5md1U= 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 gcc-7 suggests that an expression using a bitwise not and a bitmask on a 'bool' variable is better written using boolean logic: drivers/media/rc/imon.c: In function 'imon_incoming_scancode': drivers/media/rc/imon.c:1725:22: error: '~' on a boolean expression [-Werror=bool-operation] ictx->pad_mouse = ~(ictx->pad_mouse) & 0x1; ^ drivers/media/rc/imon.c:1725:22: note: did you mean to use logical not? I agree. Fixes: 21677cfc562a ("V4L/DVB: ir-core: add imon driver") Signed-off-by: Arnd Bergmann --- drivers/media/rc/imon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 3489010601b5..bd76534a2749 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1722,7 +1722,7 @@ static void imon_incoming_scancode(struct imon_context *ictx, if (kc == KEY_KEYBOARD && !ictx->release_code) { ictx->last_keycode = kc; if (!nomouse) { - ictx->pad_mouse = ~(ictx->pad_mouse) & 0x1; + ictx->pad_mouse = !ictx->pad_mouse; dev_dbg(dev, "toggling to %s mode\n", ictx->pad_mouse ? "mouse" : "keyboard"); spin_unlock_irqrestore(&ictx->kc_lock, flags);