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,