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: 202145 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp557785dyb; Fri, 16 Feb 2024 06:41:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWs3TsaO+9UFMzfjARKOU0qX+jODh5f1oY0sH+gZzV/kHCa7JSpJM1SBPLp50eDZF5i4vGlNkN5K6wau0+dzwzs8Xctwg== X-Google-Smtp-Source: AGHT+IGKtEHpWtklvYuus7K0KysdU/b08jMstBYWxr6zEajs8Pys+lhdNfj8Qz2Us38NB4wWu0UU X-Received: by 2002:a17:906:3b51:b0:a3d:7c4f:9c4c with SMTP id h17-20020a1709063b5100b00a3d7c4f9c4cmr3868964ejf.63.1708094460016; Fri, 16 Feb 2024 06:41:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708094460; cv=pass; d=google.com; s=arc-20160816; b=Iz8/fwUHZbEAxDl/pI/8Qeg4qQyZa1dtaBGMqYUVygV0RIOwPRKxc0keZWBZiCI5XU cPoIYElOWao7XUxR1Q/dpZd5cOUjRz6EooPEu2ywh6HgcbIwtzDj9zNT0EbzOD0m2Due oA4djzYaiqcKPKXNSU6vQLOhQj7TkNYg/QGW2aT4lQjXToA9iM/Dje/xnfl3zsEAqWt5 FpawajkySktPviymY00VTpGKmknAzsnp3SNAD8budcHDIF/W8NQqPtP926fmi50+VUw1 Gcx3ABeNY2wF4vxlJqsc3YjmfbTrfeYSQCJvRslf3hJPjTK8P9zlRwmi1Wg2CeWToq/Y 0emQ== 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:message-id:date:subject:to:from :dkim-signature; bh=ZRC42YbuNYRdIwcaj+US8j1sKLD+6CzDw3sU7mb37/4=; fh=93Zyv7Hl/ZYWFvceA0OhPFEpVRvnvW+o1OAuOxnu6Wc=; b=ysgSO4CP64t7RyYsyHIDg7a3JBoKa5HORrzXACUhAhPdCJf4XNJ7SmXt6pTPU1XfEU aeQK3Kr3d6gHpMJKiz4eHhOf8zK2Lk8RY+2dKroC3un9aAFfFb/J0lqtIDC0HCxna6jX xtmUUXwl/FiD1C6QCttmgCidtAC6vP1tLHU81b/UFtcafx19gW9zRdmXBBEcrk2ealtr 8zg6Bf30n4R2V9hZ3CKcbUmYXix1/chr971Al+QExdvVWeykh4RyGAuJRh+jw77dun5W f/FUWFV98xOzy0Hsw2THDKi8pa+lGwle+/OgTaQlgZQBj8xOsp0uenxQ4KuljlieIyWO 3++g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C6vRSD4J; 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-68749-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68749-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ga35-20020a1709070c2300b00a3df581eaefsi327134ejc.451.2024.02.16.06.40.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:41:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68749-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C6vRSD4J; 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-68749-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68749-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7A34A1F272C9 for ; Fri, 16 Feb 2024 14:40:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B02D12F387; Fri, 16 Feb 2024 14:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="C6vRSD4J" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 D5A3F12EBD2 for ; Fri, 16 Feb 2024 14:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094435; cv=none; b=GJThqHDWT7DSXiu4UwZ9XMglASpHwzzqWfGIn35Wu0RabINJYvlaQXFGw/7hT5QmbAnTBGIlHAo60SR4CePOvXchD0KbiqbZ2A+4vpGmwlCIC7ob/wIFj7sFRaG8fnvW8SnK+C0gogj0QsPMhdPy6dHEFWzwLDw7Zwt1Kaj6eYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094435; c=relaxed/simple; bh=VhhgxqgxNna3VDXzGb+u29de1zzuvgOHxd0eRr4Za/8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=AC4kjSUEZVflTeWyNEnvIS8utMYBNRJ5brYV1ZELiWx5zEe4bmDWFcWMkduayk4E6PvUZ+i3yh4d2/WlDEnmYeFmnRR+LNt1zA+IVeRTSj6yS9FyYn5T3bKD69VrC6d3J15YrSqHK5OhyHETZWdwePF6DcDgyl0lW/KOE8O44eQ= 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=C6vRSD4J; arc=none smtp.client-ip=209.85.218.54 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-ej1-f54.google.com with SMTP id a640c23a62f3a-a3dfb2e03e7so39043566b.3 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=vger.kernel.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=C6vRSD4JJq5VeMpEP/qRigg9X6R76yWVZMsOrj+Tc1BoLlL99PJRhdXCL7JfIyG5GX jCqYQWrKDtOxbjTqzp6frBGY01m/xc0MIHJ5tsq7llV9AxClh/BJH1UexH15Fbrn6jj/ 1ta6q/qIsSOO8XZIMNWh3LjtVanF5H6mCeRsxOzxGNcxH3e7ydzkfp880eOUEdcqf/Zi 0DrgV7iwPy6YcfTijX46hkS8bSz5xioYPguXBptI40L1ZCfSNdNvbfBkvMuN/Y7Vzkkp nYTbWV4wGHkvdigTBChx/xitB18De9uMjTYTUWAgwfE3ZLMkJcLp7kbAfmc3JXapjIGO laUg== 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=acvIYTAPoVhPxFxqzmOgKTg3gHcrgcbjitzpxSIyfc64r+UJm9GWUjjTeFbVtxaoCh BR4HRp6IBFhf/Kk5Lek4flO5D2+S/O8CTIUP1NIqlYNQGEbbpRnFXv4oYR4STyR2Rzvx kVTONh7lCNAksOMFVg6p0Sf2QqIKuUeXGtvIoxNueODiEZzpzNuOo3EI2tpWn2P3XkJA Y1+cmGFEGE2Fm5LXcVmm3bFycV3997oyVYHaPefVtMOTV5BDdPI6UPm6Ue6pYMs84UUZ pmWex1okfJTMKsq7F+lp4rU8zDDtdjq6GRe5JqubPn7Cxxtv0YG9ZQqRICEYTLeqNt/+ dBIQ== X-Forwarded-Encrypted: i=1; AJvYcCURSeqDWIOhHwUnWFL5GbKrO9kTxkFqXs/cHfoVXH6SwYK/kOx3w5bM5g9J2SJbOjkUkHEpDrkBZ5fMG73z+XksmF2lFHsQ71FYmUyp X-Gm-Message-State: AOJu0YzSQEHxEH+2G7hmfnqYqv4DVVginYql73sVnWKt9Vy/qGt+ExLX 9oOIyt/tQPayixR46+DcrRBJzXOraDLYdiq6UuKxBx/p33QuxV3Jix0XPVTafUk= 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 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: 1791066856800658076 X-GMAIL-MSGID: 1791066856800658076 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: 202147 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp558039dyb; Fri, 16 Feb 2024 06:41:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXHOiOw/X1GPqksaaX7dqIxMMPG4ZUCFC18FBtNRe6V+NYvT6xFfienL7Y37af8+XeDQO03zFwvfodFKblcTY5MM1zQng== X-Google-Smtp-Source: AGHT+IH9q8NYSOSLkDpw0OxDaWfhgG0bNMxTANUxSVoOoMQxAJnaf4qIQ321VOnDWDuQPdgo0V/J X-Received: by 2002:a25:2002:0:b0:dcc:9e88:b1a with SMTP id g2-20020a252002000000b00dcc9e880b1amr4453348ybg.7.1708094486954; Fri, 16 Feb 2024 06:41:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708094486; cv=pass; d=google.com; s=arc-20160816; b=TdDl5JHtKtW+RFoqKbEsXwMrThNp572a1b4p48MiqUwr3DwUerTFes+KbuozaFfq5G 3AxeBThKQusFB5mvrJ9K+GjI3uG6vUUqNLPDyzMpCaKlT7xf6zUOHsYDkOxBfsHzSnXe j/YIanrTJMwGRhvtvSzhMHo3b9ByAK5Qq55hV8slw9drbuV78ubPVuC9Ca+KvGI27Jxq qMHWEIPEFdb0PjBfRror0eaFEqOfq0sxCOMwxBxJFMVscqJw5z/F/o8w5ONKvD/YwFaq dI77NZp0EIRRw85Qk90+nUyTw68UwIW8pzKh+alpac4zEs7qfOpdyBYgV8MsPYWr4BV4 YkuQ== 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=WJiF2hWzkU3/F88EHjNDrbxkoRCZ4txRyg+xgBcF7fk=; fh=lZPYXYA2FabavyxT3+9kgVmmhC87svT+QkchGjFe30M=; b=dUkKyL1+cFmLhT37BFb/eAmv6lSijGERAkQKLft42Vi2Yx4pEf/Ha9CvMAruo6t0dm VI0RMGsfz0TlTexL726VydgPgYzt9vxJwUJtUtFKJQfsKEvUIvjcY+/6mieubhGFAuRS 66aOe0i9KjUfIAoLwB4E7i/m6jdhgfxywth+3DIxz8MYuFB/QYodfzu/oh8tga3WyqR7 PULxlpXaYjfp0oNfnHtaEeexk4Ptqu5aKxMuHFpIowbE8Wd3PVzeBQUobjZ7i9yD7WA2 zGnFhNuyfvTgog1NyBv45srS9fwLYGZps5W0cuFiRb8q7DdWUXZxA7RLA0SVHHUzyrWM Q6uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mii7mvRK; 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-68750-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68750-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 c22-20020ae9e216000000b007871fde4dd2si1274qkc.471.2024.02.16.06.41.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:41:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68750-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=mii7mvRK; 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-68750-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68750-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 AC2B61C21F34 for ; Fri, 16 Feb 2024 14:41:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B10912F5A9; 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="mii7mvRK" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.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 0B28912EBE9 for ; Fri, 16 Feb 2024 14:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094438; cv=none; b=GsWByrPogv14UyZkc8os8CornKLQQoH0RrDdutJVyOnsJLrX4s1PEtA3tSfCd7VGUDlK1WMTWRZIFkxErgj1xbUU60/KkQ4bTZiJ4h42LzaQJi95xhlQ+l1WC/NTe2X9m5ZPv5G0w3x6cgRue3Tc++CNkFWAmAbZEEzTWAq5IF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094438; c=relaxed/simple; bh=VNML90UaXktZKuCOd5A/cwVT7pPIGW6JzGtZcT2C/jA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YLMG6fu8XdZLD0nrIz/vriugd/tAHd76nrfP4KpLd61Pa6XT4/FG9C2T7YbyeqiUKROrYv3+am/IReI6J9rQssemkI8VdTTSEVI5/Nq8NqMFaX5bFmC9oWIKCwRzbfk60tIU07kXdOklVGioQ2xUm0+PnS7r0381RhlvbtDtwmc= 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=mii7mvRK; arc=none smtp.client-ip=209.85.218.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-ej1-f46.google.com with SMTP id a640c23a62f3a-a3dbc5d22c3so140134266b.1 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=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=WJiF2hWzkU3/F88EHjNDrbxkoRCZ4txRyg+xgBcF7fk=; b=mii7mvRKOucvBuxIjIM5GEMs/sGckRlO5QTdpWBRvcB6wX4tVTOC39TJQBC3rdV2aF ZWZn/2CxZbbT7Vv6YKxYtt7lIRT1RstFCTkkVh3jNnZSrSO+98aDSFpqH0T0vW1LbTcP 1yYlnTMHfEc/mdvVSh9Cnwzi3g8d3H+aZm86kF9rBwgpVq0gOSztfZd99infuGIKnVCc FmqLWHlUqtVn33zJ6tCprcOm0RnW9agMA0KFtorLL6/gMbEw98Z4JCYAQhjmXb2YJENZ 7KRXFauhXernldciFZ//lPPdnuANKRvFweerjp2O6URqXQ1+GTLUIXhKEPoKznXKyZ7/ BgdA== 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=t7/ehy+DaLvpWUjPym7lsWruUaMe0iQOvrVBl3j7UGPXk0Z/BYTdNT6GeRp061+q4C 9rANt2V5wTdO6xnJOvDv6GyMo6egEW0iR+RHMiqYCDNqGCP+nIe3zTuBObM7t1iwdDZb +nPlHTLzwNA9qNvy2EWT1c+hy6BZl+efot2tpDRxzOnj9DerzF/qiGCCFXJk0LFK3JXe 3K8GlEuolaGzPeB4T2KiETphO5dA3ZevRA+0ufgYWT47pHtgINcSLjwqj8PHC+YAmb49 4iZfx6sl7p3efSONXN1JZBnCI9R5zFM7jjE2LljS7MRfhpjwVXhVupsAz6XCShUM+nWL qcgA== X-Forwarded-Encrypted: i=1; AJvYcCUJtDrB/G6rztMvawMztOfb2CeLvrJYlLRCQACG5v4cne/Vmlupc1qxnygA+W17+GDw5IA+akgo1OvoopkHtzYcQStVbVVDEuXAf3Ci X-Gm-Message-State: AOJu0Yz1Yduw2zXRrry8dRqvjvwCMSJW2Ssfxi/2X11fx4c5P37k0l9c cjvuoQGRkeefQHRCY4AjGc3bWtpAPtcOFIGbsWnykjtD59fXBG8YDjFVNTQCLdw= 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> 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: 1791066884333278526 X-GMAIL-MSGID: 1791066884333278526 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: 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; } 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: 202148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp564947dyb; Fri, 16 Feb 2024 06:54:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsjo5GoqZrnkLIjnfHjdwjm/IgK3rSW0iGo6afkBF/QCO18cjBmF22fR9ToQDxXC5JKcxbiKiIY0ZvLZvaOEM2KNckrQ== X-Google-Smtp-Source: AGHT+IGgKwxIkzjYtyF5bJnvb5CONp6a+yrxAmUQaeaoJVaDQvavnJkrWW4jX5SkllcYXmm9h+J/ X-Received: by 2002:a05:6a20:4c1b:b0:19e:b196:ddb7 with SMTP id fm27-20020a056a204c1b00b0019eb196ddb7mr4583986pzb.15.1708095285103; Fri, 16 Feb 2024 06:54:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708095285; cv=pass; d=google.com; s=arc-20160816; b=Rv/yLrosYXvSThljBYTmW1KdjhUEDEp3kGv1oE5H9lUOOHqhEc8XdP0Gfrjtr7TJBj x2cktIlrDzPRzWrueXJfMTncLCHqCefa1OqSkkkRowdeCwPA55dcsTqN9QD90bnnURLW SGzjH0/MmT+s5w8wW8s+aQ42x3AmL9VzD2Y+ADH1EP/V6hwNTKyyiZ51kXJRaCGN4Hr5 P4jra4dvzVsd841mXFLFc/Ru9Toq1XhfMHYmrGch552lrmZo8D6MHnzQJTHvkqUxCLxR orRld4ckeZOb+Vbem1M4l+DzQCtXabz1INonW7SvU3KmX8IDr/YlHPigrhfRiIa9D410 cTjA== 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=ddHRp/a7ql2hO4wtU3P1Kr5z86y1yTWMkn8d+hM85z0=; fh=EF9fxA8ikzxTSw1veeTgyjsBbrZY/kU74fYbN1dFuzQ=; b=MaAENYLOX8H82gk786mGRttikgT9+Lm1ysm7kW3qz7CiXwENCaBsOF1kqUMmPW0tUZ ECiIYXEBrF1+UJkPtR2D1pYbO5X2Isopo+UWos90HeEtF25DI8h91w8r25BzcwhpoUYf 2W98Q908XN14ZowQxzMpbBXOhjl7ll7gy0MzzyULncO0M467QPQCcJ5dM+7j+71l7DU6 CS9Rqa3qS71Fb96tVHZOXkllRIaxlxB+ZYOuh+BaFCo6daInBwpNLwC0K811lH4d0jjb 1jazDZnp+Pak7Ky5C86ae2fcj/Y/dn7UPJUf3TR+qwnRpXKqasRsQ6HwmQ4dwu4cxM6X FUiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W49GTaCy; 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-68752-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68752-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g16-20020aa79dd0000000b006e1171b2d57si18404pfq.351.2024.02.16.06.54.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:54:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68752-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W49GTaCy; 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-68752-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68752-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C8ADDB22BA8 for ; Fri, 16 Feb 2024 14:41:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59FD412FB20; Fri, 16 Feb 2024 14:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="W49GTaCy" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 8090B12F585 for ; Fri, 16 Feb 2024 14:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094443; cv=none; b=ZhmsAjouxAm+KOjbJjBFm6Uo123VHuQ/hoTEQo7O21noN9cyA3wFUff/mjZb54+afTDYGNWzfWhfxYqQUx4UhUBeRlcNeQeyQrypcwM80j51ft08mx+gjAGjaWOClGIa0J5RI9q7euxSYH9tzZOFJ/xd4Izn5SWtkMSzyff2KfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708094443; c=relaxed/simple; bh=pD34V4Xis6XvSKzWyAyrm6YM5UjXrZYGLUr4MspUCqE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UpfwWrAOnXsQWdTxnjOGsaXEQMDfNrIkgM4ZROLteU/7E9dzmqPvEqe7tzNhdgmN3Fh4B+GV25p7pRkgxnR0koWoxlab0xXk9nrAkMlLGyA04695fd8ctHI7AHv5Fqj7qw1HkkVbb54gqqucs8GLARuOyI1F6YPyQYzbbQvVIMc= 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=W49GTaCy; arc=none smtp.client-ip=209.85.218.44 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-ej1-f44.google.com with SMTP id a640c23a62f3a-a3d159220c7so118248666b.2 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=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=ddHRp/a7ql2hO4wtU3P1Kr5z86y1yTWMkn8d+hM85z0=; b=W49GTaCyJs11FwPkJ+dUvl8jE2fMAalodGP6ajU/LhFoLdb+Y1eKZ88yYH30g+//gN XjOjsWtW5MqSrgpb72vRmcY8RXXCj0ET3rRtEKZahhg5Xbq1BKXSeAObBVpjqSel0F8l miuw52CGK9EjBkxYqP4ZNJCn0BPq02EmRadZ5qoqVdkIV0MOrJoY5y1ArluR6aHSP6KM QpUb5SC61Ds9K5yanjidGNDbYeHFjS42Sd4POQ2HOQ+a4BNbXkMAGR7MSWeiyNCt9Hpp IqnLIjgGVV73epu2PL7OtbL4j86Ycpw0lYq5074zysRTYjDMIWFTiacVg/Bi9QVNzye3 Vf2A== 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=nTwzYCPFKKLbGXdy5QI4codMu8A6jRzpDpS7A32CT6Noq0KRcmwDeBU6TGjIDSyog2 VT56mczcjaovsiPPtO/b8yTSuE2UgoPfrJfdHGlkGWPUId1DxKNuS0JulxrjRy0/pQbi +1I43Uc4QeyzwTZ1K4cMwZCu5DdK8+I0qX98fK5Xsp8gK+S9IuqGwEu6POeU8xCroFa/ LoxELaWKqYhAPIYmsAPstcBiB0Tcv3fJ/FJ9MCIJzBWvEKjiEOCBtwfB+OUvrgr+ActJ iVN/VrEsUss+2s/RxFZUzrmTxIrDk27PaMkfK2clgZ2Y/nX6CbGJBmhqV37YBPu/qzCS SeJA== X-Forwarded-Encrypted: i=1; AJvYcCUKetP5R+tVs6p8SEMq4C+LoNA+EkVK3ZrFAgCIdJOYeHcPnmJf5L+5igfzgrhCpDMdodEPHoNDqlugIhqZGp/5RWAm6q3nflOQpURV X-Gm-Message-State: AOJu0YzjASfKl6DeyiMvoAbQD5pEa5wzbwef/Ea6ZNlF7qUFxmhrwYan FooRJjtMdcKRm7xdYDw1gBoW7VFw2toOjjIz80VlhzT0GB4MZphk19Dcn/WAVno= 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> 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: 1791067721365768589 X-GMAIL-MSGID: 1791067721365768589 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; /*