From patchwork Wed Nov 1 21:26:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willy Tarreau X-Patchwork-Id: 117733 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1371331qgn; Wed, 1 Nov 2017 14:27:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+REvyw5E6X8k509A76DGula2nMsbp73YVVeDQJPIYhNEW1mqR0QDacTrBf6Ui4tkptvMUhE X-Received: by 10.98.70.78 with SMTP id t75mr1299780pfa.6.1509571672340; Wed, 01 Nov 2017 14:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509571672; cv=none; d=google.com; s=arc-20160816; b=KIB8+MH2DjpcqzjYSttC17mpKBtYcks/L/ipWUs0qJbEsGK6GKYaYaJl1EobUzhBuk 4s2wxHmf3tT0cfkn0sL5jO7TP2i4YC92IX0md0I2LpBLPQ6wHGB6PjBwzlzjJjkDEtqU gOq7ucd9k42bOvRAkwdDzfjkd/Lqzs4YhYXJXRxN+8kKIOqGsaPKjVcOQPeo2qAk/noF qN/BPjTemMVlQJzfAsDSXrNnGIWP06294cuUDaRp7p6Hx+BU1egmUe72CiMh2NMRGLn7 w0kKzbpHVFT34nFLegq/04/oY/Rjx7PwmJj0oWYimYMzMAm2ShvG4iiJsxtuFIN1j2Us X9mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=b5wuZZYt2PHocyguz5oRBpKSwGsSo0N4fNk+fhCOZn4=; b=OMgn/b8HrnaQQr5tEbcSWcyfPg7EiYs1evtbO4lJJFWxCHXfn+sNUvyMaDdrs6owL0 ctxBjSLOU//m8XgM5rK4q4rzwlxynGXfDDVmebT4psb2nTSCiC26OeMzMUEtChnrP1Bd I00lqhJjEyjWpUBZhRmKtd5H3KIWGLZfpq3Tku9MfHJRTMNn3QFI9bY8Nh5JYtw3pRWy kBRDfIyeL0vvmQ9Hsh7CHfmYaGOyZJ9l+tofo7es2HTqOFyT65c0RLfbdi8yi8awtEVn 9xj4twU9+IbcEiapjBCkNypyXNXTC8Fb3Csgua7CTz1vHyrAHjjomcA7eqQP8kaG8dAS Zscw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f88si2043079pfk.57.2017.11.01.14.27.51; Wed, 01 Nov 2017 14:27:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934092AbdKAV1u (ORCPT + 26 others); Wed, 1 Nov 2017 17:27:50 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35281 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934051AbdKAV1p (ORCPT ); Wed, 1 Nov 2017 17:27:45 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id vA1LQl9h004971; Wed, 1 Nov 2017 22:26:47 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Arnd Bergmann , Johannes Berg , Willy Tarreau Subject: [PATCH 3.10 071/139] wext: handle NULL extra data in iwe_stream_add_point better Date: Wed, 1 Nov 2017 22:26:12 +0100 Message-Id: <1509571600-4858-22-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1509571600-4858-1-git-send-email-w@1wt.eu> References: <1509571159-4405-1-git-send-email-w@1wt.eu> <1509571600-4858-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 93be2b74279c15c2844684b1a027fdc71dd5d9bf upstream. gcc-7 complains that wl3501_cs passes NULL into a function that then uses the argument as the input for memcpy: drivers/net/wireless/wl3501_cs.c: In function 'wl3501_get_scan': include/net/iw_handler.h:559:3: error: argument 2 null where non-null expected [-Werror=nonnull] memcpy(stream + point_len, extra, iwe->u.data.length); This works fine here because iwe->u.data.length is guaranteed to be 0 and the memcpy doesn't actually have an effect. Making the length check explicit avoids the warning and should have no other effect here. Also check the pointer itself, since otherwise we get warnings elsewhere in the code. Signed-off-by: Arnd Bergmann Signed-off-by: Johannes Berg Signed-off-by: Willy Tarreau --- include/net/iw_handler.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.8.0.rc2.1.gbe9624a diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 5d5a6a4..5af07a1 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h @@ -551,7 +551,8 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends, memcpy(stream + lcp_len, ((char *) &iwe->u) + IW_EV_POINT_OFF, IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); - memcpy(stream + point_len, extra, iwe->u.data.length); + if (iwe->u.data.length && extra) + memcpy(stream + point_len, extra, iwe->u.data.length); stream += event_len; } return stream; From patchwork Wed Nov 1 21:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Willy Tarreau X-Patchwork-Id: 117735 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1372122qgn; Wed, 1 Nov 2017 14:28:49 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TDSc01uSHu8venygc2kyEj/SsMVI2xyr4r/Biz7E++Ym/bqNGKK+/u8WNtKYcChja9nB7i X-Received: by 10.98.75.77 with SMTP id y74mr1286237pfa.78.1509571729144; Wed, 01 Nov 2017 14:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509571729; cv=none; d=google.com; s=arc-20160816; b=kLIWsXRBV5IeDmgOCKj0xK6fDhW3nTZhmFeNOb8hdmD6nlOtkNcczkQEbyBEhnhp7K cp06N1aKYzxFJHGbHezb1LOqM8f4GH09PfdnCHg1q97jhIq4vU9S1VjBVvW3A4cE7kUs XwsofDwwGUwp2v7y+fgZfFbEdT4DB2kflg7UPnKbl3cWn82Q5Yai31qXP+teG+ChNxpI XHVNJLSAZ+0aU5cHa0l4/sXyr1K4aYGDJXthPur/1pYhy60zi78N5O7KFQe1JcN3Rpc1 2EjzQ4uUMrQlQ1p7g9UaLHpul5wxBuQgRPqq/eaY2SPHWeQoxwPGwCtZ1ljCckxpeXTm dqXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yHgtmBw4782gle+SRLJvXWeUILp06JwT7UI/OHz0q6E=; b=IizjPc1Rj+F/wR/rev50ty5N2zmL7LKWNbojrST5mV9ylMAbXOvJORqgAJSsRplIYX pKOK+cN+YkyKa3F0rshtSZ9Cn/7/2JsVOIQI59PCrFTdHVwFANn/Yzm5NhNB7IV/12+x 6VL6f5094wEjff7U2RD0E7ZC/HSkay/zQ0O586L7QyfYKEYca1Bi1dvpCzoHj52yBuVk cMwS75qIPV8YJ+6beR7c5vODWlVx0j3ayIbPqR9Ezxl4g9sy0bTeEqTgVqTAWQDJUrlQ KzKJEcufvPqDEa4xam0SOioOnE7mNtJlvk7gstDxt3h9y/XY/O5AlB4PIAD/rmnyru8X KONA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si1836787pgp.379.2017.11.01.14.28.48; Wed, 01 Nov 2017 14:28:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934335AbdKAV2p (ORCPT + 26 others); Wed, 1 Nov 2017 17:28:45 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35412 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934318AbdKAV2m (ORCPT ); Wed, 1 Nov 2017 17:28:42 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id vA1LQowW004989; Wed, 1 Nov 2017 22:26:50 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Arnd Bergmann , Borislav Petkov , Peter Zijlstra , Thomas Gleixner , Tom Lendacky , Ingo Molnar , Willy Tarreau Subject: [PATCH 3.10 089/139] x86/io: Add "memory" clobber to insb/insw/insl/outsb/outsw/outsl Date: Wed, 1 Nov 2017 22:26:30 +0100 Message-Id: <1509571600-4858-40-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1509571600-4858-1-git-send-email-w@1wt.eu> References: <1509571159-4405-1-git-send-email-w@1wt.eu> <1509571600-4858-1-git-send-email-w@1wt.eu> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 7206f9bf108eb9513d170c73f151367a1bdf3dbf upstream. The x86 version of insb/insw/insl uses an inline assembly that does not have the target buffer listed as an output. This can confuse the compiler, leading it to think that a subsequent access of the buffer is uninitialized: drivers/net/wireless/wl3501_cs.c: In function ‘wl3501_mgmt_scan_confirm’: drivers/net/wireless/wl3501_cs.c:665:9: error: ‘sig.status’ is used uninitialized in this function [-Werror=uninitialized] drivers/net/wireless/wl3501_cs.c:668:12: error: ‘sig.cap_info’ may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/net/sb1000.c: In function 'sb1000_rx': drivers/net/sb1000.c:775:9: error: 'st[0]' is used uninitialized in this function [-Werror=uninitialized] drivers/net/sb1000.c:776:10: error: 'st[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/net/sb1000.c:784:11: error: 'st[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] I tried to mark the exact input buffer as an output here, but couldn't figure it out. As suggested by Linus, marking all memory as clobbered however is good enough too. For the outs operations, I also add the memory clobber, to force the input to be written to local variables. This is probably already guaranteed by the "asm volatile", but it can't hurt to do this for symmetry. Suggested-by: Linus Torvalds Signed-off-by: Arnd Bergmann Acked-by: Linus Torvalds Cc: Borislav Petkov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tom Lendacky Link: http://lkml.kernel.org/r/20170719125310.2487451-5-arnd@arndb.de Link: https://lkml.org/lkml/2017/7/12/605 Signed-off-by: Ingo Molnar Signed-off-by: Willy Tarreau --- arch/x86/include/asm/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.8.0.rc2.1.gbe9624a diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index d8e8eef..86ec87d 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -296,13 +296,13 @@ static inline unsigned type in##bwl##_p(int port) \ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ { \ asm volatile("rep; outs" #bwl \ - : "+S"(addr), "+c"(count) : "d"(port)); \ + : "+S"(addr), "+c"(count) : "d"(port) : "memory"); \ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ { \ asm volatile("rep; ins" #bwl \ - : "+D"(addr), "+c"(count) : "d"(port)); \ + : "+D"(addr), "+c"(count) : "d"(port) : "memory"); \ } BUILDIO(b, b, char) From patchwork Wed Nov 1 21:26:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willy Tarreau X-Patchwork-Id: 117738 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1259249edm; Wed, 1 Nov 2017 14:40:31 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ThgxIHjcSvWyDeTJM8JVbHxwJFEEs5hhrxKINSsYlTqn5cSKlMHO/gSmQLDRjChFsw5LD8 X-Received: by 10.84.133.163 with SMTP id f32mr939083plf.385.1509572431543; Wed, 01 Nov 2017 14:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509572431; cv=none; d=google.com; s=arc-20160816; b=q+i+lB1wtokxTXylglBOV03jEZHjGzljobXYOkrUpC3+Iv5Md4fCJ4umoiK+XkJHcb BX43K0qYwyeyojaamHefwSoR9LlU5mSHLM4zrTrtWo3GKC4iDgENLS/s89lxpBCbG4It BL/nLaOGrkZyvsrvkhnkSz6+7vv4SMAd3dfGG75kr/QhqqrBZfTSS4y60H28AcM1ol+y cToSueAjprKYztO/ApvahR4SFSl6PcjeS8D4zHOmMXMdvbhbzpPGdxUB32EwawlXjwdB c9cFvpqMSdUOyXIm4TK6DV66qff+liZkf5mtFFnFTf7AWepTPqE/SJODlGldZ81UvP+V AVsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=X/lwWwH8/NkzpPCyrULc8XMuzzJz1iLjq7K4pVWzer0=; b=Mfj3Eqiry1UzjAJ9Y46vMzU/qzdhgRUJn+hwylWzObLzn8Vlh6Q9F4dpE71c8TeUP3 5hLBFpRmHzYoykdVzqo6DybtsP/EOHKiQHztVIPkXrslA8vQQzN/iNddoABlMrtK/1V3 B5FBpuTX4cg2RjHDoep59IZp08GUNbO4Weco+jl6qbwcljc5uZuAAZC71ei2LkG+TvIG FYOyzGToog2BRsjkMrq19Art0/8qTQ+cZoGfWaw+5O4S87MiXl+XfwpjgkC6Y1LTxBrW wR0nfT4uPrR+YEgPGIbcjm+7ehMhrSlcnzXrihh/a5lTSD/VZgZGt0sMh3XR5w/bgPEG EmNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si2025094pgf.4.2017.11.01.14.40.31; Wed, 01 Nov 2017 14:40:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934399AbdKAVk3 (ORCPT + 26 others); Wed, 1 Nov 2017 17:40:29 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35444 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934348AbdKAV3C (ORCPT ); Wed, 1 Nov 2017 17:29:02 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id vA1LQrFI004998; Wed, 1 Nov 2017 22:26:53 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Arnd Bergmann , Hans Verkuil , Mauro Carvalho Chehab , Willy Tarreau Subject: [PATCH 3.10 098/139] [media] pvrusb2: reduce stack usage pvr2_eeprom_analyze() Date: Wed, 1 Nov 2017 22:26:39 +0100 Message-Id: <1509571600-4858-49-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1509571600-4858-1-git-send-email-w@1wt.eu> References: <1509571159-4405-1-git-send-email-w@1wt.eu> <1509571600-4858-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 6830733d53a4517588e56227b9c8538633f0c496 upstream. The driver uses a relatively large data structure on the stack, which showed up on my radar as we get a warning with the "latent entropy" GCC plugin: drivers/media/usb/pvrusb2/pvrusb2-eeprom.c:153:1: error: the frame size of 1376 bytes is larger than 1152 bytes [-Werror=frame-larger-than=] The warning is usually hidden as we raise the warning limit to 2048 when the plugin is enabled, but I'd like to lower that again in the future, and making this function smaller helps to do that without build regressions. Further analysis shows that putting an 'i2c_client' structure on the stack is not really supported, as the embedded 'struct device' is not initialized here, and we are only saved by the fact that the function that is called here does not use the pointer at all. Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18") Signed-off-by: Arnd Bergmann Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Willy Tarreau --- drivers/media/usb/pvrusb2/pvrusb2-eeprom.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) -- 2.8.0.rc2.1.gbe9624a diff --git a/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c b/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c index 9515f3a..122815e 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c @@ -123,15 +123,10 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) memset(&tvdata,0,sizeof(tvdata)); eeprom = pvr2_eeprom_fetch(hdw); - if (!eeprom) return -EINVAL; - - { - struct i2c_client fake_client; - /* Newer version expects a useless client interface */ - fake_client.addr = hdw->eeprom_addr; - fake_client.adapter = &hdw->i2c_adap; - tveeprom_hauppauge_analog(&fake_client,&tvdata,eeprom); - } + if (!eeprom) + return -EINVAL; + + tveeprom_hauppauge_analog(NULL, &tvdata, eeprom); trace_eeprom("eeprom assumed v4l tveeprom module"); trace_eeprom("eeprom direct call results:"); From patchwork Wed Nov 1 21:26:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willy Tarreau X-Patchwork-Id: 117736 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1249758edm; Wed, 1 Nov 2017 14:29:28 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TOmfwjLBur5N+7lfOln2eH7YeseHToruhSrjbWMuIQBiGMzwiKGfWE9CezKy3HAu6Q6IK6 X-Received: by 10.99.42.210 with SMTP id q201mr1166140pgq.7.1509571768638; Wed, 01 Nov 2017 14:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509571768; cv=none; d=google.com; s=arc-20160816; b=zgZSzD5PtSrV1kt+GsDpfXBke6CgCWHmUVVpNmyele8zy76nnJuW5/6F3rVDMPNCHa 5s+EbiucLBEgldb4HR/pIvy/fmgJzzWPcjRriC4W7Ls8hrjxnWH+m9S8Xgvx3ScCSwXk 38EE6g8HQY11RAljxIhmgAvt/qT8IdDHV8N2nxkWH2fHsaFBVyiGRk1BNiX0jiCmudCm 0HqPAEgSb5YxobyipBgvTTJsKYCegfXE7Lr1rHp5Y1yWIN69a3tEluy7NCUixxZdennT BG+pCnlAtd+qYInvUF3hBYkGIy5eCWp8YLIQ0qG0QG3HLYSMTOQpUYBfU89o6SH7FZ2x dDAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=7Z18ny5x/1BvpoLSEuNBEpLQEsvkH3r/utKL8BTPQ6A=; b=YSHvPpdwJQJ7C7AxAEMP/9U5Vcj9FHd1nJk1G9Fr8vsA+zTWcTDER6bFOTrq2lXgBp Y2WwGqIrm3mi0u3B62WUjX5GRbxnlqb1AD7JyVgkhJ0FgAuzZ7iloh52v9c72vnc9XZZ csJR7KSfpIzQhawe+sKJ3liVY0oBnrlxPEDYyZNm5OAUtVALqKwvpBRjhGUOkkbHMe8Y DpjBV/eZymw1WSynl9diIBviGK80yjJsT4mag/pGMD4IJVvGl/aEL2065jX9iwyfW74A /4a4nRBpwHAcjfc15iVFfRinAmansj1rTwDieO/ck2m+LnVm63tWa2oYsm6B1oWUsXo5 1BFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si553638plp.633.2017.11.01.14.29.26; Wed, 01 Nov 2017 14:29:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934466AbdKAV3X (ORCPT + 26 others); Wed, 1 Nov 2017 17:29:23 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:35477 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934411AbdKAV3Q (ORCPT ); Wed, 1 Nov 2017 17:29:16 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id vA1LR9XY005096; Wed, 1 Nov 2017 22:27:09 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Arnd Bergmann , Mauro Carvalho Chehab , Willy Tarreau Subject: [PATCH 3.10 114/139] [media] ir-core: fix gcc-7 warning on bool arithmetic Date: Wed, 1 Nov 2017 22:26:39 +0100 Message-Id: <1509571624-5001-15-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1509571624-5001-1-git-send-email-w@1wt.eu> References: <1509571159-4405-1-git-send-email-w@1wt.eu> <1509571624-5001-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit bd7e31bbade02bc1e92aa00d5cf2cee2da66838a upstream. 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 Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Willy Tarreau --- drivers/media/rc/imon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.8.0.rc2.1.gbe9624a diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 72e3fa6..257bb7a 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1530,7 +1530,7 @@ static void imon_incoming_packet(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);