From patchwork Fri Jul 14 09:25:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107744 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp649192qge; Fri, 14 Jul 2017 02:27:41 -0700 (PDT) X-Received: by 10.84.224.75 with SMTP id a11mr15212988plt.286.1500024461166; Fri, 14 Jul 2017 02:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024461; cv=none; d=google.com; s=arc-20160816; b=Ljqsts7i+CoadsoPyxkcXUYajXoaFlDrYGC7fLSHFpx6gMuOh64eSZzmXp4gKuKQb/ UDd/u2DHuPDiEd3qMxfstJaZDxzuorbyYelgFyJCc1gPpAUTamBfu0LwmguWJL2fNHyk 0xwtPyW5zYuNmYcvl7W3f0l3TsGfUV8o3FRD35bA1Ur4dN/qqLCfJQQy58J5yoZvSrHW ABce5Yc+fjhW55v55lV4yJ+S8MoLOk6+a1prYa9jsK8DAzdvW9fRaTer7P8BnxRUKbFP MAWOfUyB//x4I5AbwAZ6pp41gy/xNBvfH5cWDBllgcHe2CKUojsUA40wG6vtaniznegY Ny/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=k4/Ppz+ySwh6K9zbDlswz9sJvDNgUo7tnnM+bGnTTZo=; b=zsha3D8NcyYFaIvEJGvBiU9HTN6QcSskA5BacatGsd4j4wz+3+sRiKRAKDeISUoj6N HA8umAd8eOmMimJKXNvjJkFSwnAROM+s4ojgayry5X6VY9VOOAvT+eon3Qdf19XkK5z3 7r0GDausyyhvcH5nasKPVFEM1YUu27EoYCuWaQgnlT+2FlGAjNtoIzZnLhwtjPpGf4zH sCO1WvfiEYbkLAVSrr+HY97sOS9Uhpf1X35B/8P3x0o5JZVlPmMClhqFkMvVmBB8GgDO CPku9gSVHfxI/MpD/+Xz491YpaDH9X+94jkTzxgwazdyrsm7unrH8E4UoNDf25860kKm rRRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f10si6190658pgu.453.2017.07.14.02.27.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:27:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 616D46E7B0; Fri, 14 Jul 2017 09:27:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 991B86E7B0 for ; Fri, 14 Jul 2017 09:27:08 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LtUuK-1dfoGk3GRo-010tQe; Fri, 14 Jul 2017 11:26:18 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, "David S. Miller" Subject: [PATCH, RESEND 01/14] ide: avoid warning for timings calculation Date: Fri, 14 Jul 2017 11:25:13 +0200 Message-Id: <20170714092540.1217397-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:2t/MNlSFGgbXQUQnxUrYx6kN+F2j5AlqnzmeEoew3N0LSwI8WkM v7KosatX+TePKQELje/JPUZ3da9xavNr8X7LtnUdswWP/3Yi86zfp+wLG7ptlAGY5b5rMDe WPWuc1NrYWRhrx1cqmDHLKCSJJo+sPhInedizMI69sISwGti+FwzwGlz7gKyflA0jRsvznw uIutTC6HCN+FnOagF+A2g== X-UI-Out-Filterresults: notjunk:1; V01:K0:7lygw3z5amo=:gCNM/t0iNs6e7h+bskfPsA CHTUpukmvK/I3O8AA62qVtjFjLY6FZ5AjhH/oE9Yth2Yob7JAKlsSh1PdHa1TFRmnVnBNaBtv nc0t3n1vYsRtKlycBfPNXPCIm2JnbNlwGeMRYUlyoIQ3ERwa98VJSqQ2EmMdoy/ao1eZ9T+C4 TV1BDa3++OXOGogMDrwpFaNEwq0zffPysJ2plP0xYnbJCs2dd+xz4Boz20SLi00Hr8nK7S5e8 cyY/MKF/txWXRehw5rgHZYP2YMtgdjLKVyVlzAUHTlDSTDrQMhnfszfdC729woxQEFvRrwcyS T4zja3kwZ37GS3MmQb4NvK1/WgxNZ2nHmAwz81y3+YMq7T9NHTFOPiGRLttiYedhsV1hTb0CI tguegN4B9QYL0mrpfVw8MzQro7N/8ss+j5LzxBR3URWzWtGcXhtyPGq8rjNJSsD7bE6qcsn5P EUDL0T/kt5phYlVRM6NztFO+ycRU9XD0IAgXHOSLwn6ypi9b+lCfD2fuw8E5g7iXYNPY024Gv BtwhKfP3/N36WM+cHl44QE6YGhIvwY25tJGL1/luOsfbRL98kPP8Kt1NQv6szKCfYI+QjNBAe k5hOQUYjsigoxq0LTmcMFDOVRDrV5PddzFaR82a1116PLKIg1v5EWGwJEka9CD8pl3MTHUKMA 88b6l+3W/gh0XekF90Zdcg/GsGkHCIqEl/MTlG773Av7s/w3DquVYITBCgoQ6W3JJcxBO1PU8 ouKi6MIQNtTyTBZZdar5KUjH5QlzDuNp/JgZPw== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc-7 warns about the result of a constant multiplication used as a boolean: drivers/ide/ide-timings.c: In function 'ide_timing_quantize': drivers/ide/ide-timings.c:112:24: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] q->setup = EZ(t->setup * 1000, T); This slightly rearranges the macro to simplify the code and avoid the warning at the same time. Signed-off-by: Arnd Bergmann --- drivers/ide/ide-timings.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/ide/ide-timings.c b/drivers/ide/ide-timings.c index 0e05f75934c9..1858e3ce3993 100644 --- a/drivers/ide/ide-timings.c +++ b/drivers/ide/ide-timings.c @@ -104,19 +104,19 @@ u16 ide_pio_cycle_time(ide_drive_t *drive, u8 pio) EXPORT_SYMBOL_GPL(ide_pio_cycle_time); #define ENOUGH(v, unit) (((v) - 1) / (unit) + 1) -#define EZ(v, unit) ((v) ? ENOUGH(v, unit) : 0) +#define EZ(v, unit) ((v) ? ENOUGH((v) * 1000, unit) : 0) static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT) { - q->setup = EZ(t->setup * 1000, T); - q->act8b = EZ(t->act8b * 1000, T); - q->rec8b = EZ(t->rec8b * 1000, T); - q->cyc8b = EZ(t->cyc8b * 1000, T); - q->active = EZ(t->active * 1000, T); - q->recover = EZ(t->recover * 1000, T); - q->cycle = EZ(t->cycle * 1000, T); - q->udma = EZ(t->udma * 1000, UT); + q->setup = EZ(t->setup, T); + q->act8b = EZ(t->act8b, T); + q->rec8b = EZ(t->rec8b, T); + q->cyc8b = EZ(t->cyc8b, T); + q->active = EZ(t->active, T); + q->recover = EZ(t->recover, T); + q->cycle = EZ(t->cycle, T); + q->udma = EZ(t->udma, UT); } void ide_timing_merge(struct ide_timing *a, struct ide_timing *b, From patchwork Fri Jul 14 09:25:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107745 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp649360qge; Fri, 14 Jul 2017 02:27:53 -0700 (PDT) X-Received: by 10.84.130.108 with SMTP id 99mr14642800plc.76.1500024473047; Fri, 14 Jul 2017 02:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024473; cv=none; d=google.com; s=arc-20160816; b=wkDBr5tdlacH5f2fsdz6FdkVZU8y181B62zoAiKvYm1SaYzEUi+OwKcaef6z+lG5ex l4UMU/+k0MLAq1yShH1xFTpicOgkLsW7b3EbLe6AHnhm3MgREJbi+CvENS2lh3kCitFC YpudannKQNcJdp/ocF5tZIQyrWsZkL3VsOCfY4QxQiyUZ6UVW5vJXEdGVtaMfKBYFFsU JFdtfwk+cyrty5FBN726XEkgS7qETUq4HycSNPxfBPEPnkAuTUGGt7XnjZlBHilct7Wp 7OiQYVR8m8oYQ+c2WeEus+Bq3JEQwPvxV1ztI0CHozXCXrJLgDR05ONajujfCzmf/xi/ rz9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=P11rqWpzQbNd+ALCaqzAj9gPiqvMaAspA8e/mn0rmfA=; b=OS8/VVBb2xI3yX5e8JUJG5QIqWY+Wj0fg9WjNOmdMXeZuWkKIAKDaWPIxKXS7mg+dX KfQiKWEOMjljE2e/6q9gMMVmVpXkPsd6jCeeV5HDcO/RJYbFDCXz0wqFGnJ6Gye95pmg debpftbYCH5rjXY3LDAc/drvlsrOkYek7+4nkD/2JLKNeVjoL0KSRr3aGudLbitD86WW hFI7gLG5zi0VlhtjAgWTEohKzorc39dr6Smq9vL7QE8YZeNJaOEQld+h/ht55JUyuF2C HClC/t4Lq501x9YPRpxfQaHk6ty1narNooxwz9dXUwSnAbbWRoe5LRlPahGT7mmjGfKq V4AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p24si6470160pli.267.2017.07.14.02.27.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:27:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 878336E7AF; Fri, 14 Jul 2017 09:27:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F50C6E7B2 for ; Fri, 14 Jul 2017 09:27:19 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LhTpQ-1e0f3s2nOi-00meKy; Fri, 14 Jul 2017 11:26:28 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Tejun Heo Subject: [PATCH, RESEND 02/14] ata: avoid gcc-7 warning in ata_timing_quantize Date: Fri, 14 Jul 2017 11:25:14 +0200 Message-Id: <20170714092540.1217397-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:OlUIYmocaf2jkkax68/a7FO2BzKYdJ0d5XpbOiMsvCA84hRqA4u HJ4K+wmOhC5pskP7nMwyMZ8mhOqnLFVoGzaZ5ZuWLWrqpykhEV46/mF94UYy5tSgdmjHgKV d96O2+T66a8IZvqrmzT+OXHu7N9t5j40129ZmMVuHmp+TBu+KEMNRG0gl7Bl775X6vJO7dA dY2g8xRruu0p1bG4qCOhQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:I+rkV/wPpVI=:w0jWgEOCVJ4ZJYpbOun5Rs DBgYhcsyjFaMSwoBpf0r+t320CqbE288k/xJh5AcQakyE3c3ip8gLYAqrfdCcoYnHRiEPSGzp f9cF9XnnK5CXszyHXfAQYqnoNa+pGA8xt+Hq+xauHbggiA6m9a1shwc/2zpiMxDTrwA6n+/aN wc0KgBuVWtkg7kyYxDPJrx0tzZcLm3rE2jF8POPbe/6oDwBhPONOgnX03VIHwsMhFQVn+t0tS RU2cnTyLC18+p/EXrBCH6V6VMv+k9V3Ioqt8ZICol8bf6FjnTHt0ouNHCdNy9mfI5prHIP0jB XHrBbYAVLFXWUhJW3sOSnV8u1J518yS5aDs30aGZqux8Iw5ViIGE60AlaW8gK/Y+Xv5s02KZZ AhnKKYkudksN2rLE9PVuqfNFa1OtgX7x+4vAFkqbxsnxGXlkYIFrW6+XZotwT2o3ZlmMEKZwv /ChZNE3opIq+jT6lpfwJ7AG5PcAet1/51eIqQWQStjbl+Y3SmgrB/VNgvXx1AHG/+kNbra6PC esJ9ODhwSXDbBvWBVOXFJUXb3ymol577jhMTCqfCAV/alEAo8G9NZZwyfgJrkmiPIcHZmRIM3 Ahz8jHTnI/tRdaAGUw+shHajouhEJeUCYARdSBTL3kfToog/UTMZlbmGo4wgWZprV27vvYSp/ s6gobIaRuMXJbPdusK0OCn7dUU1/fF9SCdHkhrnRmSzn+1X33Cue7Mk3ByLp+8ug6UZJvwgTk mH6H+ghm6RNpXo+dIRU2/d8xPWB7DJ93jHmfpA== Cc: Damien Le Moal , Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Geert Uytterhoeven , Hannes Reinecke , Adam Manzanares , akpm@linux-foundation.org, Mauro Carvalho Chehab , Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc-7 warns about the result of a constant multiplication used as a boolean: drivers/ata/libata-core.c: In function 'ata_timing_quantize': drivers/ata/libata-core.c:3164:30: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context] This slightly rearranges the macro to simplify the code and avoid the warning at the same time. Signed-off-by: Arnd Bergmann --- drivers/ata/libata-core.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index fa7dd4394c02..450059dd06ba 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3231,19 +3231,19 @@ static const struct ata_timing ata_timing[] = { }; #define ENOUGH(v, unit) (((v)-1)/(unit)+1) -#define EZ(v, unit) ((v)?ENOUGH(v, unit):0) +#define EZ(v, unit) ((v)?ENOUGH(((v) * 1000), unit):0) static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) { - q->setup = EZ(t->setup * 1000, T); - q->act8b = EZ(t->act8b * 1000, T); - q->rec8b = EZ(t->rec8b * 1000, T); - q->cyc8b = EZ(t->cyc8b * 1000, T); - q->active = EZ(t->active * 1000, T); - q->recover = EZ(t->recover * 1000, T); - q->dmack_hold = EZ(t->dmack_hold * 1000, T); - q->cycle = EZ(t->cycle * 1000, T); - q->udma = EZ(t->udma * 1000, UT); + q->setup = EZ(t->setup, T); + q->act8b = EZ(t->act8b, T); + q->rec8b = EZ(t->rec8b, T); + q->cyc8b = EZ(t->cyc8b, T); + q->active = EZ(t->active, T); + q->recover = EZ(t->recover, T); + q->dmack_hold = EZ(t->dmack_hold, T); + q->cycle = EZ(t->cycle, T); + q->udma = EZ(t->udma, UT); } void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, From patchwork Fri Jul 14 09:25:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107743 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp649186qge; Fri, 14 Jul 2017 02:27:40 -0700 (PDT) X-Received: by 10.98.193.197 with SMTP id i188mr4159599pfg.215.1500024460745; Fri, 14 Jul 2017 02:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024460; cv=none; d=google.com; s=arc-20160816; b=SxwFUm0vfNlutE8F3FBhjVDshu1ccRkgQtu/w6GIFX1DGMrjzr3Tetxmba5eSI6eZF coBtZxEuJ0g6EacKXOwbEUr2PcBqROzJ/apA1QRx3MNl8NlIh0i6mzd0JbbSasVB33df 16sm6Fp1tvEzJ0DTeXzXgpxGRDkOBYt9PwDvgVknMxc2n9Y2gMzZmJ343oPpnUW4/lqf wutlFcs/x9KLkT6RNwj4n7yibOwsDDtwOYP/W1N1cjWvQp/9g6EYe2aEbeM4/UxqlaHI n0vQV4kVy+P6vQiy3tjlcOWR1D82MSWoBk5Jq0EO94A/RMcYp+xLJIXaA79mhHIygVB9 jSmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=clu+2gQv3f3ia9qIFfaYA7ah12jQ34gf9PEuGQUfxto=; b=E5+eTlSazk9Tp5sdZTdqKayWpgeFwdgLKGZPBMwDjxgxCUvF2zLheLzbTzJXF4itgv +urwDUfTKKF9BMlXBvDehauBt/NjflVM6xTFhq4ltY4qQvGlwcLJcRmu56fGSh4dR2uf 01dFcLG9dBD6ZwW7QDWl2K6PT6VBj/uJSpNiMvcSSBch04G0sOqn+bBhbxPH9CflkyDp 1VRsllNEvUAC91i1OwoUP4FPKZvu0NZQBhauT+L7JX3J/F4h4Xz3oyPxo7mQiY2eiYHS 0s6H223HE3XMhFFoqnMJDvGXjVnLYgPWyILPEgKh5u+eGsO8AoX9Ofj6nsW1dkc9RNDA hMHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 1si6225923pgm.406.2017.07.14.02.27.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:27:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5FB86E7B7; Fri, 14 Jul 2017 09:27:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EC246E7B7 for ; Fri, 14 Jul 2017 09:27:37 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LqFFo-1e9QU502AS-00dodI; Fri, 14 Jul 2017 11:26:49 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, VMware Graphics , Sinclair Yeh , Thomas Hellstrom , David Airlie Subject: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning Date: Fri, 14 Jul 2017 11:25:15 +0200 Message-Id: <20170714092540.1217397-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:ak6ADH+6EZDPsYMUUuDcxzct0lASSGv/e7NEU13ahmMkPtIlLBs veuGwmStCqPepvdmxVRdOoOLDpHXWv2tQUPbuDCLJSEgI5aB8Tx5XrfMk29SSWTnsGeN3sn eWhwKUmLDnCTfJ0N67O8WEUKtxLm9v9OJuV52bBWX7+xaGvemFDbNYmZw2C+xeYNQ167a98 1hYDxa7E7y0O6tMlzyckQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:h0UAhwwZh70=:CXpqXEf7h0UOiFz+ZjnrsC 8v7qx4eyJfpgoRqEQXKxp1PjyPM7Jbxk0gt3jw9ZFDVxJssxDHZUOJrZXJbtxVq5GGEwI0/YE xVqbeDLUNpeq67tbK9c9x70R/1u2llL0Visx0cd8jGSEQadSbNlKDwSA8iqdGiYeHzZH9/BNn gD88hl0oAR6E15cVHN0U/oTtYknVzZboTcUUj0lhOUZ0Gw4TkfSSLA8ulJ9lob5SL2lsrpDPr Ry+vm8BjWpr8VdbbXrew28Fmnjs8vAdWfg+5aihQQM7IB4inH1jQ2FJj5NJa82QQKMj50ylYk ukHR9dFdDF0jIWMeui4BMwEDRCR/nAHvxw6YhEqsQ2yTQu/91nBBMHt3DOnqn+/AbbnNRdhzh tCXLCeuHbUem3jKpQpYmtpASXVi/M4db/8K+8j+DVtWwp0bvLU87HlQSGO/ql1Z9IWVoi2QZJ pnQem3i7Iv2vBieybUT/wzKpMojHjKhi8Dyr7TWmjmOMYgQEw5Y3m6TppA0Ve0xNwdPdFesth JGXSY6ve6lnAwopRyRbQ7uX4VyTK3N353/CF4Vd+1z6OwM/bLk6HrvWQcoqnRd+Y1k/q5dRYZ AZXZl3HxWXQR0p/dFwndjR4zBexPuNTf3WiCRgU+bb0XKSX547JR/ux+wltqcmL7eGKj+r6rH CqIy0tsOdDOkK77mQBDnMb3HSNQvFV0RHywvYQEO9UvkGe9zZBInvZD6uKMHQOreNl6MzfRO6 up8H13tBmkXnWDz2GUEpwnXWxKyGnXlpZAZl6g== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Brian Paul , Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc-7 warns about slightly suspicious code in vmw_cmd_invalid: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_invalid': drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:23: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] The problem is that it is mixing boolean and integer values here. I assume that the code actually works correctly, so making it use a literal '1' instead of the implied 'true' makes it more readable and avoids the warning. The code has been in this file since the start, but it could make sense to backport this patch to stable to make it build cleanly with gcc-7. Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Reviewed-by: Sinclair Yeh Signed-off-by: Arnd Bergmann --- Originally submitted on Nov 16, but for some reason it never appeared upstream. The patch is still needed as of v4.11-rc2 --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index c7b53d987f06..3f343e55972a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv, struct vmw_sw_context *sw_context, SVGA3dCmdHeader *header) { - return capable(CAP_SYS_ADMIN) ? : -EINVAL; + return capable(CAP_SYS_ADMIN) ? 1 : -EINVAL; } static int vmw_cmd_ok(struct vmw_private *dev_priv, From patchwork Fri Jul 14 09:25:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107747 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650343qge; Fri, 14 Jul 2017 02:29:02 -0700 (PDT) X-Received: by 10.98.2.149 with SMTP id 143mr4314511pfc.52.1500024542405; Fri, 14 Jul 2017 02:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024542; cv=none; d=google.com; s=arc-20160816; b=hXz3nk9Affj5jPp9I84y3PU28Kt/PMCnQxtW5EfLN6G3pedpvIRVitFHv3G0ghHh7Y bUJqlCzQn/GvYO66k4sPDTWHgNxmnL8O0w8Rd1mO1RJVCj4AQQGaXfrKWTfRz0/ZQJKO fRpv31EtNU7mdHxvJVoIgltKAtoPJlk0YNRUE+et5chy7cVAWnbOC1eUOsogawHEY5Pm Nw7nyVwZX3v3afo7eTZLV7ZRFsducwLToZpnuSU8ZcHyercv1pI1ilp1YC+kJzN7GVcn 2dkJaQDDBM0JpP4AeYnDTW/Y419TW8lWBxtSp2j6ZyDKXROqslb59Y5s+7BprROGLAgX FN5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=W3qvNZ4voyT5M3fO+hzWpnvEJF+SaktPgqiHS9rl6yc=; b=nOFTeBd//iHLFqGmkB53+LsvJiriBGZEcgv9rAKeL2qHYLkQX716NJeVVUNig3AL6z z83A12+bkEdRtn7kJQMQaMc55uYpgGh9fgQsjue+VO0XJEWxNMO98WgNEhCJ7Qu9bwm+ 8+7fnf93g/SRU/3dMXQ15KCGib0WgxA1SK9lG4fQCLzxN0Lr+3ckUrcrVw3zvQZi1iS2 3Lm+ttHBm8sFnQdSMzzgSlq8OglhX7Xt/W90UPtSji3/82Fmwn8YzDLPTm0smJZwZ8jx IdYQu+h+PRzEhrHFy8tqHc2td7tHMN4iZ96+28Vca7eQk1V7MF8vKId2ND983d0MAEXx ceTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id v68si6063214pgb.502.2017.07.14.02.29.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:29:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AE1F6E7AE; Fri, 14 Jul 2017 09:29:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id D85066E7AC for ; Fri, 14 Jul 2017 09:28:59 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LoaZ0-1e7lXR2K9i-00gYj0; Fri, 14 Jul 2017 11:27:03 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Bill Metzenthen , x86@kernel.org Subject: [PATCH 04/14] x86: math-emu: avoid -Wint-in-bool-context warning Date: Fri, 14 Jul 2017 11:25:16 +0200 Message-Id: <20170714092540.1217397-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:Hh4ufQSHMIAol5nU82ELwxeaOTiTOZdWK3V5NC+WN4sbgugBUEi JdNUnF4eXaFCJRBP5Dad06DR951m2MJevWDoTPy+BBdfHkmSNoflFsplp3H3onCWdd0X+XW 20REG5g4n6VKenJshGIkaVfVQr8AZvvvAkMYfDsU78TO1SNeA1ToRj5EmwH4pfAHjCg/qXA KFKVhp2I2zJxp7cSpxn5A== X-UI-Out-Filterresults: notjunk:1; V01:K0:i8zEyOqgHHw=:WTVBsUHlVu/w1NjwRyOGR5 l1QfMaOhFfUjxc0FoVX72MZozqg3688WhVV8Jv2sQBjBUuI7s0QxTuIh1vCjaOkVdfdy69rON fWotLDbMr/OUzpLBwZ86TXRAqE5de4r8jr2p4AqBgvEYJ00AqpS4iHvMN+XUnFbl1dtz/WXir zzMEeLGabtxi/0B2F5GXxpelcqimbEToaXQA3coAIx7klN6PL4PJdgtkIed8CKU1KDiXHngwG T+mmSFlrMsKiViQmhXQNA+3y8G2CjlDpmgc/IAB+CAceTMx4g6SxyrVDLOuEBk/tOsPPiKpUg aXgmDc7tHfBbEtE9nqnNBhCGCva04mXJLdtYpjpta0HAS2xbUImR76LT9iAV2m0TDRrBNFjei k3at77g22UuSsYT6v5Jbv/5y5Dbp7MvXnCzKXkogU8EsTP4z96dXDfhBOaxsFC8a8kUctZgT2 VU45Zzp+KISusS1hDndx9l9nEYmzo6vp9V5KUsPthj5Zj1HVQGRXHZXujJbbO9w09FbRE45Ng eJl/4rkIuc0youi65u6Ps3LrhSe7QJyjJ8P1bQ6yJzHJx0PAmvPA8nl2eo7jBUfFBlmwsFi+U /WLDctSssYk3ER++ZJPo8BauJCku1oGI2jbQ/YmoZ6KAg89bNwpubkapXvfab4c8ImUPhwiFQ YSe9J1jKeggLnVOX0sRkm1A3zmBv++bDnO9yL2+PZ1+JKINkVFt4EebpUz4yddpe0naTZ5oe9 0+dM1odsy/CYYStRXFL87/dBWAfUfM2eN5Lq4A== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Thomas Gleixner , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The setsign() macro gets called with an integer argument in a few places, leading to a harmless warning in gcc-7: arch/x86/math-emu/reg_add_sub.c: In function 'FPU_add': arch/x86/math-emu/reg_add_sub.c:80:48: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] This turns the integer into a boolean expression by comparing it to zero. Signed-off-by: Arnd Bergmann --- arch/x86/math-emu/fpu_emu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h index afbc4d805d66..c9c320dccca1 100644 --- a/arch/x86/math-emu/fpu_emu.h +++ b/arch/x86/math-emu/fpu_emu.h @@ -157,7 +157,7 @@ extern u_char const data_sizes_16[32]; #define signbyte(a) (((u_char *)(a))[9]) #define getsign(a) (signbyte(a) & 0x80) -#define setsign(a,b) { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } +#define setsign(a,b) { if ((b) != 0) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; } #define copysign(a,b) { if (getsign(a)) signbyte(b) |= 0x80; \ else signbyte(b) &= 0x7f; } #define changesign(a) { signbyte(a) ^= 0x80; } From patchwork Fri Jul 14 09:25:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107746 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650238qge; Fri, 14 Jul 2017 02:28:55 -0700 (PDT) X-Received: by 10.84.214.143 with SMTP id j15mr14837760pli.40.1500024535599; Fri, 14 Jul 2017 02:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024535; cv=none; d=google.com; s=arc-20160816; b=yGQ06KGB7NG13tXH1wljspNP2IfkHASWrds9zE2+JCskPjYu3eAGFsntDoCeeuNCH3 50de+mciVxajtvB4ACpI0HmfmUUlmYT2k1qlTVrL81JtkNquZ8+WqmflhWS9uJHSvGIL y2oWPNPQBSptSu3luFJ9UxE8J8GCSEwae3JyQpi9xxCN98uCqS62JKQlcNoKngEAhc8b IecyOC5IkVQdAdx4EsezRy+ORqyR3PU1SVicJc5UbkNfA6ojm+iAIVhT/C7I6ThCqsP3 rLgtzGQUt08b3F7mOnANarEXcDwTyflM+b/1RcXyRe+ih0u1ykWvsJFBlNxRkUz6ll3/ RKkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=fk35XQpqAyJlFkyST6K/3I6wt7b5pZaN/Eg9yGQbAp8=; b=OPpYcY+L0Ku+tN9eIH3fTsa6+iFaAjG24FH0PRXRmEmvrIT0lep1xgS3N1f0Wo15eI TVRGR7bdqiwoVwDasyCBkqzVt08Pq/7V6T1gbqpUlWu2qEaJobVWW1d+XeqqyfAm7w/4 ZyMCfJqA992nPDFb+AY6qFUkJwXUJFMWEJ8cw450eu7hqvYKbU4yrk0D7X7bQ1QkZaeJ RLVoh2wXG/A1r8Aa+HkIXOfdnn83wrHZK8jdv8+mnW5m9UEjz78G0JiZ2PJ3EvgFik3g xiJnxzrGtjHuiiJAsa54v0TIJnONDcYjHtOcuySaTlAlW95PGTBm2Ng1Re3/clPan4a9 rEmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id s28si6166849pgn.507.2017.07.14.02.28.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:28:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A87396E7B1; Fri, 14 Jul 2017 09:28:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60F3D6E7B1 for ; Fri, 14 Jul 2017 09:28:22 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MRzqc-1d3zeD3U8Q-00TCqE; Fri, 14 Jul 2017 11:27:32 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Karsten Keil , "David S. Miller" Subject: [PATCH 05/14] isdn: isdnloop: suppress a gcc-7 warning Date: Fri, 14 Jul 2017 11:25:17 +0200 Message-Id: <20170714092540.1217397-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:kQ2HP+eDMo4feZc2ZQxKsN1rGNrWrVywsltxi69wh6XVf7Ptvo9 GRBAgqT76nnApM/fjDINNk4evyOHMlVJ9FcvjBrfJfoemvipVMt3Tt/k+7sZ4xIl6wjqW8S euGW0k+puT7PMbs7qFqUxA5skkN28wHuB34OE9E5wMUHe1Xzs6RVzFdY+rBJoU+YFBWMsKp 4IgWCqsDitGE1WtVLDfdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:f/HCPSxtnAg=:G/8IX5vkCqEu6v4TM2iJKA VG1yllc+fhE6bhtMjSMkK33jWN7ZGApFFJXuB5pXYdPvbgtbX2r0G1Ud56m60sL2rIMRaOAud rEtvui0no1hq+P4a5MrEkoklVSKj+RRqRw0dDqQmnT7bgtcvq5AcoucV9crBpeUlyRri2axE0 EqbiC6vc941DvvRtUzdS1r6NiSb5ECOpkQjp7MnHZvZPweiFhOJwOx69/82k8abDoYlCvMBN3 XbkhtVDzxaxmcCJxCalG/Q35uS0M1OYAVsNeMlmEmhNL2cBB9zUfHDdE8WNlJ4Ca2ogrnUxoM RUNZpTUlXjOgGpY2xyaHNkC1m53L5368+qJH7xU/YACIAGtIYd7CndfOpfQPhSywf8OBRNMlU qQFKuSL6mj6suHjvywuHwNh2VXus2x9Eh2JwPHkCYvdNxZgx72jH+6tUZJdYRmTCBgoQ0MeBw vP/YC4CZbgfka7gx/HHXz/fF9MHUK50ytcRFh73fd9tzNlde5AwY2ac7QRgjdEPs5emEv8CIX jSpVT8LaIgGimdplJPflMyc9kFV5h0OU6IbGOoI1gjRP/yYPLMt/q4mdb3PI44i/UyXojCc06 ZXu35S1095aPl64HPvkaLNu4IQ6DwInuHn0h95ad7Y04pMjWB6gCBEi4Qvv9LNAaxPkQXu3tg AHUSUfwqN5aductwnV0OYdGu+AbCfbR7bzF4YIO8LCmjQ8XUbaPE7Qxhlrb4GNV/DAPP5eCfj 9NswvNs+Zz6vLsSoqjyrlNFHBTy9cu85lqeVTw== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We test whether a bit is set in a mask here, which is correct but gcc warns about it as it thinks it might be confusing: drivers/isdn/isdnloop/isdnloop.c:412:37: error: ?: using integer constants in boolean context, the expression will always evaluate to 'true' [-Werror=int-in-bool-context] This replaces the negation of an integer with an equivalent comparison to zero, which gets rid of the warning. Signed-off-by: Arnd Bergmann --- drivers/isdn/isdnloop/isdnloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index 6ffd13466b8c..5792928b944d 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c @@ -409,7 +409,7 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card *card) return -EINVAL; } if (len) { - if (!(card->flags & (channel) ? ISDNLOOP_FLAGS_B2ACTIVE : ISDNLOOP_FLAGS_B1ACTIVE)) + if ((card->flags & (channel) ? ISDNLOOP_FLAGS_B2ACTIVE : ISDNLOOP_FLAGS_B1ACTIVE) == 0) return 0; if (card->sndcount[channel] > ISDNLOOP_MAX_SQUEUE) return 0; From patchwork Fri Jul 14 09:25:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107748 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650510qge; Fri, 14 Jul 2017 02:29:13 -0700 (PDT) X-Received: by 10.98.50.133 with SMTP id y127mr4092122pfy.242.1500024553584; Fri, 14 Jul 2017 02:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024553; cv=none; d=google.com; s=arc-20160816; b=SDZUGM23CRD0qGyLSqwPPN6p7vw6htxm3uwcJAZlPDKUGta7CLycm6WgKDrXqXvX0d R+uNtCqq4+RCr6hlvXz9X5PCtucsh/3GszG84jKSuxgqtJeMslUlf1ew54lXTrRbIBe6 /ye4v20vrRtDR1nLKnxmlfIqavfo1FgiTuOOk6VrTIXuZHpXIu1E/NRAsiqiRxsADMaA U/xiyFGd+jip1u8RcJMiI5kLLqIXdaORHvwJhpgAqT98OhXFa+Mc/7w5m3dfdX5udRWb 3zRu6KK9Wp52cpiMk/QAEmLQJHLScWk+Z5uR8Ub+WgktTSGWeTTz2FKBSFyoZ+JJR0wG jiOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to:arc-authentication-results; bh=7LvrKEy8FI142EtlSCPsA2YUN0mmWuVM+HfEB8PKaHk=; b=dtV68CJhE8k4E4hzp7MqRNSE1hS7sp+isS99uR6o3LKsdEwwTQ5YBhhYTZPm6oXYID nCwXHQsSmwWLUygjIqHlaZLVhYBjcVrhkRBmXhgZcFo5Ge607FmuetaRNYWjxtpW4l2+ EmSQVU0Ed6l1m+oRCO0Ya8aatoC946P6/RriKm7VkAnextiFIZwpZPWQrZBEW8hj0SeI URVwI0o5WlNvNCFIQl+mgCB6sAmUYl1hyHVntqc4uvPqhJspz/NCLwx2fnYqD79PE+Rz UVKOOxLjLtGQBw60regvt+utx1RoyCRPoOL6pSWX57SCLirWV4oZ95VIAfdBsl1KZie6 5psQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g9si6242095pli.273.2017.07.14.02.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:29:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D11D6E7B4; Fri, 14 Jul 2017 09:28:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC4C36E7B4 for ; Fri, 14 Jul 2017 09:28:40 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lgf13-1e223G06q5-00o1Nh; Fri, 14 Jul 2017 11:27:51 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Zhang Rui , "Rafael J. Wysocki" , Len Brown Subject: [PATCH 06/14] acpi: thermal: fix gcc-6/ccache warning Date: Fri, 14 Jul 2017 11:25:18 +0200 Message-Id: <20170714092540.1217397-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:oLTxUFhJg+VpbKIAYXvQENDPaLYl28tWm2koJg4I7Gb4Qk+oqZo ElUthycY6JdW2rY7kQQM/QqmNx2HkeC6Fqlsn8JoFDbdj6TjdEJTWcI6Z6b0zgpV8SwdCk6 LnZSXzgJ2iXeMkjcr7T7GDBRh7MXIGNZgoITe9O7sWz9UQAenJIdAiMZ0K8Fe+1Z2TasoUL nvVLDFX/wu/hRHkaZlz+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:IE8SrzcsA9g=:nMnJz36TnzEezbEerEA9AV EBU115JxM9ytGlcIi3F68Dho0HMGJadkdwwSHrB65iFp2OWP6nBy2zfcoQojXgCXggYVgEY4M 6X+B53ezCFkkUr5NWU+Kvxm/h16dXIHqjNe7zAbCxqynEHE9ciFGFiQGwRp+6VD0SHKQMsDEI LnHY50XU7tNxUK+WCNQhZMQQb/i6xdfKWBf+bJy8plejJl79uWr29Mmxb93OAOLmZkbpOlSUG WbDi6obDxOSWDn5zUHyBI0YXTrB8LCN4cJ/wsugKdINPthJHdY3OesblC6B++1lq8i1ZZnzeM 8ph/Ua5w6EIhnWm9FcgVaSPjX1a+sgjRnRS3f08gdwssRveE87mMsI4dVK8cOb/nX2XcBvlPJ BtF8ox0gvhmgxk/4WoWYMmkHAAdiSX4+LuYwQ06tQeQoYHnLtqn//Q+rUAr9o2gjiQZ66sGY2 ThYASUsGfWBBia1O1IRolPkyLZ6UQHzAh/JthMML+BriraQ/3tIgagjFqYmdZKOg/WTMv/xwX 0gcIfsIrkSkpOGU9CfElNaeb+meAYgsiKXwx6XgZuQ4YrhZXTavPnB2Q4/tsAOCXRYto5GwKX e2L3KnF0vOzg++NqZZCKCVwzxVOJbr6KLxd7/x3VcYn00zhVna9NY5g1KK6Mozb4VWmttVUrj ZaVImcy/9/jF1XI0FX8E2DDCoPfaix3ZIzQUJ3L7pDcdp9dqxFOYaALE5TlYVWg2Tue298pxF tMK9tVKYA8ur6dph7sb7lBR6m1W4tj0Lx0YxL3onvh+ogWPtbMPBwcr3Up0= Cc: Arnd Bergmann , linux-acpi@vger.kernel.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In some configurations, topology_physical_package_id() is trivially defined as '-1' for any input, resulting a comparison that is always true: drivers/acpi/processor_thermal.c: In function ‘cpufreq_set_cur_state’: drivers/acpi/processor_thermal.c:137:36: error: self-comparison always evaluates to true [-Werror=tautological-compare] By introducing a temporary variable, we can tell gcc that this is intentional. Signed-off-by: Arnd Bergmann --- drivers/acpi/processor_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 59c3a5d1e600..411f3a7f4a7c 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c @@ -122,20 +122,22 @@ static int cpufreq_get_cur_state(unsigned int cpu) static int cpufreq_set_cur_state(unsigned int cpu, int state) { int i; + int id; if (!cpu_has_cpufreq(cpu)) return 0; reduction_pctg(cpu) = state; + id = topology_physical_package_id(cpu); + /* * Update all the CPUs in the same package because they all * contribute to the temperature and often share the same * frequency. */ for_each_online_cpu(i) { - if (topology_physical_package_id(i) == - topology_physical_package_id(cpu)) + if (topology_physical_package_id(i) == id) cpufreq_update_policy(i); } return 0; From patchwork Fri Jul 14 09:25:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107749 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650549qge; Fri, 14 Jul 2017 02:29:16 -0700 (PDT) X-Received: by 10.98.222.3 with SMTP id h3mr4118548pfg.93.1500024556629; Fri, 14 Jul 2017 02:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024556; cv=none; d=google.com; s=arc-20160816; b=tBy0XVRIgrIvIgGTrMzlSO3m1QSC1aWu521A8voforcH8F/nFEsWqdSLu4o0AH772L KtqJat+6TwrDyhWPFo55b+8iuwvERn82cujV8O+ez6IB/ORERZXG9ok56f7HCPGIxGkd dJPtdvgh6u2kZ9o+wSX0JVotyEt8uH/ow9JepGtjjogRrWeY2L2gmZEYOzSbYmFUTmGD /g1jmd0wg+Y63CQ/bmAiulvmu0f+aTgdhwGk+e+Etj3NwODFaqMtfvmhODUdYy4Wfyr9 42h3uynOFadnK2E7JRaTkt2eYOxjlDWV1IZCR5Q9NetrVgkAFo5MbKD3sWgRCKYM766E ARtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to:arc-authentication-results; bh=jJWiDUbERNSNi8DC0Rilsop5tLTyvJJwrsBVPTB0iEI=; b=v2mYCgfGbLo1RTgoTbon3Mpzt7vOjzDGLwFkjZrywYxEJ+LXp2+Rpd/3NuBw9LJ/1Y 6LW30a5bkPVncD7zQQ5XH6XjlJUjHm3GEwsLN0ffh6x2SdWoJJo29hb6bxeXAgg3tkA8 XDYePOSXWw71j0wE+jUJR8xMMQbxquq4r5uEXaZG/f+gikrWNUxftxwNJm4vn89p7Rgv xLr5AqDIKHF2n4OwUC2NvWAWdMf4N4rqlRFxIRnCK+kM5Q2wCAEEUJ60jHC4X7F63l3L 6r/xT/zci2n4oC2WCmjEoDR/NrPjZchkVPnjy9z2A2kDMFjjEryAiXgIxi2xm4hq9r32 2ZUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id l11si6269116plk.441.2017.07.14.02.29.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:29:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AC746E7B5; Fri, 14 Jul 2017 09:29:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id D01066E7B5 for ; Fri, 14 Jul 2017 09:29:13 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJEQE-1dUHwD2R2o-002qFi; Fri, 14 Jul 2017 11:28:23 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Jiri Olsa Subject: [PATCH 07/14] proc/kcore: hide a harmless warning Date: Fri, 14 Jul 2017 11:25:19 +0200 Message-Id: <20170714092540.1217397-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:ghCtubTquugxYj8GXBf21w0WF6x6A7m1oGb4vIk2ntS06+UzIB7 6rSzAPq4SiIApfV4cpU6NyXP3Lms3VmwqLd02hu5oG8f9aBijH3E7GPqdnd0D/tRxFZ1B7O mufbTLejE0GUH25bXTY4+iJRQq9yyK+RLzpSTzIMRUSoG7Awnhh1Ki4r6cvqJhnWQCj5jK6 OG1uvXkfoIQensG4aEkNg== X-UI-Out-Filterresults: notjunk:1; V01:K0:REZFiXnP75U=:QZwO4+FWBmB5fJGgVtJAmK QMxqjeknBVgUZ4ccWWGvHi3vgPcQrS7LICvNYSdg/1GSkAZ/51b2BVWaM0Bv2XWbggrITk4jL toVt7XqPzBvQRJEWK8cJeeAwAeWpboQ4Us4Pt16cL8jfDHOarruueiTt2lV8fiVFlib67u8SP wXeva3XyP7IzKno9Qtxu0yBOhsgGaqA55gFBiBko9WGgeMqSlYfG8IrWW2alUJ1ZR2KnvP0aC KMp1t6m76DYRqbebZx22VTmn+vYa88lcsGipB3YMBnliZiQZswz8lelgyq0D1jTGiKGKCL4ic Rtlayygx1DV2cdny4TY6aWbOb49OsQj117vox635BsTNtWFklepnAbgIImRKN9x1tyjyoWGHh 8j0qIho8amkwuBLMc4HCG5PxdqPn+A7r4rg3ro46pTnwBG4jLtwkRc5FkmFTnHOuaWvdjVXVY t7cn+qqwzQcISu2a6JVmIfuknRW7i65Tq4gDxv28mq3t1vaSZ9IBZLRV1nLytX3aNb5K8JTpS FmeXhDhxaIUdNwwyXnjid32kQ/kf6/X1v/dCWEuc2AhIZ9rylZj6wz6Y84XcpwLz8Nh44AU+R bz7W6r0adv6voPGOYlOJ4N93V7yrrkXZx39uQk0HE0/wuWVf/5JWs4XzV6cOvBHk7GWLVIZlU fR6V/MUzAUYAnYdKP0wutv0ayO2AOUlF5MYXxH9H07JhwDW4Cts+rpJg3SnSbDP8tzDEbaj/u YfBknCWKcPY4HkprEUI4wCEEiOL1iFMEbvZK6WbIH040xortuULl0JdcJMI= Cc: Pratyush Anand , Kees Cook , Arnd Bergmann , Ard Biesheuvel , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Ingo Molnar , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc warns when MODULES_VADDR/END is defined to the same value as VMALLOC_START/VMALLOC_END, e.g. on x86-32: fs/proc/kcore.c: In function ‘add_modules_range’: fs/proc/kcore.c:622:161: error: self-comparison always evaluates to false [-Werror=tautological-compare] if (/*MODULES_VADDR != VMALLOC_START && */MODULES_END != VMALLOC_END) { The code is correct as it is required for most other configurations. The best workaround I found for shutting up that warning is to make it a little more complex by adding a temporary variable. The compiler will still optimize away the code as it finds the two to be identical, but it no longer warns because it doesn't condider the comparison "tautological" any more. Signed-off-by: Arnd Bergmann --- fs/proc/kcore.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 45629f4b5402..c503ad657c46 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -620,12 +620,14 @@ static void __init proc_kcore_text_init(void) /* * MODULES_VADDR has no intersection with VMALLOC_ADDR. */ -struct kcore_list kcore_modules; +static struct kcore_list kcore_modules; static void __init add_modules_range(void) { - if (MODULES_VADDR != VMALLOC_START && MODULES_END != VMALLOC_END) { - kclist_add(&kcore_modules, (void *)MODULES_VADDR, - MODULES_END - MODULES_VADDR, KCORE_VMALLOC); + void *start = (void *)MODULES_VADDR; + size_t len = MODULES_END - MODULES_VADDR; + + if (start != (void *)VMALLOC_START && len != VMALLOC_END - VMALLOC_START) { + kclist_add(&kcore_modules, start, len, KCORE_VMALLOC); } } #else From patchwork Fri Jul 14 09:25:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107750 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650677qge; Fri, 14 Jul 2017 02:29:26 -0700 (PDT) X-Received: by 10.98.7.87 with SMTP id b84mr4148728pfd.216.1500024565978; Fri, 14 Jul 2017 02:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024565; cv=none; d=google.com; s=arc-20160816; b=EnNiw7z7gfDOJ+1Mq9qP+ldDIQ/8AuKwR7p3s28Ha3cITS04AExgbNTLjhT5n6ThYE GzHdSDlYiyrpW3JhnJVpMCbi7BgWDjblORknWpKIBjPeZ6ewiozX17hJTXRI7ThRGHZA iz91TqpRbFSqTyzqKCHc5iiCkEDtS6luCcORFsn6e10nPu31Hm/Xmj4Jdp9EQLdpLTck RYN3p9khhxzqLoNYIHF8uip24nuPFpVOI6yKaBkEX7WqMAYJ3w8axrkQeL+62EkfV2F5 8rr9HRv/XUAKLaata8I6HBUPyE+8UsJeJhKEujA3OQAsfufeNLEpoNl7K/YntG85ZkF2 kN8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=Nh9C96fbuIfhREaG1fkuYHq8Fl8xgMagaM1j5wR0WBs=; b=Ciatn/rNytq+HW2lAoDfVKFWGKGGfMcs0oLiIQaE0AbhmCDLV0ULt71vg5T4ImokCU sKZdeksydgg0pTE8vHFxWhy74Fb8LMzEeBPRYwQLvgoSzerXdtTcU0S9QUxzT2BzzhAU nvjchLppUp/lusKh2lkSjywV2xtKrUJna6BS1sLl6kZRfwQiOEiZJwJt2nQrFJev3O1n YQ+IH0egMuxal/qSQfW/0Z9f8o+yNovLx7/3GcgOaP0JGU4dDCqAGTd3NgmqBmerpDcJ 9k8/tzsqK8Nvz5p8oW9fvxBrv0tb5PgaSubO9/WD0W/Jfca5vA9tawS6TMOyDV3YwZzr 3+wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id b59si6440872plb.225.2017.07.14.02.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:29:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2C4A6E7B6; Fri, 14 Jul 2017 09:29:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7AE8C6E7B6 for ; Fri, 14 Jul 2017 09:29:22 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MUTsx-1d6TfV35tL-00RI63; Fri, 14 Jul 2017 11:28:34 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Michael Hennerich , Dmitry Torokhov Subject: [PATCH 08/14] Input: adxl34x - fix gcc-7 -Wint-in-bool-context warning Date: Fri, 14 Jul 2017 11:25:20 +0200 Message-Id: <20170714092540.1217397-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:Fwkg5V9Dkf3Uk6FDlnXEZHBUjN8FIRuacqjtkcbxi44iibS95M9 0I8HNX2ZcsN4tpmFb/ScHQ6blkJtcV9VzsN5YCaIJ/W92GrOZizrlINUXabEUs9B852yXdL ZnQeWBx6WdsBCNZRBOKdihdM+uafKdOEu1332gInBh++bO6nT5MdvP4Klyt7obTBXpmos7U c1Iu8xlS79GSp0melk2UA== X-UI-Out-Filterresults: notjunk:1; V01:K0:EddTXrPS/Pg=:dfytTiaXL9gbpr3NdvMTtc nLPuf+nCKuw2Y3IvBu2ll1WRCJ2+rgCScfqxTYO+B/xEJWTFe91Nw3T4ksQcnXoCKVSaC+uEi UuQdtIhuo6cG00SiSdxyzx6UoJSGqrcHxOurqC8n1AIbonqiu/OHlGShvFLpNgZ1chhKUzT5r 682YORNXtT9zOY0DGweyjm3a/+Yr1gcXVuQfJIOczhBrFR6DvZ3l0DWy/WidXZYgeHZvoIn49 TDT5YJC2ZIerT963KtGgSQS6QjnSEpNjL3tDFXX+47te56PpjbBX08kN8HCCKgA15KcoVzy3T tkhQNUn22EjDKmBeI7PMNq11amaicMTF6H5DCAcJ2/ExHnwMq/EZcugoQia9bQzM3nDKgLdsd uilPk/1nVaRKXq4nb4A/B+xtvNei3C/dP7rT55KzRtk/7u0SCVD04QXEduVW92eb5BrEkgC8C GnUHFZQ9YGFqxhwpfI2S5Zv1QXtLYMhqgePkCvROSJutMXpyrSuHJQFrkC5G7i8NUTkrz9+5X /hkicqCEjL4p4I0L3ADGovWuV+AxWkNXgmILMu8K4ox0YVAhEH1q0qpVqR4oH5dA2zx/iCqZ3 MjkQW6XDEvyNqamcPCFx7rSBHdT6H8gbhbvJtS2c2u2KcnFqsCxk6EWCjr/Sks9GReUNgwQOO D5MDIavtovGOyH1iExj0442yvCiQC1gShXIwxxcjMGSHD9vsacH3IP+Q5ygsHd5QbEhGPtNsT NysoDUyEbFap2gI8ToG/6wRt90x+ezj5PbTiCA== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, linux-input@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 zero, 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 --- 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..e0caaa0de454 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) == 0) ac->pdata.fifo_mode |= FIFO_STREAM; } else { ac->int_mask |= DATA_READY; From patchwork Fri Jul 14 09:30:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107751 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp652457qge; Fri, 14 Jul 2017 02:31:13 -0700 (PDT) X-Received: by 10.84.224.200 with SMTP id k8mr14948437pln.215.1500024673332; Fri, 14 Jul 2017 02:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024673; cv=none; d=google.com; s=arc-20160816; b=AtMjxtgGF5J9h26AmixPayfGol/BAdV9XR6aDBs3Co2eVJ5dKA+pWLVCdpBG0gCdGR 2XIziloJtEWQqKiwsPPmzeaWDn86DvJ+v21JmshacmNbz0WpHG0bzSgXuO8gE/RqOO/U xxXS1kSgqJFZknoTCON65K2x4bg8mvKCZuqtt7rPsV+GzP8urKUfGt+eGMIg7it/WNub OyNzjgf5LpFaplF7Ni++RMNIIv6mlK49qZiuNS185/74y7tahbQVYAfxL2jklvDiQRU6 ibQe2e5ecbtsE8+Yt92tbfrlfYGciYfq8L20QxKe13m28aa0nN56QFGlvPJNafBbWLzL ECGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to:arc-authentication-results; bh=WQ4ANPO4r+YFsiyX+fkF5XlxfJoiDY96lPZD6T1xPeM=; b=p/gR6xpN2FEtRPViuddVEoxtRACKVpun/zAc6o9e6wY/NxPmn084bHBLRUiWvODMMt ZKHF7fK3QfqK4BTQQ0CXwe07zRMZBArgZGtlcIyVklM0kdAabeR8et8f2r5vclVP8xIT JskuLp5d8gWgq/jW52/yaaV5k8vtSTwxR2r7+FFKMSwOvT7VagwEUyz0ziyHqYHX6hUI 5Sg4nversNZDrnK2omCDdoZpncLubo59tI6t/7/B1KHqbuixPoAu3TBWcazoMv4SDoPf 3lB2Fv5pdhUBfOeeSH4jo/m00jPS4nzRBENT+dnl9aV0SUxsz+K7KvBybf1cQ/ZHgHO4 kbBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g13si6600559plm.355.2017.07.14.02.31.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:31:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A3846E7AC; Fri, 14 Jul 2017 09:31:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18E7C6E7AC for ; Fri, 14 Jul 2017 09:31:09 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lgc09-1e220j1ULl-00nuxO; Fri, 14 Jul 2017 11:30:24 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 09/14] SFI: fix tautological-compare warning Date: Fri, 14 Jul 2017 11:30:12 +0200 Message-Id: <20170714093021.1341005-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:hd1nKn8Ni74HjCk1caFaj/ZCREhsjc/sH301HkaxXRLP1WjuJwr pE7pPlwNHp9VPbq83b8af8y15hpKMzLw/KLn3eSM+Su3Xnr0BxFvJkKJA/2uUPSKZy1L2Aa I8PjFJNt3I8VHpnFwC2f7C54M5QNUMZ5tv1Sda1p7ff27bO4/4pwJVAwgR7hqPDwNaEdE5e 9X1vJ0+3ojsSa/6H7x3KA== X-UI-Out-Filterresults: notjunk:1; V01:K0:wpDrTwKjQqA=:1MRVRkbnSch/neTC2YjGze 35osCz5S77ILh0ZqEZXKnye7xEujvroIQMOJJDsBhrNXttXwaQeqNBDkfx8kN1vVX3QSsQ87u YTnAEzp7W1wXsntHOgf48EWNUr9XGrjnR1GyhfXMFoG825hP1OJtf91RR3eJHVLJ2A0uEdovp 2NY9oI5rJdArt3x3p2sDk9sOrozQeIDXcXQWDFJnLJLOXofvw9usse2HvCVzO5a0EwDAHM6fi PnbL4frirqnsFgUeMKEpnz4h6xcLlyh2fGiXoaBqPZ1xW1a+tupo1SLjxa5Qql8WnXuZUNVa4 22kvhD7eEW3jAvMFsNaYsDtFYzOhPgU4XWnlaML473rv0LwdVIhCchFnT9pC9grg9ZKFJJXua BiP9BX1+Sa51+eZ0Egtug0pY9Lxp5tPhwRTrMYkiF4bUDOguExgHHtYxIvfm7K/y3+z9NpS6N nvnADUWNlMrQtR9asU0bSwgWtAJqJG9VpaOtc9QwicpqYbWmcuea9vQssR1J/IBs4V90TCkTf zA+OHKGp84UwU6tY3MsD5wpBk1r8KdnUbL9vDTHYMLlNJLs0/sS56rjpSgmihkGW0PyfXGeyO kNh+RQFxPnK4e5Ht+Cg4p/KssCf+QFjgNmrU2jOXa3PBuOMEUUVAlKs8G0+5F8mWLhE2RVNJp 10csQTTc3dxh1a54s7saJvA9ASByWpds2MiKlNXGV/BvNhwPO8leUivbdhpF/K2rlThEVTUo1 E6xEyiQtuuxPHd1x0QQMoW3yyXmlVK//iWVSCFHEhTiBhqTrYNtJw9a2D/g= Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With ccache in combination with gcc-6, we get a harmless warning for the sfi subsystem, as ccache only sees the preprocessed source: drivers/sfi/sfi_core.c: In function ‘sfi_map_table’: drivers/sfi/sfi_core.c:175:53: error: self-comparison always evaluates to true [-Werror=tautological-compare] Using an inline function to do the comparison tells the compiler what is going on even for preprocessed files, and avoids the warning. Signed-off-by: Arnd Bergmann --- drivers/sfi/sfi_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a69c27..a8f2313a2613 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -71,9 +71,12 @@ #include "sfi_core.h" -#define ON_SAME_PAGE(addr1, addr2) \ - (((unsigned long)(addr1) & PAGE_MASK) == \ - ((unsigned long)(addr2) & PAGE_MASK)) +static inline bool on_same_page(unsigned long addr1, unsigned long addr2) +{ + return (addr1 & PAGE_MASK) == (addr2 & PAGE_MASK); +} + +#define ON_SAME_PAGE(addr1, addr2) on_same_page((unsigned long)addr1, (unsigned long)addr2) #define TABLE_ON_PAGE(page, table, size) (ON_SAME_PAGE(page, table) && \ ON_SAME_PAGE(page, table + size)) From patchwork Fri Jul 14 09:31:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107754 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp654630qge; Fri, 14 Jul 2017 02:33:31 -0700 (PDT) X-Received: by 10.101.87.200 with SMTP id q8mr13693989pgr.110.1500024811546; Fri, 14 Jul 2017 02:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024811; cv=none; d=google.com; s=arc-20160816; b=lral/PAqG7n0xUOYLN/GPyx9P71iogEPApLsIAxQLMqP/a1x44TDzVTGA0xdy7wJlI o6mK9EQ/X2jI1Ajs4fluvqJIZUTSAnbZBZKyUgBaVsaOf1veqlT6ja+uBEf6cfeUs2Fx 88OARViaPAiwJRxvwRvqp6aNXk4cqtdYkF3+ekxjuDHpvtDL5NmzHXVRb0OZiUDSPKzo zkDSFIlUNtCV6NLoBl3yw3rTQTBOZgJNYsAZ3JZA/ogcGG3ZEJKm5kmlRNDJepwVc9Sg Oj01sphidxaXvohvbiw1hT8LTYpMt89kw5/NCU9Hr7TqyoJcn1KAQDmoStxCm6g00AW5 PIMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=n0W8nqNpWWKwtTStMvA95+DevOaE4jFepM9vUEooG8U=; b=HodgcR6d3ufRBSNh6Orp5zNQgjy2EmIXagM2P1xuct8mY1yZKhY+oT7Iy402yV0oaG 2P+7B2Hk/ey33Qwzpbgo1nPBIjx4DtjN4Y6dHe/TO8yVkDPJ87/v5HyrqV4LE+Ufw86j qNS0GV8qNLXrOhswHbGso0NmIehhhAnYme7umGD59BzNUt323oKeZ6IDoWaesrRC5w6g pSvgW9WFdQquQIPeqbSC+3htsqVfVgNOXD9+HIVd7O2oTIsNJxqyF1Ig2ZhH9FVGBHGN 2jUnba+e5+SgYqr+Yn0POejFq0z2W0xyLUEtng4+mKwqM0A2ifzcL2/IUcf/NgyEW21T WZFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id n65si6097960pfh.410.2017.07.14.02.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:33:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D6226E7BC; Fri, 14 Jul 2017 09:32:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 405C06E105 for ; Fri, 14 Jul 2017 09:32:58 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MD8M0-1dQUNY129E-00GZ5Z; Fri, 14 Jul 2017 11:32:00 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Doug Ledford , Sean Hefty , Hal Rosenstock Subject: [PATCH 11/14] IB/uverbs: fix gcc-7 type warning Date: Fri, 14 Jul 2017 11:31:04 +0200 Message-Id: <20170714093129.1366900-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:o0OfFsKc+1oG1N4Q1wsNXw7hMZxze8QccEOFVOhNnpUBV3/m8Po T9o1NkZUZCWDoboinZpY7y6c28R7nKbYgVZbycyICBvN/UQHz6GaMj9JGFaz8kUsTDcVX/W Yr7RKMnrBHVaEs5e69Gn7Oe2Fbi2m5K1wAIec3r3hB/khnTxPjqKEpfluafh9dkmc+ARUJh pD0jOMa/JLk28WUOXDuCg== X-UI-Out-Filterresults: notjunk:1; V01:K0:tor7iKgojos=:ALl7GsyUC3X2gDKIekAmii PkqSgAF1NaCfXLZcB53DmGq8ehwqd6rqzyEqv9sPiCqJ7oLEqWcNj5UoPziKGE75rfCWzudlf 7dSjDhfkDpV+WDXRxyKpJ41aFXSTEaSToWks6g94GBiiK/1y88jLyQ2lcqDKNcYDGe8zT0hX2 wSk5VhhDiqr90lqLqeHbAArUdmZSMilmib809MKySiINHgQll5sTuUVCp//Hs8M60OsYviPNo cFhX4AucGrFuvlvz2XLz8PbLg0KG5p1biCuLsC0OQV0OZJXwLVK6Af6gwWNX7/kJGfQIKA0eX 3YtuuwcXvyOO+vp6HxA3BMASewPu95cIgpARwjx/KCcmlsWxYoQWXq+C3h5Al0bOxjIIO1XxW 9Omo/DQfq7z46Aty5ct2GM3h+srCWcO73CaceSptBSi2SHer3oSeluRbcWXe4tRZ8sHylwNBp g9hfH1EV1v/yvsfLIqX6+CtQtqThB8Mlqst4iw7HvM50DCPO1pZRfvrI30tm8O+Y8Ism91ORy IEoyq7k5jk0/xOL7igsPaSZ0UY8PWSEDpCMx/IpJKLEUoP7pB1rGYyD56wKJlrEjVbVZFBRqg mFwcWBaanaatqB8NwrCcJwi6Tg1r0J5SIw88josakAUgUXA0lDDDbGwxijUQTzxIZyXx5z+OY j1yAZQxzUZvA7HxEeZUSboWLnMoe9nvLcwuYj+O6S57QaWMAie+CJwAnaqMk9YdAEE0uZMIJ3 UypIs5i+RkFrLIuPKsmOZf5OLQ0mc9CF/LRZbg== Cc: Leon Romanovsky , Arnd Bergmann , linux-rdma@vger.kernel.org, Greg Kroah-Hartman , Yishai Hadas , Matan Barak , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When using ccache, we get a harmless warning about the fact that we use the result of a multiplication as a condition: drivers/infiniband/core/uverbs_main.c: In function 'ib_uverbs_write': drivers/infiniband/core/uverbs_main.c:787:40: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:787:117: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:790:50: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:790:151: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] This changes the macro to explicitly check the number for a positive length, which avoids the warning. Fixes: a96e4e2ffe43 ("IB/uverbs: New macro to set pointers to NULL if length is 0 in INIT_UDATA()") Signed-off-by: Arnd Bergmann --- drivers/infiniband/core/uverbs.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index 64d494a64daf..364d7de05721 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h @@ -55,12 +55,14 @@ (udata)->outlen = (olen); \ } while (0) -#define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \ - do { \ - (udata)->inbuf = (ilen) ? (const void __user *) (ibuf) : NULL; \ - (udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL; \ - (udata)->inlen = (ilen); \ - (udata)->outlen = (olen); \ +#define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \ + do { \ + (udata)->inbuf = (ilen) > 0 ? \ + (const void __user *) (ibuf) : NULL; \ + (udata)->outbuf = (olen) > 0 ? \ + (void __user *) (obuf) : NULL; \ + (udata)->inlen = (ilen); \ + (udata)->outlen = (olen); \ } while (0) /* From patchwork Fri Jul 14 09:31:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107753 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp654328qge; Fri, 14 Jul 2017 02:33:13 -0700 (PDT) X-Received: by 10.98.12.146 with SMTP id 18mr4228946pfm.167.1500024793015; Fri, 14 Jul 2017 02:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024793; cv=none; d=google.com; s=arc-20160816; b=nlPp8vVblE/Nr+VKpsFiSwPLtTibE91fAxpFFpDjDcui3pI/brHgY7/HC9qjmJX/sI BT7B5ZkAijC/cdfFeEuh8mWVswDL1HflIp/Oe7K1arRVvoJbBdEdkFEmneMjuG1SARmy jYAjh8JKjMrPZQkqUIGvdPhcUT+SsnCKfEVkOz0t2zip08zGgK6WlTC+AVgYMgIveJcA xNRilDn9m4CPrR2x2m1+KJ3VsXANQnduN+QhJXjqPJW5e1lbZ28X7BepjaN5tutnDosH 2GTElXKwA+4wpY3UR1Zua2Zuol/lbaWPo9Yz4h76Y4ngP15zBbPMUQ4rEUc6OAZ5Kc0o 9lSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=13o40m7rWQxYZBq3cgGqJfY8Qayazn0685S2PmxKn20=; b=nCnxUUdGtmBCViEUx7oaYD/DOYl7Wntk/B5m9cUbtKyrburFdhvAFbFZHX79oXRkI9 Nr6RjnZACo08OGN7L+N1HXO979CMTz33ZjQrUsusQEncIajhwDAdAILIQQIL7PKppEvf xUqDnU0Ao67saUuGSAWrvfc5qe9afcLdcrdYF9RqoX3+gEWZnjpSOW1EA+w84IIe8nwu 7y/PCZDbmBfc/kOcTrl3jfYlitAK8uTFU+tkNbQArSoFSzUDjHpz65zutKzxjIeYV6PX LBxIkoZDkn0NHbpCXSM2LH8pjy+1C/ud4iyK0NR8ZvTyRB4wPReGzhm+9CLhPMXiFwt4 laXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id b16si6099140pfe.343.2017.07.14.02.33.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:33:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9CFA6E7B9; Fri, 14 Jul 2017 09:33:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 094C46E7B9 for ; Fri, 14 Jul 2017 09:33:09 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LilTh-1e4AeG3MHl-00cvTQ; Fri, 14 Jul 2017 11:32:22 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Ben Skeggs , David Airlie Subject: [PATCH 12/14] drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning Date: Fri, 14 Jul 2017 11:31:05 +0200 Message-Id: <20170714093129.1366900-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:ZB3kpF6/0JRsNf0ObZOGZvU+6RWUWMQfDg7W74OGPod+rGNFHkf Ds/ZO1P3N+RKKPyNLZ7ug1CNrICIItZQrdxy9LHF6Gf7KCWNwrTjXuRmKnvsb/pjFZu4CP/ x6wJODLs63N7D9mwa1twkq4k3o2g7YArYfKgqwBMt4isWeiJSgUV7qVjAip93qjIa03DJYV rfkrw962TSPFJZXcnLmkA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kU4Mh41ER4I=:odoVzHAJ1LPM6JsqORLFsl 6w+6GrtWS2OqnGvqzSUe9TifQb9jop467+BSZl3PCvUEgB1iPbLn23eijn0/qPXjJ1odRGF3G J4sFmJu/X3/yTuWM5ha+/+gU1xKuTjjy3fsmBO4sve3k1AnGt0XvCwuEjQCPswAEbbPEpDI4/ 9PcCVPMxi4nblkuXCarZR22WY3Cj6fdezFsjFWgxsN9tDSe0EzimDkZRh7AdUJc+UdJNqAH2t Vn5T2M02PJ0kOcfqoa1JzK7xMYA6EbU98qAnwSOdu7z1uK/l9Js8tnlWuTdDaA9QOW7G+E2ml Z34PIvsD0KJD2x/yoX01N0VsnzoemLw+ubjkGfpN0r7RSmiV0VimXGgJ3EiL9oxebwvi7gogO pKTW7zLdsrU8kZI0Jxtwkj7wQAtMTWLrg63c/2YLbpSBD0YK8n29SWxEaXcQBhdjVDNz9YcwW xRzcyuFdiA3hzFRSAmdCXFShx0WS42iZiQRpVgKcNk8DSiFWrqWoOzX99Pspsc6NFxeGFFdH0 U4zSYwcGhustkPb1Q5F9aEiFKRXTQRYmGdbFKpFAijLFdtE0a0sa9NhrdunxECzBFTSwZTrjU lELt3EKO8TTE/6I85pyzJLCWbc2yKGcUbDh4MJ9KWXo5ipimMQYkQIYdo4yRvFspVmMA3tHjF OOgnuRIlKdT5FVhXqnhaK3jFOT9XhZvu50OKVdY7J1O4gX83HGuQIVKrQYdDlkCFG9yoUcOCt LnNYDlmcRkHFIHWi4GjxA24jrXZOnOlXPIQAKA== Cc: Arnd Bergmann , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, nouveau@lists.freedesktop.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc thinks that interpreting a multiplication result as a bool is confusing: drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c: In function 'read_pll': drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:133:8: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] In this instance, I think using multiplication is more intuitive than '&&', so I'm adding a comparison to zero instead to shut up the warning. To further improve readability, I also make the error case indented and leave the normal case as the final 'return' statement. Fixes: 7632b30e4b8b ("drm/nouveau/clk: namespace + nvidia gpu names (no binary change)") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c index 96e0941c8edd..04b4f4ccf186 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c @@ -130,10 +130,10 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll) sclk = read_clk(clk, 0x10 + idx, false); } - if (M * P) - return sclk * N / (M * P); + if (M * P == 0) + return 0; - return 0; + return sclk * N / (M * P); } static int From patchwork Fri Jul 14 09:36:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107756 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp661550qge; Fri, 14 Jul 2017 02:40:49 -0700 (PDT) X-Received: by 10.84.167.74 with SMTP id j10mr14914657plg.41.1500025249014; Fri, 14 Jul 2017 02:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500025249; cv=none; d=google.com; s=arc-20160816; b=RjbyPKng/QW448KhPQpLBV3HAAp4mJ+mtsfuY1msKX+vxWrYcAnmFJC3BTIiecsJub M3+NGkc9UzHNWwzjYiNDLZDKt9EGCEtjIJFnlKAob0aRXjvueIvMe57b9cww19TIEilA UiaWfWQLUalhbPS9aeUFGdDe5elmbMt/ssEd8k7EKJ08qZ55JOzFPQV3YdBnpIj23wfM xsrNqxk0layjnnXBJc8A1Ih73Fi8776xFI0nwXYa0Bhdq5YIRZS6k5pV9GMdkpcyZM+d r6G5EAQfyZVV3GBsqhAgVo/m5nvVCWeo8wujG0M6vNwFpScjqGLRGRBFd0lo+n3lTbP0 Wffg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=0G8YOndFCCmpqHlvilsQ6RUEoRPC1ZXJsb92dHDdnYw=; b=TLxtR4eBAi3WJFgWKuBemqW05s1ezZ4VvimraQc2aMuRSIzpESP58XOnB5wyUYFh10 iTa6IEm6zv9sfnAQy4b/msled4jk7qQXSDIdubJcV4z20uWNx2GuaHxQO2GDniwU+S1n BqtKSui+XupkNv6woE5euIlMPEsDO3okqrwf4vLW/DZE/RrVSszF0zzlHrZB+8xVwsbX tr7aBRcx/LDoT3dGJxIzZEjisBMsT1Jzn2zLf4SQjDg1xDRUU+0KCQ+7908cVkxD33xK XLfYYlhq72nBKi1Ca489Jpp/zRhN5Exj08A7nfSebOYex8PjTlBFS2Um/PI9wq60HKBa U/ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 5si6081470pfc.331.2017.07.14.02.40.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:40:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0ABE76E7BF; Fri, 14 Jul 2017 09:40:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75A3A6E7BF for ; Fri, 14 Jul 2017 09:40:45 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MN8wu-1dY8vP2V6u-006jSV; Fri, 14 Jul 2017 11:39:43 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Hans Verkuil Subject: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool Date: Fri, 14 Jul 2017 11:36:56 +0200 Message-Id: <20170714093938.1469319-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> X-Provags-ID: V03:K0:ZN0AtT+AY2HEC2jE46WbE6DS5vUL4Ra+2quqPcll7d1KGTkNzg5 CQ0nz4RBGZRlE/EBHqz9ZboIucaEYvNKkFNRejIpzYRew4DzosKuhVCOpMyim5AW6yZ1Pi6 G0U5A51PklP7ObyDqzI3T6oA3Px47JP5dS1cQvLabl4LuBrfe0biG5eVeeXe30xSaS6tEJn ySBuG3KDX6uGyKeHXdkbQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:QwMFRpSGul4=:TMQJd1yE8jdAE65dt7orl3 9omV9yj7tzyhdKmUvVNttt/ZGnzTyTw2ThsAJSL49lqfoigG3Q40v9LKwMvqhJ19SgSZDslcq PmVWuEDaeEwTidQGCS3P/uH9ZM+nnPmojiigTMf0+eJ3CWrY6mtbnjpbSEmpSzw/3Pb/avQgt VDEwDSwhG59hWbP2n3pk96jRURrtdo7ow/J7WT9HoV/SQ24jECBFW6vtMereLlgp6/1x3p6Fp LfYlqaSB3dKC7hzkNaaVohFUF6li+OHZnyTxNp4YgVzARQsl6Zn6LNex4xZ0gElFnVAi/Kfoy +VF0rRDN+dp4K+DswEPleRBeCpXLFCjIabsZosoah1yDaM0tqNW24zKJ02SIzFvOJcASqpMHW QJfXe2gaRjsOJIiU5W5lL4ODmsDn26RIH0lttGdTY6AR4fxsAr+L2wb4cOK5tF5Fcj6/A9ch4 83pD5enTXEULw1ASCOXugOuPx92JBFYj5an4tlCWtRuhb2bZTUjlnNzuu61eOB5FAntmRd5QW NDxgf9fcGB0mS92dK2RgyrI8EP/jyCMq8X2fNs4tt9cIVEHz7yDV0Z+ox5wnT6dgJF+0qvk6o c37g2jyu6rLBVEmjYyK/B+MPDGOJ3kEESM+45qbOhwjbjf7UoCM8yUDQt+Y/qCSYsV5rOyhIq HGWwfoM9kKax6yzOzZcj+lbF/g7hDUSanWlaHH450DH+GYTaIB6KDiSXuT1Ckmt7/W1RHScn9 /qG578zJGhcIUCGIaAltgvZbmSMJ93Vg4Sw3zw== Cc: devel@driverdev.osuosl.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Arnd Bergmann , Greg Kroah-Hartman , Robert Jarzmik , adi-buildroot-devel@lists.sourceforge.net, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tejun Heo , akpm@linux-foundation.org, Alan Cox , Linus Torvalds , Daeseok Youn , Guenter Roeck , linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" v4l2_subdev_call is a macro returning whatever the callback return type is, usually 'int'. With gcc-7 and ccache, this can lead to many wanings like: media/platform/pxa_camera.c: In function 'pxa_mbus_build_fmts_xlate': media/platform/pxa_camera.c:766:27: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) { media/atomisp/pci/atomisp2/atomisp_cmd.c: In function 'atomisp_s_ae_window': media/atomisp/pci/atomisp2/atomisp_cmd.c:6414:52: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera, The best workaround I could come up with is to change all the callers that use the return code from v4l2_subdev_call() in an 'if' or 'while' condition. In case of simple 'if' checks, adding a temporary variable is usually ok, and sometimes this can be used to propagate or print an error code, so I do that. For the 'while' loops, I ended up adding an otherwise useless comparison with zero, which unfortunately makes the code a little uglied. Signed-off-by: Arnd Bergmann --- drivers/media/pci/cx18/cx18-ioctl.c | 6 ++++-- drivers/media/pci/saa7146/mxb.c | 5 +++-- drivers/media/platform/atmel/atmel-isc.c | 4 ++-- drivers/media/platform/atmel/atmel-isi.c | 4 ++-- drivers/media/platform/blackfin/bfin_capture.c | 4 ++-- drivers/media/platform/omap3isp/ispccdc.c | 5 +++-- drivers/media/platform/pxa_camera.c | 3 ++- drivers/media/platform/rcar-vin/rcar-core.c | 2 +- drivers/media/platform/rcar-vin/rcar-dma.c | 4 +++- drivers/media/platform/soc_camera/soc_camera.c | 4 ++-- drivers/media/platform/stm32/stm32-dcmi.c | 4 ++-- drivers/media/platform/ti-vpe/cal.c | 6 ++++-- drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 13 +++++++------ 13 files changed, 37 insertions(+), 27 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 80b902b12a78..1803f28fc501 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -188,6 +188,7 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, void *fh, { struct cx18 *cx = fh2id(fh)->cx; struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced; + int ret; /* sane, V4L2 spec compliant, defaults */ vbifmt->reserved[0] = 0; @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, void *fh, * digitizer/slicer. Note, cx18_av_vbi() wipes the passed in * fmt->fmt.sliced under valid calling conditions */ - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced)) - return -EINVAL; + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced); + if (ret) + return ret; vbifmt->service_set = cx18_get_service_set(vbifmt); return 0; diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c index 504d78807639..d2d843c38579 100644 --- a/drivers/media/pci/saa7146/mxb.c +++ b/drivers/media/pci/saa7146/mxb.c @@ -525,8 +525,9 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) return err; /* switch video in saa7111a */ - if (saa7111a_call(mxb, video, s_routing, i, SAA7111_FMT_CCIR, 0)) - pr_err("VIDIOC_S_INPUT: could not address saa7111a\n"); + err = saa7111a_call(mxb, video, s_routing, i, SAA7111_FMT_CCIR, 0); + if (err) + pr_err("VIDIOC_S_INPUT: could not address saa7111a: %d\n", err); mxb->cur_audinput = video_audio_connect[input]; /* switch the audio-source only if necessary */ diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index d6534252cdcd..704b34a0cc00 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -1475,8 +1475,8 @@ static int isc_formats_init(struct isc_device *isc) fmt++; } - while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, - NULL, &mbus_code)) { + while (v4l2_subdev_call(subdev, pad, enum_mbus_code, + NULL, &mbus_code) == 0) { mbus_code.index++; fmt = find_format_by_code(mbus_code.code, &i); if (!fmt) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 891fa2505efa..30b7e6f298ed 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1013,8 +1013,8 @@ static int isi_formats_init(struct atmel_isi *isi) .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, - NULL, &mbus_code)) { + while (v4l2_subdev_call(subdev, pad, enum_mbus_code, + NULL, &mbus_code) == 0) { for (i = 0; i < ARRAY_SIZE(isi_formats); i++) { if (isi_formats[i].mbus_code != mbus_code.code) continue; diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 1c5166df46f5..864c98f21a0e 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -157,8 +157,8 @@ static int bcap_init_sensor_formats(struct bcap_device *bcap_dev) unsigned int num_formats = 0; int i, j; - while (!v4l2_subdev_call(bcap_dev->sd, pad, - enum_mbus_code, NULL, &code)) { + while (v4l2_subdev_call(bcap_dev->sd, pad, + enum_mbus_code, NULL, &code) == 0) { num_formats++; code.index++; } diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index 7207558d722c..a94157461f58 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -1132,6 +1132,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) unsigned int sph; u32 syn_mode; u32 ccdc_pattern; + int ret; ccdc->bt656 = false; ccdc->fields = 0; @@ -1140,7 +1141,6 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) sensor = media_entity_to_v4l2_subdev(pad->entity); if (ccdc->input == CCDC_INPUT_PARALLEL) { struct v4l2_mbus_config cfg; - int ret; ret = v4l2_subdev_call(sensor, video, g_mbus_config, &cfg); if (!ret) @@ -1158,7 +1158,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) */ fmt_src.pad = pad->index; fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE; - if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) { + ret = v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src); + if (!ret) { fmt_info = omap3isp_video_format_info(fmt_src.format.code); depth_in = fmt_info->width; } diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 399095170b6e..5236c7b171ea 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -763,7 +763,8 @@ static struct soc_camera_format_xlate *pxa_mbus_build_fmts_xlate( }; struct soc_camera_format_xlate *user_formats; - while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) { + while (v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code) == + 0) { raw_fmts++; code.index++; } diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index 77dff047c41c..a41f4a3d9b69 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -54,7 +54,7 @@ static bool rvin_mbus_supported(struct rvin_graph_entity *entity) code.index = 0; code.pad = entity->source_pad; - while (!v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code)) { + while (v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code) == 0) { code.index++; switch (code.code) { case MEDIA_BUS_FMT_YUYV8_1X16: diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index b136844499f6..ee16e9886041 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -143,6 +143,7 @@ static int rvin_setup(struct rvin_dev *vin) u32 vnmc, dmr, dmr2, interrupts; v4l2_std_id std; bool progressive = false, output_is_yuv = false, input_is_yuv = false; + int ret; switch (vin->format.field) { case V4L2_FIELD_TOP: @@ -155,7 +156,8 @@ static int rvin_setup(struct rvin_dev *vin) /* Default to TB */ vnmc = VNMC_IM_FULL; /* Use BT if video standard can be read and is 60 Hz format */ - if (!v4l2_subdev_call(vin_to_source(vin), video, g_std, &std)) { + ret = v4l2_subdev_call(vin_to_source(vin), video, g_std, &std); + if (ret) { if (std & V4L2_STD_525_60) vnmc = VNMC_IM_FULL | VNMC_FOC; } diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 45a0429d75bb..3ef648fc2db6 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -454,7 +454,7 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - while (!v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code)) { + while (v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code) == 0) { raw_fmts++; code.index++; } @@ -1202,7 +1202,7 @@ static int soc_camera_probe_finish(struct soc_camera_device *icd) goto evidstart; /* Try to improve our guess of a reasonable window format */ - if (!v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt)) { + if (v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt) == 0) { icd->user_width = mf->width; icd->user_height = mf->height; icd->colorspace = mf->colorspace; diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 83d32a5d0f40..96084dfd5d11 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -1034,8 +1034,8 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi) .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, - NULL, &mbus_code)) { + while (v4l2_subdev_call(subdev, pad, enum_mbus_code, + NULL, &mbus_code) == 0) { for (i = 0; i < ARRAY_SIZE(dcmi_formats); i++) { if (dcmi_formats[i].mbus_code != mbus_code.code) continue; diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 177faa36bc16..df0216a6367c 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -1348,9 +1348,11 @@ static void cal_stop_streaming(struct vb2_queue *vq) struct cal_dmaqueue *dma_q = &ctx->vidq; struct cal_buffer *buf, *tmp; unsigned long flags; + int ret; - if (v4l2_subdev_call(ctx->sensor, video, s_stream, 0)) - ctx_err(ctx, "stream off failed in subdev\n"); + ret = v4l2_subdev_call(ctx->sensor, video, s_stream, 0); + if (ret) + ctx_err(ctx, "stream off failed in subdev: %d\n", ret); csi2_ppi_disable(ctx); disable_irqs(ctx); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c index 97093baf28ac..fe56a037f065 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c @@ -6405,19 +6405,20 @@ int atomisp_s_ae_window(struct atomisp_sub_device *asd, struct atomisp_device *isp = asd->isp; /* Coverity CID 298071 - initialzize struct */ struct v4l2_subdev_selection sel = { 0 }; + int ret; sel.r.left = arg->x_left; sel.r.top = arg->y_top; sel.r.width = arg->x_right - arg->x_left + 1; sel.r.height = arg->y_bottom - arg->y_top + 1; - if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera, - pad, set_selection, NULL, &sel)) { - dev_err(isp->dev, "failed to call sensor set_selection.\n"); - return -EINVAL; - } + ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, + pad, set_selection, NULL, &sel); + if (ret) + dev_err(isp->dev, "failed to call sensor set_selection: %d\n", + ret); - return 0; + return ret; } int atomisp_flash_enable(struct atomisp_sub_device *asd, int num_frames)