From patchwork Mon Aug 24 18:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 11734107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E07C1510 for ; Mon, 24 Aug 2020 18:45:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2739C20738 for ; Mon, 24 Aug 2020 18:45:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hu+8NJDQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PuQRr8H0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2739C20738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jc0NJCDp7ZGxhq8raQfSLsajvjs78iVcq7F5RP1+4vw=; b=hu+8NJDQr0+LoeBVy2KyW2o7a 6P6Vly/YxAWtEUDdyorPN3ED3ptxTbWQGKQXZABbrn+kb7X0BhE3WIl9hC3TjVU5IbSXMS/aDjcHa raYKn3MvVkjf7cbIPLgBSVy0j+OzZlRW6s54lWb9dHpiAjiq/eO2lCwn1kciioZqfQAoelVGWuM4J 5Hs73M+7YVER28iPmQGu7YexIMwhxQOa5OYBK/Yx4LrkLbgijs8IUt4VBzT5kC/+h5feANlzv2KLF xYwDz1ZRFPn8ctTWVCBXq2KnI2YTK/Qu/v3ODd2ByPCEcRwPnnYglWtf+F0HDQfbgwJV0B5ODdIA5 HvVTWFCkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAHRd-00078b-FL; Mon, 24 Aug 2020 18:43:49 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAHQG-0006X4-Lu for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 18:42:37 +0000 Received: by mail-pf1-x444.google.com with SMTP id t185so2199138pfd.13 for ; Mon, 24 Aug 2020 11:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kSk9Ml31XbJOG2f57h64F+Z+u/H7LjegKljJVlxq3/o=; b=PuQRr8H0J0Wm/JwS7TDm/n1aaDYpCp+u0Xhtd6ySCS+jIDk3G8tZ+NTj4I9yJl9Xi0 ESlNd1bOyyh7orw4FugAlt6b+4E1XyjwB3dT9M21/hTZnBuqymaPtGRryP6vooFDmeCg WBeYpuFK/VhIFBz/ID3oiWyAmocmTWpc71sVReALesHl5XDdOuMmx5BRB2l0jgjEdjjL 7NTUSfmUhr5gmrltKw5aeVI4wrDhmcyD8K51sVTFDE2s9RgvK0yi5wbt0jyc43vGwnz6 llUJuwX98+NWd8VFREqSV3FObuRD5JQgg65Tdc9SiDaD++ha9SxdK+F2yxcFANSDRVgN 6ErA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kSk9Ml31XbJOG2f57h64F+Z+u/H7LjegKljJVlxq3/o=; b=ris03Cc2HpxpdhDP+Ld+YFAFUWYofrF5zPwFKbto1d1E+kk/jWwD8Q+cp2e48CjLzU HrY7Zn5crrHXMJee9vyLySIV7tN7k7+Pt31TZY8//TIOScSNT28h44L2QNxT2SgxPE4U oYAN/wrcm3YN9/UUjrGHq6q/92yUqEKQ1qIYivGRRdbAaztcowyWpPc2WzJwmSoIT2VE NWew5lRzY+5KKoofRJ/owm44t/t0OytKbPuGw2r41tPzirh0PGTg4QSHWYxC5z79zli0 rtWTRM+Fw7+91y5NKr1zUjKOqYO+sHBAHhKvjY/uMw7K+WR9m6cGVs6zDKoIuwqaEaIO c8/g== X-Gm-Message-State: AOAM532LJ6Qf07e0lThRlN3T8BFLyp5dngsYMvMzBxlvHH8dxxLIbbmD pHHtfdh3FqJhPHk9JXbdhWU= X-Google-Smtp-Source: ABdhPJypoRetU1pm/hYk35duEuEDV/9I1qEX2ndUelby0c1VRDwOv61H6tDsCuRdB0ISZKdafjLiDQ== X-Received: by 2002:a17:902:7792:: with SMTP id o18mr4697906pll.150.1598294542026; Mon, 24 Aug 2020 11:42:22 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id p12sm11985571pff.110.2020.08.24.11.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 11:42:20 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org Subject: [PATCH 08/20] iommu/arm-smmu: constify some helpers Date: Mon, 24 Aug 2020 11:37:42 -0700 Message-Id: <20200824183825.1778810-9-robdclark@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200824183825.1778810-1-robdclark@gmail.com> References: <20200824183825.1778810-1-robdclark@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_144224_909028_C39A6C1A X-CRM114-Status: GOOD ( 11.96 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [robdclark[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Akhil P Oommen , Bjorn Andersson , Eric Anholt , Vivek Gautam , AngeloGioacchino Del Regno , Will Deacon , Rob Clark , Sai Prakash Ranjan , Jonathan Marek , Joerg Roedel , Ben Dooks , Sibi Sankar , Brian Masney , Joerg Roedel , Stephen Boyd , John Stultz , Jordan Crouse , "moderated list:ARM SMMU DRIVERS" , freedreno@lists.freedesktop.org, open list , Robin Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Clark Sprinkle a few `const`s where helpers don't need write access. Signed-off-by: Rob Clark --- drivers/iommu/arm/arm-smmu/arm-smmu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h index 59ff3fc5c6c8..27c83333fc50 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h @@ -377,7 +377,7 @@ struct arm_smmu_master_cfg { s16 smendx[]; }; -static inline u32 arm_smmu_lpae_tcr(struct io_pgtable_cfg *cfg) +static inline u32 arm_smmu_lpae_tcr(const struct io_pgtable_cfg *cfg) { u32 tcr = FIELD_PREP(ARM_SMMU_TCR_TG0, cfg->arm_lpae_s1_cfg.tcr.tg) | FIELD_PREP(ARM_SMMU_TCR_SH0, cfg->arm_lpae_s1_cfg.tcr.sh) | @@ -398,13 +398,13 @@ static inline u32 arm_smmu_lpae_tcr(struct io_pgtable_cfg *cfg) return tcr; } -static inline u32 arm_smmu_lpae_tcr2(struct io_pgtable_cfg *cfg) +static inline u32 arm_smmu_lpae_tcr2(const struct io_pgtable_cfg *cfg) { return FIELD_PREP(ARM_SMMU_TCR2_PASIZE, cfg->arm_lpae_s1_cfg.tcr.ips) | FIELD_PREP(ARM_SMMU_TCR2_SEP, ARM_SMMU_TCR2_SEP_UPSTREAM); } -static inline u32 arm_smmu_lpae_vtcr(struct io_pgtable_cfg *cfg) +static inline u32 arm_smmu_lpae_vtcr(const struct io_pgtable_cfg *cfg) { return ARM_SMMU_VTCR_RES1 | FIELD_PREP(ARM_SMMU_VTCR_PS, cfg->arm_lpae_s2_cfg.vtcr.ps) |