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;