Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753580AbdGNJ1c (ORCPT ); Fri, 14 Jul 2017 05:27:32 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:60898 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbdGNJ13 (ORCPT ); Fri, 14 Jul 2017 05:27:29 -0400 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, "David S. Miller" Cc: Greg Kroah-Hartman , Linus Torvalds , Tejun Heo , Guenter Roeck , linux-ide@vger.kernel.org, linux-media@vger.kernel.org, akpm@linux-foundation.org, dri-devel@lists.freedesktop.org, Arnd Bergmann 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== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1785 Lines: 50 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, -- 2.9.0