From patchwork Thu May 4 20:52:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98573 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806366qgd; Thu, 4 May 2017 13:52:25 -0700 (PDT) X-Received: by 10.98.73.214 with SMTP id r83mr13226248pfi.253.1493931145469; Thu, 04 May 2017 13:52:25 -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.25; Thu, 04 May 2017 13:52:25 -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 S1751228AbdEDUwX (ORCPT + 6 others); Thu, 4 May 2017 16:52:23 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:57379 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LvtTJ-1e8xMV2YdJ-017piG; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 06/13] [3.18-stable] IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE Date: Thu, 4 May 2017 22:52:02 +0200 Message-Id: <20170504205209.498721-7-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:rj8JzcAwC3/5MosaZ6EsoGcbT4zsn0elK4T9QNOvTZEiGC787t8 2zkGSY3Q47s9MjnDOu8lGWWAXsIoWWnGk/DqWpbv7qxz1lNwIjrsayUigeO++lEPZ13cXTY 5/0NhXpFxlkLGCWzRo5XH6BwciLi8o9i5vSFxEPL4IyJek+SPBeiYqcHpO7xbDa2+8yZcC7 VBTEmG08BMn2CGs0QAHZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:EZmk1OL+u0Y=:5B3SLEgSBCfcDGGZSoVf9t uK7N6lTmSfNTSX3gfBgpV0SWUgp76zrmfvoxo7Z83sRE2RftTQvjqHUI9jjDKoqXSqeS3SuYO CPw5haUD/OOX7JfYBALTP2yxg5ALbAw/AqVmhgRH0z+dIHozxDOdCLRW11dN/DlOZi1Bk5n5i ZZPGoP16m1e3W+pp0BF2n/zL1l3R8avViPqhX7eW2rZxE9c2vYDedAhTvseoNLelATsQHS7ri JCTo4fer4kaH0IutpO8xKtMPxQsv6sopsqAjjP1iCGDuBoeSq2jz2BDYhnYGkFug21lM+MrXR 7vvxJVy6vLkv9uw5DzZiI3uKuQvDxkjPj8f4a0mHeIQIp5B24xU7I4uRdz6ZCJaIEoPGtQSHR DcheJ6DjgihCCO/rI/6mDD6yhLAlhdSffGzjkuamurE5qt0AwRISIt4l2L3/nhlEb8vNNrrpp iFzk7JVBqgdt+0XUonUdBIhDfpNc4moH6unGM7Jhr4QJOYI28NOZ7qs6AEryCRXgo798OinXC K12J+6P28DC+ZA4nIWRYgq8ZKDrQF7eAiijTLEqbPGZiNhSN4qxOXYmH6vvJQdUF8xRM7kKdj co+sTx1Tspd3A99nEL1mOp4R1JupV8+Lmf9NsXWY1FavK+x9fmxcgTNaBbUlY+l5Tqtc307LK Q/Qtv0G/TcxZbw0urlWgHdukPsaxP0Sk2BvA3KL7KdiFgJ5LxZnLPogrKW9cw9QUZy0A= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get this build warning on arm64 drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror] #define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and related variables from qib"), which does a lot of other things as well. Instead, I just backport the rename of the local BITS_PER_PAGE definition to RVT_BITS_PER_PAGE. The driver first showed up in linux-2.6.35, and the fixup should still apply to that. The upstream fix went into v4.6, so we could apply this workaround to both 3.18 and 4.4. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index c5b6e60ccad4..c231313bc3be 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c @@ -41,13 +41,13 @@ #include "qib.h" -#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) -#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) +#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1) static inline unsigned mk_qpn(struct qib_qpn_table *qpt, struct qpn_map *map, unsigned off) { - return (map - qpt->map) * BITS_PER_PAGE + off; + return (map - qpt->map) * RVT_BITS_PER_PAGE + off; } static inline unsigned find_next_offset(struct qib_qpn_table *qpt, @@ -59,7 +59,7 @@ static inline unsigned find_next_offset(struct qib_qpn_table *qpt, if (((off & qpt->mask) >> 1) >= n) off = (off | qpt->mask) + 2; } else - off = find_next_zero_bit(map->page, BITS_PER_PAGE, off); + off = find_next_zero_bit(map->page, RVT_BITS_PER_PAGE, off); return off; } @@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt, qpn = 2; if (qpt->mask && ((qpn & qpt->mask) >> 1) >= dd->n_krcv_queues) qpn = (qpn | qpt->mask) + 2; - offset = qpn & BITS_PER_PAGE_MASK; - map = &qpt->map[qpn / BITS_PER_PAGE]; + offset = qpn & RVT_BITS_PER_PAGE_MASK; + map = &qpt->map[qpn / RVT_BITS_PER_PAGE]; max_scan = qpt->nmaps - !offset; for (i = 0;;) { if (unlikely(!map->page)) { @@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt, * We just need to be sure we don't loop * forever. */ - } while (offset < BITS_PER_PAGE && qpn < QPN_MAX); + } while (offset < RVT_BITS_PER_PAGE && qpn < QPN_MAX); /* * In order to keep the number of pages allocated to a * minimum, we scan the all existing pages before increasing @@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_table *qpt, u32 qpn) { struct qpn_map *map; - map = qpt->map + qpn / BITS_PER_PAGE; + map = qpt->map + qpn / RVT_BITS_PER_PAGE; if (map->page) - clear_bit(qpn & BITS_PER_PAGE_MASK, map->page); + clear_bit(qpn & RVT_BITS_PER_PAGE_MASK, map->page); } static inline unsigned qpn_hash(struct qib_ibdev *dev, u32 qpn)