Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1395186rdb; Fri, 9 Feb 2024 23:36:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVobMjvONjoUQFVlaxhr4oeAvtiARuLIykcYaq1B4eG13RQ5cNeHjqhAf5bdayWy0OhS5FJp2UeyjAanJokaW9wsKUmlze27PvlYMuyg== X-Google-Smtp-Source: AGHT+IHTdLs4o0lkuNM7kRq4Dji2w+VuvskyeESoK5pCKgAL27QA8Mqvvvk+jefJ03KyFZ44ngAO X-Received: by 2002:a17:906:44f:b0:a3c:32b9:d04d with SMTP id e15-20020a170906044f00b00a3c32b9d04dmr359100eja.18.1707550600621; Fri, 09 Feb 2024 23:36:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707550600; cv=pass; d=google.com; s=arc-20160816; b=r31QcB6dAs+PThq6qGpezU0K2KIhe/jG8w+ZJhHpQNpUjTd2G5f4x89MAL/RoIQkXX FcIRKegRMuhpOTjqdR9xntgkyn4sHT7Pfttvn1GLtdin2e7/mM3pCioIiOyic475Pwo4 mQZyV98TG661Dcw+yHz9AGovKaML9pTdhO9jMgfg8N1g0BgdGKhS6O4JF2WLKehP2ut/ CTWzZFHtuHvJjY6JU73I0vTkSB6T9c3gGv+LQh3Qua4B2I6LFF1ZAzzqypGrcsAPoGZC +P5CI/qB9aIycGfzYnHTnxK8i1XgzBSfge0UidplxA1WXmMXMH2Eh4eDqH8L24GsYoGD qAjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=CobaHuwhU7pfdk6obvxMNllpPaSd+YlPdvQP3GqjP1E=; fh=2m+J4nrZfx9KO1//x2kNb0JO6aZdokN+QgKQGx6ZTEs=; b=zXxyipnevGFmDy2OjgtpapvAxVg5jydqKy+l89kayiiivja3aOyn+vfI9JNGMP6uco Qffpw9QgIUq4rl3AzVvJ8bt0/zw0SECd4B4yPwM/2yvV4IRL0q6bmHn9z6X3ZQgm/tIL YnclGg8tKvhnmWZMcqY7xhIVLG4ibp7LEOnusTWo6DyqMfDmal/m6nl5o4APB2UFWM2Z G2MW66UHZBMECkDOA4s62wFNc145ilEBnatCtU1qI5i2A086ncMvow/giN4L8c8yam2H iQtyeLkldhyTDa+vIG06lYudXA9uXOKaEnvscAaEDtN4nS37UlSYipbK8wjm3hCnJI9r 5Ttg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=fXF6svOJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCXOHmDgZlS+B5QRFkRel7Za4mT/R1N1CPY211SmEfNekCeOREBc5cEfcV6ZRNHirPOOOh65x93ed9YOxKrVuJe1R9mKd7XRQ6cc+vlO0w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lo22-20020a170906fa1600b00a3c20e07387si571903ejb.982.2024.02.09.23.36.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:36:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=fXF6svOJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 204C71F27DA2 for ; Sat, 10 Feb 2024 00:07:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BDA433C8; Sat, 10 Feb 2024 00:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="fXF6svOJ" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 3C32423BD for ; Sat, 10 Feb 2024 00:07:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523639; cv=none; b=gO9Tm8c8qw4EhgN35CUzicYz1xgPD06/yhFjzeCYg47X709tU6cqiN5JKBdGu7yv76s3PO2WXJcx2qCvrU5me32CTzB4wtmeqU8+GpEmnu3dci600800dQZzqavJnfqn9x4OZC4uBC19Vk8TEtsYQQ0imDP99rPkSiySkK+nIhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523639; c=relaxed/simple; bh=XAd8TiVz4++g7NhVht4S/FztN9ETtYB4+lyWg4fhN8M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OdSM+4B2NOylMzuw+47yhtbGUuL58pZYn1cJjGyqs2zrEvdFO24bj44/6NYYNRjbE8IRS8Op1kxOW7MrnNwnFcB/zqxxqRv1wRwzMJYVmjkwrZHNilgQfRkWXReyej4nwJ+ECvJaeRIAYSmqpY2fnX0EsjuSJkoKI+Up2861WQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=fXF6svOJ; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1d746856d85so12162415ad.0 for ; Fri, 09 Feb 2024 16:07:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707523637; x=1708128437; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CobaHuwhU7pfdk6obvxMNllpPaSd+YlPdvQP3GqjP1E=; b=Wq66aYfmi22TepHm9hh3dyWSjjqGkXbAGhXrVTM9Jz8fI/aMORx3tsjY25eo7qhbcx lWYpuvfMuc6BfYZk7ztF3iRZi9vdR8CZHw/mxRoe1q7qJJ06dYAN2zwMP5+tbrLj+Gal YZQOCFPnk7m7ce+MxR7OOzduy8ixpZfkoaKjDyOJ58zQaVqoPZjPFfBG94xhb+yYYEHC YrB6cC1lPqiIWtuLiQ+08wqtDY2oWrJPJPJOQ3qby0slONWU52WqlqnModjv1bQ3Gg6K 06giJuuYSkAH4VSv6rxyPV5mvvwFY7BwYlGljEUy9xSc7LYkgCBrAr993VN1UwaifKic 8n/Q== X-Forwarded-Encrypted: i=1; AJvYcCValcltid/lxK5EUEMyml1C5e8n2GOUWUNd4Fp3aBmt+t55suPZgvGzWvdk0fM11xyoTClWIu7EgBgJ/ICQd42BpIasdJVazdcTotjl X-Gm-Message-State: AOJu0Yy+DDc8q8lJtqiL0uyoN0+8ZL5IFEDSelFNFdVLc3th2WNsct+P HwUMYl10RucMZzLdZnCbgKX7QHL4RA4WhdexNBGrP45hQKdRi1jB X-Received: by 2002:a17:903:246:b0:1d9:8d17:87b8 with SMTP id j6-20020a170903024600b001d98d1787b8mr1074664plh.34.1707523637554; Fri, 09 Feb 2024 16:07:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU0aEb6MnfJbY0j2eWqTKtV05+9CqXH9uCo76kEowe90g6exquj1cqimTIiQK+WSIAsS+VVnkbotfuPq/Chs90/JbZLbTkaBW1gGFt8YWxYi5QaqWO2YnHW3jjJKaTKXprxqo/oUdaUMESQQKOYfxx2o32z7pe88MD8ehrKsJcdyvosrHNqzuf4DUkNkgqi5G+0LYqgxA0LUBxgIpYTNJlbjLjnFJGmFlmRxv2ShYpGo7T0mfp3sbdQFd82/xRPzT9yNSOKDiy7QGgP0a2L Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id l11-20020a170902d04b00b001d92c29d6bbsm2056182pll.83.2024.02.09.16.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:07:17 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707523636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CobaHuwhU7pfdk6obvxMNllpPaSd+YlPdvQP3GqjP1E=; b=fXF6svOJNdlRnM2oB7YKPES6ppQVF0fjIc80z3phw+cxQ+ozcbx2n7BoxNhXXHCgeWo34B v9UnDF69uGr6ByW00AwqmiaHC3T+Gy+0+hxWswm6Qb3U2oZiIAhsZI6Jf2XKAcpmhiYfww K6q7WI1meVICQZAUYHUeR1UPFOI+B5ztW6CH7SVwyB3h0pRa2JdiXODZ7owmxntqcR/2wC Dzb/hcuGqh3c+cpaDBzMwif89Qffn2Qf8f2l5tWPgwtFnOsNuwSKtcnefGq50TU92umuUo og9f3nsYzqUI/3vTVeXvVBGf59J03HC6umMYR/ZsGUiNwKwiNEDUL/mlnGtlDw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Fri, 09 Feb 2024 21:07:17 -0300 Subject: [PATCH 2/4] powerpc: vio: make vio_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240209-bus_cleanup-powerpc2-v1-2-79a56dcaebb1@marliere.net> References: <20240209-bus_cleanup-powerpc2-v1-0-79a56dcaebb1@marliere.net> In-Reply-To: <20240209-bus_cleanup-powerpc2-v1-0-79a56dcaebb1@marliere.net> To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1679; i=ricardo@marliere.net; h=from:subject:message-id; bh=XAd8TiVz4++g7NhVht4S/FztN9ETtYB4+lyWg4fhN8M=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxr5QwYe5223DLNqd7+j+9RNBUgkXhzfbm4xn+ 3YtJ5UFEauJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZca+UAAKCRDJC4p8Y4ZY priiD/9QTh7JZjD2iaoGlvBuQdWikMPT+ZgyMMW5qzwsew1lpWvHKrhCt6uODcMwfcjeKG7WeFv yPs5Apx/9jnJSqxhzgbG6htKZZc7T/Kq9wc9kHg204yOLWNtuWXu9lxWyVqbjC/hCRAzWZ+F66M RT9YheXnQ7qfol1hQHgH00RH0nmarQeoe0KUJoH+u6+Zy0bImMYYqbCahWxiHOksGuZWB/RyrRf ABv3bba3BURL8hjyne+2TVZB6HqQLrkXJDd++pDZeK2oott5uIqWE2xOMNOvYpVJxiei/F33FVq fvbOjzPmKrxUw/p9WZEZK6cx3woWODAARBXe1XllSmQDh0OtOJn/khIidGfOunFSesL9nN5xnYq tRD7750kmXJYo/tF3YVVwCeiFytdWmipNMokUhztawwGM2qnJpTfCs9UYQQ1Wp69lzWQdM/orW2 8bCfNdtymrjtHhzAOTYw+bn3r3t76nRqg3jSTkCykyH5tJh8PankQhknj5mdhgqAInun8Mh+N1r 09d+QHXIErib7mxWdL6spsDJMNVXHCE8nTA1pHMQapKdEDE64dfIVgTjz1i0bl5JrjJd4Tg6mep vLB7VNJ6XT4S4XYdkhuIIF9U5/hpAQ2ruq6/DSmapbiHtCh+a1y8lRN6qjAzIh3Aj8cIZ26+PTs TcffrCYWM08hVFQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Now that the driver core can properly handle constant struct bus_type, move the vio_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere --- arch/powerpc/include/asm/vio.h | 2 +- arch/powerpc/platforms/pseries/vio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index cc9b787627ad..6faf2a931755 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h @@ -39,7 +39,7 @@ */ #define VIO_CMO_MIN_ENT 1562624 -extern struct bus_type vio_bus_type; +extern const struct bus_type vio_bus_type; struct iommu_table; diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c index 6c58824190a2..90ff85c879bf 100644 --- a/arch/powerpc/platforms/pseries/vio.c +++ b/arch/powerpc/platforms/pseries/vio.c @@ -1615,7 +1615,7 @@ static struct attribute *vio_cmo_dev_attrs[] = { }; ATTRIBUTE_GROUPS(vio_cmo_dev); -struct bus_type vio_bus_type = { +const struct bus_type vio_bus_type = { .name = "vio", .dev_groups = vio_cmo_dev_groups, .bus_groups = vio_bus_groups, @@ -1634,7 +1634,7 @@ static struct attribute *vio_dev_attrs[] = { }; ATTRIBUTE_GROUPS(vio_dev); -struct bus_type vio_bus_type = { +const struct bus_type vio_bus_type = { .name = "vio", .dev_groups = vio_dev_groups, .uevent = vio_hotplug, -- 2.43.0