Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbdGNJ1d (ORCPT ); Fri, 14 Jul 2017 05:27:33 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1826 Lines: 50 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, -- 2.9.0