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: 9840269 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 97C19602BD for ; Fri, 14 Jul 2017 09:27:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8894F2876E for ; Fri, 14 Jul 2017 09:27:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C26528783; Fri, 14 Jul 2017 09:27:22 +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 12B222876E for ; Fri, 14 Jul 2017 09:27:22 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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,