From owner-dev-commits-src-branches@freebsd.org Mon Feb 15 19:23:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07EF4536D3C; Mon, 15 Feb 2021 19:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DfYtf6qTDz3FZH; Mon, 15 Feb 2021 19:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD3FD231A2; Mon, 15 Feb 2021 19:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11FJNsXY085255; Mon, 15 Feb 2021 19:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11FJNsk2085254; Mon, 15 Feb 2021 19:23:54 GMT (envelope-from git) Date: Mon, 15 Feb 2021 19:23:54 GMT Message-Id: <202102151923.11FJNsk2085254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 03bb5b837d89 - stable/13 - mlx4, mthca: Silence warnings about no-op alignment operations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03bb5b837d891defeed9b9d812c7b62b60917136 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2021 19:23:55 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=03bb5b837d891defeed9b9d812c7b62b60917136 commit 03bb5b837d891defeed9b9d812c7b62b60917136 Author: Mark Johnston AuthorDate: 2021-02-11 15:16:59 +0000 Commit: Mark Johnston CommitDate: 2021-02-15 19:12:10 +0000 mlx4, mthca: Silence warnings about no-op alignment operations Since commit 8fa6abb6f4f64f ("Expose clang's alignment builtins and use them for roundup2/rounddown2"), clang emits warnings for several alignment operations in these drivers because the operation is a no-op. The compiler is arguably being too strict here, but in the meantime let's silence the warnings by conditionally compiling the alignment operations. Reviewed by: arichardson, hselasky Differential Revision: https://reviews.freebsd.org/D28576 (cherry picked from commit 29ed53850e72ab1b470b978d150561281addc0fc) --- sys/dev/mlx4/mlx4_core/icm.h | 6 ++---- sys/dev/mlx4/mlx4_core/mlx4_fw.c | 4 ++++ sys/dev/mthca/mthca_cmd.c | 4 ++++ sys/dev/mthca/mthca_memfree.h | 8 +++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/dev/mlx4/mlx4_core/icm.h b/sys/dev/mlx4/mlx4_core/icm.h index 30dac5174f6d..e658f1dd0383 100644 --- a/sys/dev/mlx4/mlx4_core/icm.h +++ b/sys/dev/mlx4/mlx4_core/icm.h @@ -43,10 +43,8 @@ ((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \ (sizeof (struct scatterlist))) -enum { - MLX4_ICM_PAGE_SHIFT = 12, - MLX4_ICM_PAGE_SIZE = 1 << MLX4_ICM_PAGE_SHIFT, -}; +#define MLX4_ICM_PAGE_SHIFT 12 +#define MLX4_ICM_PAGE_SIZE (1 << MLX4_ICM_PAGE_SHIFT) struct mlx4_icm_chunk { struct list_head list; diff --git a/sys/dev/mlx4/mlx4_core/mlx4_fw.c b/sys/dev/mlx4/mlx4_core/mlx4_fw.c index 8ad31b812428..0ac45e1297b9 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_fw.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_fw.c @@ -1707,9 +1707,11 @@ int mlx4_QUERY_FW(struct mlx4_dev *dev) * Round up number of system pages needed in case * MLX4_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE fw->fw_pages = ALIGN(fw->fw_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT); +#endif mlx4_dbg(dev, "Clear int @ %llx, BAR %d\n", (unsigned long long) fw->clr_int_base, fw->clr_int_bar); @@ -2546,8 +2548,10 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages) * Round up number of system pages needed in case * MLX4_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MLX4_ICM_PAGE_SIZE < PAGE_SIZE *aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MLX4_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MLX4_ICM_PAGE_SHIFT); +#endif return 0; } diff --git a/sys/dev/mthca/mthca_cmd.c b/sys/dev/mthca/mthca_cmd.c index adb76bc9edbd..b4c0dc2f6f1d 100644 --- a/sys/dev/mthca/mthca_cmd.c +++ b/sys/dev/mthca/mthca_cmd.c @@ -852,9 +852,11 @@ int mthca_QUERY_FW(struct mthca_dev *dev) * Round up number of system pages needed in case * MTHCA_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE dev->fw.arbel.fw_pages = ALIGN(dev->fw.arbel.fw_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT); +#endif mthca_dbg(dev, "Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n", (unsigned long long) dev->fw.arbel.clr_int_base, @@ -1588,8 +1590,10 @@ int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages) * Round up number of system pages needed in case * MTHCA_ICM_PAGE_SIZE < PAGE_SIZE. */ +#if MTHCA_ICM_PAGE_SIZE < PAGE_SIZE *aux_pages = ALIGN(*aux_pages, PAGE_SIZE / MTHCA_ICM_PAGE_SIZE) >> (PAGE_SHIFT - MTHCA_ICM_PAGE_SHIFT); +#endif return 0; } diff --git a/sys/dev/mthca/mthca_memfree.h b/sys/dev/mthca/mthca_memfree.h index da9b8f9b884f..9aa10a6a47e1 100644 --- a/sys/dev/mthca/mthca_memfree.h +++ b/sys/dev/mthca/mthca_memfree.h @@ -42,11 +42,9 @@ ((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \ (sizeof (struct scatterlist))) -enum { - MTHCA_ICM_PAGE_SHIFT = 12, - MTHCA_ICM_PAGE_SIZE = 1 << MTHCA_ICM_PAGE_SHIFT, - MTHCA_DB_REC_PER_PAGE = MTHCA_ICM_PAGE_SIZE / 8 -}; +#define MTHCA_ICM_PAGE_SHIFT 12 +#define MTHCA_ICM_PAGE_SIZE (1 << MTHCA_ICM_PAGE_SHIFT) +#define MTHCA_DB_REC_PER_PAGE (MTHCA_ICM_PAGE_SIZE / 8) struct mthca_icm_chunk { struct list_head list;