From patchwork Fri Feb 16 14:40:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 202146 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp558045dyb; Fri, 16 Feb 2024 06:41:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLwquVNAuWiCDdv8hQJePpgC/bobHhdi7PFp180kIir+BqUpn8ePNI9oc6aGzQLUaajoQSjI49OT+EY5exAyykBOo61Q== X-Google-Smtp-Source: AGHT+IGE7o9bdD2zVY2PnXlFTDUDmj6U6P7UyTbLdgV/VzOvcjb0tKx3flTawDAHMsqXiyf2am2Q X-Received: by 2002:ad4:5fc6:0:b0:68e:ed2f:318d with SMTP id jq6-20020ad45fc6000000b0068eed2f318dmr6455051qvb.65.1708094487441; Fri, 16 Feb 2024 06:41:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708094487; cv=pass; d=google.com; s=arc-20160816; b=gyqIUeQ9fbokQ93NiMaA8x8uKse7SKb8zAOB3pi2pJS7R6ByIfNW24APK2120ayLLQ iic+LSPEysTVATjE7EXw0CheJmPcF4Zwlh3sRSz7xOKtM+FxBxkW33KUg/IdD8vjqeuF nD7pVQs8ZuJFro2gexfF2n+LR0KMX8xIxe2m8fSEuINZ5h5UbD8+okATUplmCOFKJC8M K8mLIcQ86JJNBBL7qS+G9XHdWKTF/aNN3QGcxAIRNHSSJ+v6OYn4Q3WB6C6K7XNfAlIS LWc18Z/1Egmo3KpkBVB6K5/6RBgQd0n6+/q3P3qhM6ai/ddG4h5zo9sqIC5WnJJuuvBN Wu5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=asD3ev0Cb3OxFqrbvaOTmglMW6LCxeDZuldyNVrUzqM=; fh=Y++nkgCoWGSAWlDFYjyb2SyUoBO6nPeekD27HQxubYg=; b=oL2XBT76h0tqK1dvKhrhpmS1Zgbyk8dNfHdn7TxUkLNmPDmn8hBnw73C0mOTbRJgXa e3PI1sIBmafTqr4ZYQTtKTCBf6U3OurpVBlsCXAHAqeVC6ry3OMLAZXNZU3Gp0vmDGxE wuT6w4FoRwujjjV0tfisAg5LNlxTeDRw9K6t3MK6fLGJ0hZ05DVK1soGJt3RmfVAI0lX ESaZAnDH4OlBQLOFRebWT3aKBFyxbpQ57iH6FMWHt43JtV7EQeldj6uCjUFCn2LHyui7 ARQ9/rQyrybNwm9Doex1eSlbWDo+D2MDl2TaSKHPXl1tT0cYXmsDiqEpY7zXUlTkcNm4 O75A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMBaU6me; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kl24-20020a056214519800b0068cb7dfd788si4073808qvb.341.2024.02.16.06.41.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:41:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMBaU6me; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-68751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3025F1C21CC2 for ; Fri, 16 Feb 2024 14:41:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA28712F5BA; Fri, 16 Feb 2024 14:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HMBaU6me" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1389C12F369 for ; Fri, 16 Feb 2024 14:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094440; cv=none; b=PydZGaL0K6ISe5T0TxQ+Jj4yYNyww5O9V3zR58AoM0zjQ0tLfWJXmqnB3mAfXgAGhPwW6EfwuwabdHg4jhicIXsf4e510vGv8JOrvrYBbdp3Q3dTEF8eMhyGY7WOrP+mIfObBF23t7ROKXbHoFlN9ErbdY2irBrhArC4Ow1nt1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094440; c=relaxed/simple; bh=JRNY0w7Ro2R0aulceus9kSJUlVFLy2lL65NJT4HL82U=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T8OS5xYrTUhXoHa3/+B2ymlu37hBz7cHC49Q/0naAAv6Lpebdt/vJJzyEuCUAwvLKwegbF7799qFmHQmH2zaO0CvqNAhwTmDI96xmKRRltsZ5ZC0o0RG8Gua9ae2Ewq+IT2ndxP3+qlmriKD8AodaaDVimlmzddUOoCyTPI3ExI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HMBaU6me; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-563e330351dso988650a12.0 for ; Fri, 16 Feb 2024 06:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708094436; x=1708699236; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=asD3ev0Cb3OxFqrbvaOTmglMW6LCxeDZuldyNVrUzqM=; b=HMBaU6meM0zNFQx8a9qVCgBMTlIgdLdcpZA4R7rBTUt0icL5+6V4gr4mQxSwK/cJN9 Mbm6PDM2lU88SRDLKHL4Kop0MMe4om6ZsKAKJpHAQmczJJwxvtAZXsXQKYUUZe1Yyv/6 VKX/RWrR6gbEb0UKEjR5L/11s0GJaOpQTQ+JG/S0ZKuc6j5qJ6tq7DYngDXf+Uj4/r3b Wi4r/8GYa5d+T3WQW30x1uXOHwAECEdBeg6OzhKPTdATJTqaiQhIz+oLMtsiOI4d76gU 50/XwMAoSY7T+5as8AillwaOru1Dii7w5OAEcPdmtNoU0tMIn15dW6GfjkkzbmHvDtN2 w0yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708094436; x=1708699236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asD3ev0Cb3OxFqrbvaOTmglMW6LCxeDZuldyNVrUzqM=; b=a+CJZvMqmzsMF35jonoaB7OkdQr2m0+N/YoCk3ULTfHbCjfgLfrlB4cc/slonCOE4v +kGZ4j+edWWwj+0nlnRl27CxZFTSnPCVarlJ3N6lsRC4TDjISv8XwK2E/16LWaEwyrEl j8SWhbM47Yu48bcXy1tMcbJ52rbb8t28TNbMoyic1x38RRE885x6NaMXxnCQJzbR3Wcj f0IPsLDr9aeNmQJkDG+/rQbvVy5f8Ncyp6dcXeEWx/6CPL45yWJLUcEuyeIOoYBjheIm Shy2Hn4NRjSJiRmr3fB74xOn00RJGGEfwK7SgkA7hjUtfAcZFOlg59VW6cCIJySrOVJr Jbnw== X-Forwarded-Encrypted: i=1; AJvYcCUU7JqQIlRklrEeZQBUtxl8CM4B5AwjfV4q8Ejx3hn2dUNpfr1uak+iixL3RDlZKORGFJWL+bJrkVqVpFwccD3qDUGKhSBonsGbK02E X-Gm-Message-State: AOJu0Yy0cDTWwd34ck86JgIapqhRrlICeaUOkv+kgIN8Fpbh8czoHF4f jBTd5sDmPjsfZJ0biLQmudkIa9IZnoqG6q6mFPfOLnrbeqw+lVP7jLXmX7DYNDQ= X-Received: by 2002:a17:906:7d86:b0:a3b:f054:92a2 with SMTP id v6-20020a1709067d8600b00a3bf05492a2mr3792983ejo.59.1708094436519; Fri, 16 Feb 2024 06:40:36 -0800 (PST) Received: from krzk-bin.. ([78.10.207.130]) by smtp.gmail.com with ESMTPSA id a8-20020a170906670800b00a3ce3c5b2a4sm1592942ejp.195.2024.02.16.06.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:40:36 -0800 (PST) From: Krzysztof Kozlowski To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Joerg Roedel , Will Deacon , Robin Murphy , Rob Clark , Marek Szyprowski , Krzysztof Kozlowski , Alim Akhtar , Bjorn Andersson , Konrad Dybcio , Yong Wu , Matthias Brugger , AngeloGioacchino Del Regno , Heiko Stuebner , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Krishna Reddy , Jonathan Hunter , Jean-Philippe Brucker , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev Subject: [PATCH 3/4] iommu: constify fwnode in iommu_ops_from_fwnode() Date: Fri, 16 Feb 2024 15:40:26 +0100 Message-Id: <20240216144027.185959-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240216144027.185959-1-krzysztof.kozlowski@linaro.org> References: <20240216144027.185959-1-krzysztof.kozlowski@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791066884958827965 X-GMAIL-MSGID: 1791066884958827965 Make pointer to fwnode_handle a pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/iommu/iommu.c | 2 +- include/linux/iommu.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 26a31ba4f72d..a1f9bb8fa041 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2987,7 +2987,7 @@ bool iommu_default_passthrough(void) } EXPORT_SYMBOL_GPL(iommu_default_passthrough); -const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode) +const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode) { const struct iommu_ops *ops = NULL; struct iommu_device *iommu; diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 600fc6e6f308..269ef0af7f20 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -903,7 +903,7 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, const struct iommu_ops *ops); void iommu_fwspec_free(struct device *dev); int iommu_fwspec_add_ids(struct device *dev, const u32 *ids, int num_ids); -const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode); +const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode); static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev) { @@ -1253,7 +1253,7 @@ static inline int iommu_fwspec_add_ids(struct device *dev, u32 *ids, } static inline -const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode) +const struct iommu_ops *iommu_ops_from_fwnode(const struct fwnode_handle *fwnode) { return NULL; }