From patchwork Thu May 4 20:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98579 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806392qgd; Thu, 4 May 2017 13:52:30 -0700 (PDT) X-Received: by 10.99.152.67 with SMTP id l3mr10996816pgo.97.1493931150087; Thu, 04 May 2017 13:52:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.29; Thu, 04 May 2017 13:52:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281AbdEDUw3 (ORCPT + 6 others); Thu, 4 May 2017 16:52:29 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:53937 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbdEDUw2 (ORCPT ); Thu, 4 May 2017 16:52:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lzkot-1e9VKB00nL-0155cY; Thu, 04 May 2017 22:52:20 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann , "David S . Miller" Subject: [PATCH 09/13] [3.18-stable] infiniband: mlx5: avoid a compile-time warning Date: Thu, 4 May 2017 22:52:05 +0200 Message-Id: <20170504205209.498721-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:A/1ziaqaWU+Whctp3XiR1aGnlsDwtAv++gO+U+29z8/x5E7uDjs 23d52tirZnmrxUBSgd7AT1DZn0ExIzaLv465s1jq2ZgNv3hBpy2xiN57sIFrUnYbqtxoJl/ ZkJeanPfFEgFhtAJM73g9KdBZVr1UOR2wu1Qxv+ps+ohY74mns0pgpl5C29aGj/VDTJePVN BUXJjoTUYgCbbnUba9nzA== X-UI-Out-Filterresults: notjunk:1; V01:K0:tN9X5aNIcJA=:UjEDXWEQ4td+vQumE0TnYQ Y7ULWazsJD1Ml7/rkLYBGTiksews9kyYNatJ9SrBojaLIH8sHDqjpg9l9wiWcUlRBAXvg11T3 0IeTcKW6CBQB/xCEfYUijMeRREiwLeJt5B10U74wrE74BEYiXT6LX5bWQPcqd+Rs03JW74bBY 2XCS5esqt6dYpVtGcgoLl9/4rV15fZw2wKymEQ+4HZt0on196qsH36rkKsUwygDqhlvpT/1/0 oLOW0lZoOKWJLzZYeBbhzwJENLwdJzV3FhI4XXjkmErysnWZXXuDL+4HxorrT07v6rGAcqI8U oV6ldPYGmlub1VQQyrRvtNW8WM1Eq6Kn9/MdJjy4ShabgRypJoDrSQfeh1A1Q7VDdzg/TT78k bmOhGmSc3jORfSnaqnXGfZbQ1QhB4HdMSvwzQMUbmSbuPdnarWe4cD7V5s+xlpvYQbeMZXmKF AzEUFarT8zZhRrLwOHvejxj73oxwMNno3pKfJhBkt0sWgDG2Ze+4ShRmih4ee3WTxN/LAFoxA UHeJEMO6eALoxj6HscRGyIzMQQMXt9UY8hwxSp2DQRchLi8px215rEbdhXwZQJbrEGyAFrZpP 0vi6RKDuQTg4lNFTn9UyLPuJB6/utDm+sgw1WC/5JcD3/hPBEpDBPZWuvUlE25dKtJfQ/HEh0 mWWkZ5IojXueOHCNlRZk0CgNRwkALPQIHaJ+DrnbY9zWG+5Wamrwe9ZfZbG3xi/0H+7I= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 7835bfb5261501590a508b3de3379e2231cb4853 upstream. The return type of find_first_bit() is architecture specific, on ARM it is 'unsigned int', while the asm-generic code used on x86 and a lot of other architectures returns 'unsigned long'. When building the mlx5 driver on ARM, we get a warning about this: infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages': infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast m = min(m, find_first_bit(&tmp, sizeof(tmp))); This patch changes the driver to use min_t to make it behave the same way on all architectures. Signed-off-by: Arnd Bergmann Acked-by: Eli Cohen Signed-off-by: David S. Miller Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/mlx5/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/infiniband/hw/mlx5/mem.c b/drivers/infiniband/hw/mlx5/mem.c index dae07eae9507..0a9b2ae93874 100644 --- a/drivers/infiniband/hw/mlx5/mem.c +++ b/drivers/infiniband/hw/mlx5/mem.c @@ -69,7 +69,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, for (k = 0; k < len; k++) { if (!(i & mask)) { tmp = (unsigned long)pfn; - m = min(m, find_first_bit(&tmp, sizeof(tmp))); + m = min_t(unsigned long, m, find_first_bit(&tmp, sizeof(tmp))); skip = 1 << m; mask = skip - 1; base = pfn;