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: 107745 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp649360qge; Fri, 14 Jul 2017 02:27:53 -0700 (PDT) X-Received: by 10.84.130.108 with SMTP id 99mr14642800plc.76.1500024473047; Fri, 14 Jul 2017 02:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024473; cv=none; d=google.com; s=arc-20160816; b=wkDBr5tdlacH5f2fsdz6FdkVZU8y181B62zoAiKvYm1SaYzEUi+OwKcaef6z+lG5ex l4UMU/+k0MLAq1yShH1xFTpicOgkLsW7b3EbLe6AHnhm3MgREJbi+CvENS2lh3kCitFC YpudannKQNcJdp/ocF5tZIQyrWsZkL3VsOCfY4QxQiyUZ6UVW5vJXEdGVtaMfKBYFFsU JFdtfwk+cyrty5FBN726XEkgS7qETUq4HycSNPxfBPEPnkAuTUGGt7XnjZlBHilct7Wp 7OiQYVR8m8oYQ+c2WeEus+Bq3JEQwPvxV1ztI0CHozXCXrJLgDR05ONajujfCzmf/xi/ rz9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:delivered-to:arc-authentication-results; bh=P11rqWpzQbNd+ALCaqzAj9gPiqvMaAspA8e/mn0rmfA=; b=OS8/VVBb2xI3yX5e8JUJG5QIqWY+Wj0fg9WjNOmdMXeZuWkKIAKDaWPIxKXS7mg+dX KfQiKWEOMjljE2e/6q9gMMVmVpXkPsd6jCeeV5HDcO/RJYbFDCXz0wqFGnJ6Gye95pmg debpftbYCH5rjXY3LDAc/drvlsrOkYek7+4nkD/2JLKNeVjoL0KSRr3aGudLbitD86WW hFI7gLG5zi0VlhtjAgWTEohKzorc39dr6Smq9vL7QE8YZeNJaOEQld+h/ht55JUyuF2C HClC/t4Lq501x9YPRpxfQaHk6ty1narNooxwz9dXUwSnAbbWRoe5LRlPahGT7mmjGfKq V4AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p24si6470160pli.267.2017.07.14.02.27.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:27:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org 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" 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,