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: 9840283 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 A157460393 for ; Fri, 14 Jul 2017 09:28:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 934382876A for ; Fri, 14 Jul 2017 09:28:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 881AC28783; Fri, 14 Jul 2017 09:28:40 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED3DB2876E for ; Fri, 14 Jul 2017 09:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190AbdGNJ1c (ORCPT ); Fri, 14 Jul 2017 05:27:32 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:62343 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753535AbdGNJ13 (ORCPT ); Fri, 14 Jul 2017 05:27:29 -0400 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 Cc: Greg Kroah-Hartman , Linus Torvalds , Guenter Roeck , linux-ide@vger.kernel.org, linux-media@vger.kernel.org, akpm@linux-foundation.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , Adam Manzanares , Mauro Carvalho Chehab , Hannes Reinecke , Geert Uytterhoeven , Damien Le Moal 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== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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,