Message ID | 20170714093129.1366900-3-arnd@arndb.de |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp654328qge; Fri, 14 Jul 2017 02:33:13 -0700 (PDT) X-Received: by 10.98.12.146 with SMTP id 18mr4228946pfm.167.1500024793015; Fri, 14 Jul 2017 02:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024793; cv=none; d=google.com; s=arc-20160816; b=nlPp8vVblE/Nr+VKpsFiSwPLtTibE91fAxpFFpDjDcui3pI/brHgY7/HC9qjmJX/sI BT7B5ZkAijC/cdfFeEuh8mWVswDL1HflIp/Oe7K1arRVvoJbBdEdkFEmneMjuG1SARmy jYAjh8JKjMrPZQkqUIGvdPhcUT+SsnCKfEVkOz0t2zip08zGgK6WlTC+AVgYMgIveJcA xNRilDn9m4CPrR2x2m1+KJ3VsXANQnduN+QhJXjqPJW5e1lbZ28X7BepjaN5tutnDosH 2GTElXKwA+4wpY3UR1Zua2Zuol/lbaWPo9Yz4h76Y4ngP15zBbPMUQ4rEUc6OAZ5Kc0o 9lSQ== 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=13o40m7rWQxYZBq3cgGqJfY8Qayazn0685S2PmxKn20=; b=nCnxUUdGtmBCViEUx7oaYD/DOYl7Wntk/B5m9cUbtKyrburFdhvAFbFZHX79oXRkI9 Nr6RjnZACo08OGN7L+N1HXO979CMTz33ZjQrUsusQEncIajhwDAdAILIQQIL7PKppEvf xUqDnU0Ao67saUuGSAWrvfc5qe9afcLdcrdYF9RqoX3+gEWZnjpSOW1EA+w84IIe8nwu 7y/PCZDbmBfc/kOcTrl3jfYlitAK8uTFU+tkNbQArSoFSzUDjHpz65zutKzxjIeYV6PX LBxIkoZDkn0NHbpCXSM2LH8pjy+1C/ud4iyK0NR8ZvTyRB4wPReGzhm+9CLhPMXiFwt4 laXg== 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: <dri-devel-bounces@lists.freedesktop.org> Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id b16si6099140pfe.343.2017.07.14.02.33.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:33:13 -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 E9CFA6E7B9; Fri, 14 Jul 2017 09:33:11 +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 [217.72.192.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 094C46E7B9 for <dri-devel@lists.freedesktop.org>; Fri, 14 Jul 2017 09:33:09 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LilTh-1e4AeG3MHl-00cvTQ; Fri, 14 Jul 2017 11:32:22 +0200 From: Arnd Bergmann <arnd@arndb.de> To: linux-kernel@vger.kernel.org, Ben Skeggs <bskeggs@redhat.com>, David Airlie <airlied@linux.ie> Subject: [PATCH 12/14] drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning Date: Fri, 14 Jul 2017 11:31:05 +0200 Message-Id: <20170714093129.1366900-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:ZB3kpF6/0JRsNf0ObZOGZvU+6RWUWMQfDg7W74OGPod+rGNFHkf Ds/ZO1P3N+RKKPyNLZ7ug1CNrICIItZQrdxy9LHF6Gf7KCWNwrTjXuRmKnvsb/pjFZu4CP/ x6wJODLs63N7D9mwa1twkq4k3o2g7YArYfKgqwBMt4isWeiJSgUV7qVjAip93qjIa03DJYV rfkrw962TSPFJZXcnLmkA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kU4Mh41ER4I=:odoVzHAJ1LPM6JsqORLFsl 6w+6GrtWS2OqnGvqzSUe9TifQb9jop467+BSZl3PCvUEgB1iPbLn23eijn0/qPXjJ1odRGF3G J4sFmJu/X3/yTuWM5ha+/+gU1xKuTjjy3fsmBO4sve3k1AnGt0XvCwuEjQCPswAEbbPEpDI4/ 9PcCVPMxi4nblkuXCarZR22WY3Cj6fdezFsjFWgxsN9tDSe0EzimDkZRh7AdUJc+UdJNqAH2t Vn5T2M02PJ0kOcfqoa1JzK7xMYA6EbU98qAnwSOdu7z1uK/l9Js8tnlWuTdDaA9QOW7G+E2ml Z34PIvsD0KJD2x/yoX01N0VsnzoemLw+ubjkGfpN0r7RSmiV0VimXGgJ3EiL9oxebwvi7gogO pKTW7zLdsrU8kZI0Jxtwkj7wQAtMTWLrg63c/2YLbpSBD0YK8n29SWxEaXcQBhdjVDNz9YcwW xRzcyuFdiA3hzFRSAmdCXFShx0WS42iZiQRpVgKcNk8DSiFWrqWoOzX99Pspsc6NFxeGFFdH0 U4zSYwcGhustkPb1Q5F9aEiFKRXTQRYmGdbFKpFAijLFdtE0a0sa9NhrdunxECzBFTSwZTrjU lELt3EKO8TTE/6I85pyzJLCWbc2yKGcUbDh4MJ9KWXo5ipimMQYkQIYdo4yRvFspVmMA3tHjF OOgnuRIlKdT5FVhXqnhaK3jFOT9XhZvu50OKVdY7J1O4gX83HGuQIVKrQYdDlkCFG9yoUcOCt LnNYDlmcRkHFIHWi4GjxA24jrXZOnOlXPIQAKA== Cc: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, nouveau@lists.freedesktop.org, Tejun Heo <tj@kernel.org>, akpm@linux-foundation.org, Linus Torvalds <torvalds@linux-foundation.org>, Guenter Roeck <linux@roeck-us.net>, 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 <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
gcc-7 warnings
|
expand
|
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c index 96e0941c8edd..04b4f4ccf186 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c @@ -130,10 +130,10 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll) sclk = read_clk(clk, 0x10 + idx, false); } - if (M * P) - return sclk * N / (M * P); + if (M * P == 0) + return 0; - return 0; + return sclk * N / (M * P); } static int
gcc thinks that interpreting a multiplication result as a bool is confusing: drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c: In function 'read_pll': drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c:133:8: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] In this instance, I think using multiplication is more intuitive than '&&', so I'm adding a comparison to zero instead to shut up the warning. To further improve readability, I also make the error case indented and leave the normal case as the final 'return' statement. Fixes: 7632b30e4b8b ("drm/nouveau/clk: namespace + nvidia gpu names (no binary change)") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)