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: 9840267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35D99602BD for ; Fri, 14 Jul 2017 09:27:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26EC42817F for ; Fri, 14 Jul 2017 09:27:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C02F2875A; Fri, 14 Jul 2017 09:27:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 27FDF2817F for ; Fri, 14 Jul 2017 09:27:10 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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,