From patchwork Fri Feb 16 14:40:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13560113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAE61C48260 for ; Fri, 16 Feb 2024 14:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZRC42YbuNYRdIwcaj+US8j1sKLD+6CzDw3sU7mb37/4=; b=26CbSBOTerDvK6TaHPocRNFKvu JsWV1FqLVPL/HRAv5wbtnFVfBUOtimfS1JWux1awfKKfscxcmBhrVa8YCSgZ2CvQKjKYa7GL1RxLQ B4dTGcY9kkwSmV16hkfbGx/GGWYN5DKq9rLAQ0VmXR2EQTk+LBU5eB622rZtzs6G4E2I4tEMur8gV 0OuDXssAc7LDyXpKQpLi1uEbUkxkZhDQZYXCBgLnyYOQQbgmHIP2t9KWza/Jmt2fmFJ8y15nrNKe8 APOJm9vCluScK5kaEy3N1RlnoPJJjTaDazITa5dcLI5jj9VYYeSbaGXt/k0DtKoV8+ecbL4TxJnBN sgh3XT4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOK-00000002cwq-09n6; Fri, 16 Feb 2024 14:40:40 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOG-00000002cu4-3DBI for linux-mediatek@lists.infradead.org; Fri, 16 Feb 2024 14:40:38 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a3dbc5d22c3so140129766b.1 for ; Fri, 16 Feb 2024 06:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708094432; x=1708699232; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZRC42YbuNYRdIwcaj+US8j1sKLD+6CzDw3sU7mb37/4=; b=tAJmQgjknWrkqyT9Gp6rSeUpOPI/SpT2US/q1aSTcqcDDR4HLRzZzecZCoBUFXNmIX n06ZXVa2ANg77iQ69a5I/xM2/HXFtJwV4mL49S7ReJuEjfCoRB4W/Q0mxefUVnLSu18S XkcXH4KimFvQX+juIHD0oz+E74nz9hoNwoVu8EAiQQX/Zz+aVaT5hW9Tp3copZr0VM4s 1y2LnAvQOzKv1Ib2tBogk8WYlPM7gcjNS26dO1R2VGz6J1L2JhlIrPoNHJrhUcO/sQuU 4/DJLF09CfO5gFEt0re/StQciirfy4BoARksBBXoqkUBO+ty6EapN9m9Ia7XKzuoyA4Q ubww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708094432; x=1708699232; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZRC42YbuNYRdIwcaj+US8j1sKLD+6CzDw3sU7mb37/4=; b=Tff1d5BKD6YIWqFmjskKvl/tZ2VgH6GwofkgvAXSkeY1cOuek+pINbdY6kvFLJ4jzO M5m1h1raIwq/1iENc5UYCLDwDNPBPscruEzD4Dk+Gx1E4KA3KjOXlp13y3vywmPs8MAi oUzSe4Jt2qZBJhbaseEVHl0oXHXRKLlNuYzDWfs/A1wvgQa47qnMIISRebtUNx/rJTzK ocGpDS1cC0dXaL29pCU8zV4Y3bD/yYy0RjW7nRwVWO3wBm91DKWn/EJkSP2At0vKDCrF LPZuMsyknDV+E2cKi8PnEzmvqT9kWwknZjA1ZvDM3hfg2NC+4avpGfsPcxso3m8s1vw+ EY5w== X-Forwarded-Encrypted: i=1; AJvYcCVcdwqark3/TEQWP7UEYpp8Uadjvuw17rdd9rbxN7eK/CkiqKBlf8E7AnrEjyvm7jruF1BtBxblMRJ4DdnzpRARIkwE+1SO1tLlN2APNIRCaKJN X-Gm-Message-State: AOJu0YwLXaULpAclYZJrw0wyc17tiU27QLraKqVaDxjHCfrHndh4QQ98 a1qni6OLMCnFtMp4R5B5NxYF124A7/+yRNIf+Np+CyxcGfPdFP+8I8DfJCdYQv8= X-Google-Smtp-Source: AGHT+IHf//9yt3eTnyw6VXgXdUG6tjNHVGPCN0at0VvNZn01LUmWCi7a4swsg2sOshpZkHrmmM9UNA== X-Received: by 2002:a17:906:185a:b0:a3d:994a:791d with SMTP id w26-20020a170906185a00b00a3d994a791dmr3667044eje.59.1708094432164; Fri, 16 Feb 2024 06:40:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:40:31 -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 1/4] iommu: constify pointer to bus_type Date: Fri, 16 Feb 2024 15:40:24 +0100 Message-Id: <20240216144027.185959-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_064037_015620_E5C90BA2 X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Make pointer to bus_type a pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lu Baolu --- drivers/iommu/iommu-priv.h | 5 +++-- drivers/iommu/iommu.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/iommu-priv.h b/drivers/iommu/iommu-priv.h index 2024a2313348..5f731d994803 100644 --- a/drivers/iommu/iommu-priv.h +++ b/drivers/iommu/iommu-priv.h @@ -21,10 +21,11 @@ int iommu_group_replace_domain(struct iommu_group *group, struct iommu_domain *new_domain); int iommu_device_register_bus(struct iommu_device *iommu, - const struct iommu_ops *ops, struct bus_type *bus, + const struct iommu_ops *ops, + const struct bus_type *bus, struct notifier_block *nb); void iommu_device_unregister_bus(struct iommu_device *iommu, - struct bus_type *bus, + const struct bus_type *bus, struct notifier_block *nb); #endif /* __LINUX_IOMMU_PRIV_H */ diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d14413916f93..170329a085b8 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -291,7 +291,7 @@ EXPORT_SYMBOL_GPL(iommu_device_unregister); #if IS_ENABLED(CONFIG_IOMMUFD_TEST) void iommu_device_unregister_bus(struct iommu_device *iommu, - struct bus_type *bus, + const struct bus_type *bus, struct notifier_block *nb) { bus_unregister_notifier(bus, nb); @@ -305,7 +305,8 @@ EXPORT_SYMBOL_GPL(iommu_device_unregister_bus); * some memory to hold a notifier_block. */ int iommu_device_register_bus(struct iommu_device *iommu, - const struct iommu_ops *ops, struct bus_type *bus, + const struct iommu_ops *ops, + const struct bus_type *bus, struct notifier_block *nb) { int err; From patchwork Fri Feb 16 14:40:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13560114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87D62C48260 for ; Fri, 16 Feb 2024 14:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WJiF2hWzkU3/F88EHjNDrbxkoRCZ4txRyg+xgBcF7fk=; b=oIl8c92s9eLAWuCAkniPJbxSn6 jC3Lu3QrIPEA0T5BzvI0dil5I6/IRAM8w4EJ0HJkMyLE+YWYlYktzsMw5YBLG9/TKe2k0J/7FvK7x mnQsuXReqzkxJqYYxrVevOaZ/J5ClhGwDR5Efd9gefEq8QIamj6FqvaCLyJ9ZqpqItz/S/wzXbXn7 69p8zSgjKqS11dtiPPdw9T1dDHcXJNVjP9h1suHGNCjEtCLfC32J1KGTbMcPTko/UnjNdY/m5DG3S drUv6l/p7SGXYmJCEEc1QFpWZP92oC3Zx6TONbUAtOACvB2FAUtKWVAwxjN/3eW1f8owWf6vjJHGN Ad9zVelg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1razON-00000002cz5-0G7Q; Fri, 16 Feb 2024 14:40:43 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOH-00000002cu9-0VVT for linux-mediatek@lists.infradead.org; Fri, 16 Feb 2024 14:40:39 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a3dfb2e03e7so39050366b.3 for ; Fri, 16 Feb 2024 06:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708094434; x=1708699234; darn=lists.infradead.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=WJiF2hWzkU3/F88EHjNDrbxkoRCZ4txRyg+xgBcF7fk=; b=Oi4aRv6+NDeZqbPwdnL5SpVb9M22p9S3eF1j1vN7lBrTlnhdSa8mgw3OodVTyTG9qg UQ5jzEBkymmEcWXDF8UDEq7ROpuSP/Ef3gSBLKx4Mm+eHD/1Vd4WPvH4qzUJw8RgDgO6 qqi3+HARTAMnWhqlQB9JnbFSzxowflEAWu3yWyrkK6nSuPW+J/OzY5429fpVE7O7KLYs TsxTlJttN4yEjISPMZvO5uE+gdaE0oBW3iqJh6R6mVWKTRKoTG/HRiqs8SgYdquAc+oj fHbNnT7hI/Tc2iGdNWERziKGJXatR0kYIIwd9wJDhxB/r6yX2v9azW8n0rEMF3kAqfP7 6qMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708094434; x=1708699234; 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=WJiF2hWzkU3/F88EHjNDrbxkoRCZ4txRyg+xgBcF7fk=; b=e2Mxs8Y0502NHpn8IRIP+rE1fOfjy1n96fjs29osNCJm1xLDMXgidfDo8MPEhn/Wah taOBzqsoGhLikV8YploD2nWb6PoNnyDFPLV+pGssA8Oe0MBMvD+PsglWOgMiGiYDGwva /OC7CY08YD1Aosax9OI5FJvruFQSl0Yw6D9AUYWxov3o4eO5XLA8r3CpnqwtAXh8eSht s5J7iFVkZMamaWOJ2iJyFTipxyfj0Lpz4Sa8qxYP/kbLLVNTdbRRPqOUd22uT1y1KbTy 7RDOSUqkxrsueKRWK/yQ8QXbVnxF242U447XrIXSztRKvapUnjYEgLLjN6l9/kAoIDhY rSXA== X-Forwarded-Encrypted: i=1; AJvYcCWtRIkBU7LI3Vj1elJcJhkUcG1ZKMw04+AzQe2bC5YOzedBKKdsZMO2NlJF82+nbeJyH2+J9tBKCXptU4Ix/7n4a8jiYLn9klLHT/uQEWC2p3L9 X-Gm-Message-State: AOJu0YyEDI9eLH3cFTJ90n7pHB+slbJPq/T7anWWKNKDa8cwGBmehsAo h7S/M5hRIk2pH74fDsTNVLSyYeGdAZia3l+m0gXppCkgkQ+cTbt2jT/KfELqsEQ= X-Google-Smtp-Source: AGHT+IFP5HHX1guzF/48MOqdlDZBBAfEIzlz2cxyflX0prrbUITF2QEfGuDa23nujSq4oJPlrwTGyw== X-Received: by 2002:a17:906:2c0c:b0:a3d:ab64:7525 with SMTP id e12-20020a1709062c0c00b00a3dab647525mr3120223ejh.11.1708094434431; Fri, 16 Feb 2024 06:40:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:40:33 -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 2/4] iommu: constify of_phandle_args in xlate Date: Fri, 16 Feb 2024 15:40:25 +0100 Message-Id: <20240216144027.185959-2-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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_064037_206975_70EC01E9 X-CRM114-Status: GOOD ( 16.51 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The xlate callbacks are supposed to translate of_phandle_args to proper provider without modifying the of_phandle_args. Make the argument pointer to const for code safety and readability. Signed-off-by: Krzysztof Kozlowski --- drivers/iommu/apple-dart.c | 3 ++- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 ++- drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 ++- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 3 ++- drivers/iommu/exynos-iommu.c | 2 +- drivers/iommu/iommu.c | 2 +- drivers/iommu/ipmmu-vmsa.c | 4 ++-- drivers/iommu/msm_iommu.c | 4 ++-- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu_v1.c | 3 ++- drivers/iommu/rockchip-iommu.c | 2 +- drivers/iommu/sprd-iommu.c | 3 ++- drivers/iommu/sun50i-iommu.c | 2 +- drivers/iommu/tegra-smmu.c | 4 ++-- drivers/iommu/virtio-iommu.c | 3 ++- include/linux/iommu.h | 4 ++-- 16 files changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index ef3ee95706da..eb1e62cd499a 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -779,7 +779,8 @@ static void apple_dart_domain_free(struct iommu_domain *domain) kfree(dart_domain); } -static int apple_dart_of_xlate(struct device *dev, struct of_phandle_args *args) +static int apple_dart_of_xlate(struct device *dev, + const struct of_phandle_args *args) { struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev); struct platform_device *iommu_pdev = of_find_device_by_node(args->np); diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 0ffb1cf17e0b..4434d6a2fc2f 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2739,7 +2739,8 @@ static int arm_smmu_enable_nesting(struct iommu_domain *domain) return ret; } -static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int arm_smmu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { return iommu_fwspec_add_ids(dev, args->args, 1); } diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 68b6bc5e7c71..8e5e4ab5fad3 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1551,7 +1551,8 @@ static int arm_smmu_set_pgtable_quirks(struct iommu_domain *domain, return ret; } -static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int arm_smmu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { u32 mask, fwid = 0; diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 17a1c163fef6..e079bb7a993e 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -546,7 +546,8 @@ static struct iommu_device *qcom_iommu_probe_device(struct device *dev) return &qcom_iommu->iommu; } -static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int qcom_iommu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { struct qcom_iommu_dev *qcom_iommu; struct platform_device *iommu_pdev; diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 2c6e9094f1e9..d98c9161948a 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1431,7 +1431,7 @@ static void exynos_iommu_release_device(struct device *dev) } static int exynos_iommu_of_xlate(struct device *dev, - struct of_phandle_args *spec) + const struct of_phandle_args *spec) { struct platform_device *sysmmu = of_find_device_by_node(spec->np); struct exynos_iommu_owner *owner = dev_iommu_priv_get(dev); diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 170329a085b8..26a31ba4f72d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -3038,7 +3038,7 @@ void iommu_fwspec_free(struct device *dev) } EXPORT_SYMBOL_GPL(iommu_fwspec_free); -int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids) +int iommu_fwspec_add_ids(struct device *dev, const u32 *ids, int num_ids) { struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); int i, new_num; diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ace1fc4bd34b..cd7219319c8b 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -709,7 +709,7 @@ static phys_addr_t ipmmu_iova_to_phys(struct iommu_domain *io_domain, } static int ipmmu_init_platform_device(struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { struct platform_device *ipmmu_pdev; @@ -773,7 +773,7 @@ static bool ipmmu_device_is_allowed(struct device *dev) } static int ipmmu_of_xlate(struct device *dev, - struct of_phandle_args *spec) + const struct of_phandle_args *spec) { if (!ipmmu_device_is_allowed(dev)) return -ENODEV; diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 67124f4228b1..d4c0f2ad184b 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -588,7 +588,7 @@ static void print_ctx_regs(void __iomem *base, int ctx) static int insert_iommu_master(struct device *dev, struct msm_iommu_dev **iommu, - struct of_phandle_args *spec) + const struct of_phandle_args *spec) { struct msm_iommu_ctx_dev *master = dev_iommu_priv_get(dev); int sid; @@ -616,7 +616,7 @@ static int insert_iommu_master(struct device *dev, } static int qcom_iommu_of_xlate(struct device *dev, - struct of_phandle_args *spec) + const struct of_phandle_args *spec) { struct msm_iommu_dev *iommu = NULL, *iter; unsigned long flags; diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 7abe9e85a570..955de8fb7732 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -957,7 +957,8 @@ static struct iommu_group *mtk_iommu_device_group(struct device *dev) return group; } -static int mtk_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int mtk_iommu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { struct platform_device *m4updev; diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 25b41222abae..ae16d8238d84 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -398,7 +398,8 @@ static const struct iommu_ops mtk_iommu_v1_ops; * MTK generation one iommu HW only support one iommu domain, and all the client * sharing the same iova address space. */ -static int mtk_iommu_v1_create_mapping(struct device *dev, struct of_phandle_args *args) +static int mtk_iommu_v1_create_mapping(struct device *dev, + const struct of_phandle_args *args) { struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); struct mtk_iommu_v1_data *data; diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 2685861c0a12..da79d9f4cf63 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1140,7 +1140,7 @@ static void rk_iommu_release_device(struct device *dev) } static int rk_iommu_of_xlate(struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { struct platform_device *iommu_dev; struct rk_iommudata *data; diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 537359f10997..ba53571a8239 100644 --- a/drivers/iommu/sprd-iommu.c +++ b/drivers/iommu/sprd-iommu.c @@ -390,7 +390,8 @@ static struct iommu_device *sprd_iommu_probe_device(struct device *dev) return &sdev->iommu; } -static int sprd_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int sprd_iommu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { struct platform_device *pdev; diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index 41484a5a399b..decd52cba998 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -819,7 +819,7 @@ static struct iommu_device *sun50i_iommu_probe_device(struct device *dev) } static int sun50i_iommu_of_xlate(struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { struct platform_device *iommu_pdev = of_find_device_by_node(args->np); unsigned id = args->args[0]; diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 310871728ab4..14e525bd0d9b 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -830,7 +830,7 @@ static struct tegra_smmu *tegra_smmu_find(struct device_node *np) } static int tegra_smmu_configure(struct tegra_smmu *smmu, struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { const struct iommu_ops *ops = smmu->iommu.ops; int err; @@ -959,7 +959,7 @@ static struct iommu_group *tegra_smmu_device_group(struct device *dev) } static int tegra_smmu_of_xlate(struct device *dev, - struct of_phandle_args *args) + const struct of_phandle_args *args) { struct platform_device *iommu_pdev = of_find_device_by_node(args->np); struct tegra_mc *mc = platform_get_drvdata(iommu_pdev); diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 34db37fd9675..04048f64a2c0 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -1051,7 +1051,8 @@ static struct iommu_group *viommu_device_group(struct device *dev) return generic_device_group(dev); } -static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args) +static int viommu_of_xlate(struct device *dev, + const struct of_phandle_args *args) { return iommu_fwspec_add_ids(dev, args->args, 1); } diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 1ea2a820e1eb..600fc6e6f308 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -468,7 +468,7 @@ struct iommu_ops { /* Request/Free a list of reserved regions for a device */ void (*get_resv_regions)(struct device *dev, struct list_head *list); - int (*of_xlate)(struct device *dev, struct of_phandle_args *args); + int (*of_xlate)(struct device *dev, const struct of_phandle_args *args); bool (*is_attach_deferred)(struct device *dev); /* Per device IOMMU features */ @@ -902,7 +902,7 @@ struct iommu_mm_data { 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, u32 *ids, int num_ids); +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); static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev) 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: 13560115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0269C48BC4 for ; Fri, 16 Feb 2024 14:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=asD3ev0Cb3OxFqrbvaOTmglMW6LCxeDZuldyNVrUzqM=; b=s8kF/hW6UPSNubPt/3Wi4yiVK0 fUIu6MBKXjBEROSkuJW4OtLsFHyT4YlH27ylRFapyKK+PLT5tFZuxvBPmfMW92A7E4cWdIXLlSKuw 1KbFW7YIW03BzlLsCWIv0PWsD9+7AbZ+6DeFgp9H6e1MmZuhjuXHoL4T+Jd3KU54kPkwl3ATj4u+/ 5wX5JzPzJSyxsi7TncKXCU9dou25YlJCYIuc0+/w0obx8yCmjZRXDnUsymODPnk4VUesdZ8aBARuP v0DIMZD3imFNExo+HszTQwUN+GYZtY0AXF7OoWkdqhRxzKlsYR1MSYXHbJ00Hidy4Td1QVLYt0Y3W KN72aYLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOP-00000002d0n-1PEH; Fri, 16 Feb 2024 14:40:45 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOJ-00000002cuH-0S9D for linux-mediatek@lists.infradead.org; Fri, 16 Feb 2024 14:40:41 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5639c8cc449so1089061a12.2 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=lists.infradead.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=fRamExgkMlquA19O6LY6eJ7u/zRvLeILyIazS4CCrOtqyfDwcViy91Dv5lJ1s20bvz WuvamX4pE6W/aaKVdzMpT07uxzSW78NDZnwPXlGdWqzWn54jA14QIPPRqRXKFL8nwVSo pDDwEWpeAn/V6oZb3P5h1H/1MUMy4BRUjYqWJkTtwaFwPBWdMy99LtfZZ6AYykeTfybq j/a4OdrEoZKonKU4cIQCLMFCc3QcUChdKUIvGZRcXaZ0oZluWQ/IqaGKSIATo+un5eRK 4AhriZgErNjdNpmVXTAo85JEAkxKfzkNBiwlgwQuFatgBF7Fp29EaAWFQJWO55WZjvd2 tHCQ== 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=ZhxutvhTQFJFHoAGdkjPiCitUH1zEjtn0h+8uPlqwnbMYEKBhbjiCF8jNQuBJ9ow0+ aaNJpz9C3JFApcc2EdTuBWeKCGNyZAbbsi2dtj8YFSpJG8JDT2JzCK+evbwVRoGSpaOQ F75cP8Vk7xUEzF+Fo255TV6i7JJ+o2V9qBRJnlcbKBXsBEmy/Wc/zunT4Pmm/c3+evQJ cgxBMXhO0bjlggy/7l+8qNHwsvsGrdP1JFRDm8NIwG6CoPcoXYOvC4J1/C0JlIAvdAmE sBHX2l0edOX7Vgf+7/HmSovMFtvLb7qvwyJxh1121kkPwFzsnqNyfH0TaV9y//qdvWkM uG3Q== X-Forwarded-Encrypted: i=1; AJvYcCXRyHyVfdadpKvNf2BCE4UYM9hY5uvcgMN7VZUn0NK+A7F6J6FbKOgYrOiCFHg0eJsjy/SY/e/civ214JwQZW7dbVD8ZPG1dnmQwOKS1D1egadK X-Gm-Message-State: AOJu0Yxeo/RYDPC6gu2YSKEzDEHFPryOvCpCjuxN7csqLZCdPlNZacAm kZDq9eK372YpYqM1S0TXUlNDhYml5snSvOXRxpYPUQEdOK83AyIPt3JrASB0yAs= X-Google-Smtp-Source: AGHT+IGCyUGN+VLUaRlt1OZxHWuQFmwSgWLlGY6S3fHlEaQRS780PIZW2GJtYg2x+OIezg266xrJrQ== 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_064039_198907_C4C2130F X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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; } From patchwork Fri Feb 16 14:40:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13560116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9A05C48BC4 for ; Fri, 16 Feb 2024 14:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ddHRp/a7ql2hO4wtU3P1Kr5z86y1yTWMkn8d+hM85z0=; b=3mh9SmSh1wszlpin6LETpa7rEP Bj77ghZdy+wUrTkxfc3QmWOb42D1ggC2BTiTaYlciNKsI1T6/Y70FToRZX+uix5fZrqbRq6j2nk0F GNZ7UKXgHles43lvIIYpeM4U8ct7mtoUbLntkXMqmOVAxfZEXvRioOdPEGUCpu5hmkhPiEICLHfrx MXadBp8KfuGTO53+29vkRkaLvLTkttBOQLhvsRD5ZvBhxueu18etFzpa80zGWkSaiPmjjvvVD2ThC uYOd7voPdQZgr2D0lDgtbwDtbHYn0Iw9sYGBP+UTb5lXswTkDPViO+QyG/W3RYmLiTCUUg/LFp5j7 gpkhW9pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOZ-00000002d9U-33ph; Fri, 16 Feb 2024 14:40:55 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1razOK-00000002cwp-3RzX for linux-mediatek@lists.infradead.org; Fri, 16 Feb 2024 14:40:43 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a3d82926ed2so105038266b.0 for ; Fri, 16 Feb 2024 06:40:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708094439; x=1708699239; darn=lists.infradead.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=ddHRp/a7ql2hO4wtU3P1Kr5z86y1yTWMkn8d+hM85z0=; b=mALWrGfCuanbZB4Sbwbb2rGhCZUe6wqvI6Oghn7Q3AdtI85qf9eGn+eWJrZiEZE+89 5buvZln+dPVfAn9aKeenu6C6m7k4BDIY7DAImvTTG1rvr9RVKqjD0+zZlyrgCpx5MTbc CaLmp6UqDJUpYMAnzp1RAbAnTzQlPSwuRmPWUjxbiLQ5Y9AZyHvgVLyzRkYY93oJXQoI p+2xvgbqJ7y7w+XmNMz2++dooJ1ERIWYvk6konGp313vVrWs4pfPQDaEhfHyF7Ywu1Hh zLLZdCMLfBV+GNjA6h7EDr9Q5kmGgQzwhGzPgEzdlK7hNTAoE2RdxPEVJGPT7tFPslet 1g9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708094439; x=1708699239; 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=ddHRp/a7ql2hO4wtU3P1Kr5z86y1yTWMkn8d+hM85z0=; b=dF+tMshl1sNWoEVUo5E7ZECoWiRrbf7N1XcLODI039a6iLWatD0Ia0GhcnPNr74XdI 8C+HISYNgDyNUNXE3+qqTZCOFFQL/cqQ07PbsH003fFM3QCNG7QtPv3CUudV7e4Bh6dM Fjk3pB4Jnb4Mid2QKGAciws/lTxGZATGd7D/xXNxHTKf5K3d7IPi1BSVYQsju37y0ijb KVS0o5u3zo4xa6Fp2Kx4iDF5yo+2mWWPB3fDxpvD2mdQ5Z8SorDomjC7DiFpRT6VKu+O Jy7xopkdZYOlYrB6uiRX7o3572pil4R3KzYqZuCJHntwnuNNoSAAY2L0/g6Z0pHPG8Jy DkWg== X-Forwarded-Encrypted: i=1; AJvYcCW80QAEBbe6gd/erLVUVO7qsncfri5Q6He0COnJiwd1LXbx8+MeZX+unK9GIyBXlx8KgBrQT9EYxWiFSHWvfgE3lJYZ+0H6KRzHPHxtHcSxzDSY X-Gm-Message-State: AOJu0YzI7a41KGqM3yB7/ViyuVywsCnUvqMwM3VXMiDP+NMn1TJp3ikA aZaxRRFPNHSwbTVCWj8SQIbABHcBuA8/uaqOdXXWAqJnA4KIZHDLfdWxcZ9xhUE= X-Google-Smtp-Source: AGHT+IFjUr0pwHx7I9NJd2MhgZLwiZF/Q3I4EAlN6VBXxRxf0gB7BEu6U93gT2kjFbtxE6rZ4t4ByQ== X-Received: by 2002:a17:906:d7bb:b0:a3d:704:d688 with SMTP id pk27-20020a170906d7bb00b00a3d0704d688mr3675983ejb.47.1708094438802; Fri, 16 Feb 2024 06:40:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:40:38 -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 4/4] iommu: re-use local fwnode variable in iommu_ops_from_fwnode() Date: Fri, 16 Feb 2024 15:40:27 +0100 Message-Id: <20240216144027.185959-4-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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240216_064041_057162_846CFB40 X-CRM114-Status: GOOD ( 11.78 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org iommu_ops_from_fwnode() stores &iommu_spec->np->fwnode in local variable, so use it to simplify the code (iommu_spec is not changed between these dereferences). Signed-off-by: Krzysztof Kozlowski --- drivers/iommu/of_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 719652b60840..3afe0b48a48d 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -29,7 +29,7 @@ static int of_iommu_xlate(struct device *dev, !of_device_is_available(iommu_spec->np)) return -ENODEV; - ret = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops); + ret = iommu_fwspec_init(dev, fwnode, ops); if (ret) return ret; /*