From patchwork Sat Feb 10 00:07:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 199216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1337595dyd; Fri, 9 Feb 2024 23:16:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7E9Zmt15lOaQ6i/bsD8mpVdv3Xl66/qHb4GzTLSbYdfo0LQJb94JF2XJVJA0GCBHRF2t2 X-Received: by 2002:a17:906:38f:b0:a3c:2ab8:5d4e with SMTP id b15-20020a170906038f00b00a3c2ab85d4emr527593eja.72.1707549376158; Fri, 09 Feb 2024 23:16:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707549376; cv=pass; d=google.com; s=arc-20160816; b=NBj/tr1YMy8UWW9/n45JAx6BFjEq+oIvoFgbFe6/HoqUU0tN4uE0/Z546Uut9WOJLS zm6F68sZSwdokFgC6yfKRAzneVpBsOWya+X19GZ7Wn6IP2onYqx4OH6IVyZkQLQyDVEG I182KPSurGVbW7/Yo9OwhBq3IuCIRHPcPk5VCTvoTEFpZDsHKbKNFpyfcB34dy+vXVIc hq5lM8F7Dcda7BttOI9GkNMlfInjB0PXFThEw8AhxcDZXffRoxB4EmP9/KNZePwfVzSz 2uCaD4ASBZqix0KnWXAaKo7GY0exSncTBSy54ojmFOPkPR9x02KfSGOYVj83vqPaX0Ap Xm4g== 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=+k6mhvn9Z1qEZ9gBX0t2yHWJO1e3EK/9q68mH5gChTQ=; fh=mVvN3C8/dJNpbfhCPPc82nQ3tNbNWIdPcDQTjx8CYn8=; b=pVKg4C6m6mzIbMLgK61zyZhrAIjUbACEmveF/vh6iCipSmfsS4cUkY8+swdPU9ingR mNcJhXAilF2cfZD8CZghaH9HUNn8+J7GtzfXCJyz1vdfok0rVV9Qqrmt0WMR2zJp2tTE tn9NmmCeqUfxseRhiZLQE1OCOusscKBw1do9bBLZ46G1WfScZllSnlwA8A0SWhntZU4R 7J9biuJLrphgmJ8SdTThMZx2XXwu7j2MHlA8L13YCTrKXa7Cd0GnGn3p9yKkamdNb7UH 5hjNU239NWJrAcUQtMChc/G59s46OEWb4CGZUr1j7MdfYKZ91K9aLBFlF8Ca720V1Z9k oojg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=NO551Aeq; 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-60167-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60167-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWqinf75O2zt5RNwQMYtox3ThOVKVA2dM9qEjw7xsh+rctNxGvIbxhGDhzHqbpuYR1tSeI9vJEDPPb127VaueDHF8gibQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y17-20020a1709060a9100b00a377fe425a9si1622442ejf.674.2024.02.09.23.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:16:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60167-ouuuleilei=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=NO551Aeq; 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-60167-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60167-ouuuleilei=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 A53B01F27CB6 for ; Sat, 10 Feb 2024 00:07:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54A5629B0; 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="NO551Aeq" Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.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 65D87110A for ; Sat, 10 Feb 2024 00:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523637; cv=none; b=irLhLhroETsGs0sbImQk4bVF3zJhnevySb/enFuHLJARIQ81R8K+3ARqZ6uh4/DyYYzatCkPlRrbol22wdAJUfgyva9YZ4+rlnGH90Za7gcBSHDNTmcF7clj4xy2yUUBiA8rP2eFUpB8lERe8uGxUcsDIArd00RUc9HAVcur2yQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523637; c=relaxed/simple; bh=/dPB3W4ot4IPM57QJHJQ3SgqCr0LIpHfgk+Di4Umxa8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tv1mKYBjnLGgr72deXFi6yx7bTy/8KidboeGpC78TmYsnWHxmxU0nCUzVzMAX60l2lEKzFXN5EyP0i3DYIUqz5tXAESV8TV9er0yH2sYYNqKJPYc/1+R0V9W7KLXsMaTbjQpf6USSBl90jRHsZDj56eXuybaNzg3ntAjq8ph7LI= 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=NO551Aeq; arc=none smtp.client-ip=209.85.161.54 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-oo1-f54.google.com with SMTP id 006d021491bc7-59927972125so983181eaf.3 for ; Fri, 09 Feb 2024 16:07:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707523634; x=1708128434; 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=+k6mhvn9Z1qEZ9gBX0t2yHWJO1e3EK/9q68mH5gChTQ=; b=hoS/JC1s1tUFIqpMed/69VyfU3TpTvknvHvMm57VLQWtpP5bAsDFfATNFR/RDAVySw qDYVZ5HmedAqU+rWj2axyJH5DGz6SJhIgkIkktvThg8hPzPwCOsVBzyiQk+QS1B+bMQG q0uRuCQf5zzMPH6GSS3XbXX8hflUWiwfLsyoM0l7KCIvVP7jkmngT9QlLV4BKiJF/Zwy YY9LWRZ/7fo5ua5B2+0EGzOap4i7yuAdPdBKyPMw59baukkq+tbq88gmYYy/Ab5jlQlK uX9FXuuoVpY9MC1kn7V+ekYjKbdC+9ofvrxoKzSeFITEm1N+VpYwNMTZmFQ4ZA/neBxN /Z2Q== X-Gm-Message-State: AOJu0Ywm0bdKI+MGi9B999xWvsSs+t0R+9jdB5BQ+VuoitGLgbRqsPYP PNY3ZSvapY5ZQZCWix6hkfXfO0YzMO3nmfitqI3Dr+r9F96Euc2/ X-Received: by 2002:a05:6358:7596:b0:178:e2b3:98da with SMTP id x22-20020a056358759600b00178e2b398damr1319305rwf.28.1707523634437; Fri, 09 Feb 2024 16:07:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVgUzJFpJ9ws+tmlTd8/7HwuJQKeu6oQjkpNSm4hJ3gi7i4h5xl+vew3uXGJHFJptUOWfPGS2gDS7G7g6CsfT1Ygi0R/lO7joiCLRZF1X4UaFZp5GwWZywYMTFf0wWTfksE4ZzEkVzSDoAksiVjZzB8B/TLh2pbw0gv8kqmR8RNEdTvwtgbqZ7avUiWr+Jw/iHl014clpyxPfK4n/XUu/2ANsRnDH6371JJzqxWNcWn8tEWqTr8xyRwVljZgapCwj5E0rMWjMfDIy3wUmUQ Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id fd23-20020a056a002e9700b006e03cce3f4asm1134093pfb.25.2024.02.09.16.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:07:13 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707523632; 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=+k6mhvn9Z1qEZ9gBX0t2yHWJO1e3EK/9q68mH5gChTQ=; b=NO551AeqHmfAsopWz1n+TrdIT6Q88VXLtFC9mCaTH3mUfo5o4xlwWQ3kZEXfftQAKwA7J9 vl353OHigWEtfOb0nEV7JG4V0wqwAz1GGTCU5MjRoFFKN0H/m1K78+lc/d/eW9JDCwr0GO AdPZ2X8CgxT+1KhsWA9VV35af/MjyyDPp5SylHfDcTnhvt85LOnQQ4OHwFObUxNbRJhHCX QGFs26Xl60Z5KqKs9YbjG10CyOR0znlmrHXnwB34DzWgHupP4vDm4tvKBRjbIXsIWO0vW1 Trt1vQFCeDvjFQL5daGKa7B5Caiy6EjgxL//pTy8hKKm0bUVjdRRggqYTjmB3w== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Fri, 09 Feb 2024 21:07:16 -0300 Subject: [PATCH 1/4] powerpc: vio: move device attributes into a new ifdef Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240209-bus_cleanup-powerpc2-v1-1-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=3550; i=ricardo@marliere.net; h=from:subject:message-id; bh=/dPB3W4ot4IPM57QJHJQ3SgqCr0LIpHfgk+Di4Umxa8=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxr5PtVS5G6NzxtWQjjXBVbaqJRYDiONqEaNdt KuakVG0roSJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZca+TwAKCRDJC4p8Y4ZY pjTkD/9hDewxgLOen60OPPy4AvqOqiFv3Dcx0MlJLDI18HrgJrsq6KPziTvoODmAvRF3KcPqeOE TIqT+O7t6xXiIKcGtkxHqWv6qWGDoujS//gNjvxqQY5bq0yLnrd3RE6qB/ymNLrZ2hgCK1Xl2EZ B/Ms2ZLg7kKX9kNEjYurQk9ltAKu5JnRtKgzOJWz2OersWN3poZfkr5FhM5MKYR16y+MH+jZn08 K2pxP7P2dpawBHxGEZu8XV30QwEs4mGFjL8ho6uaVouIBV0Pk6Ui4X1ecrUbKhK7mIGE852fLgI J4D4mLh8E2Wx853tNoGliqhbIUSUwbxx9o6tOb8LZ4zQdlr1+0XAjB2wU5x6tX0f+NIdNvDeNOk jPqg09gzZqCT//fDTptx0aUVMPYC3wdUDhF62KyEiAFe8HDi/RFMAu6Qip/Xes3YiK1dc4UoiRE bfmguG71tMbn6Vo+CKAXvlv1SE7sNKsLhm432VQQOlKPsY7iDur+NhLwliMZxw6fcu+u4mp1khT lgh7ZycqyQQWh0YChQHbz3sRsQ/cfJ9MRncijvWGjo/d1gBE/Lk1EQ7Mo/u7MLUOqiBcwnf5AoQ kUElMBvpwDuhz4WD1FdOwgRFY7t52AAyx9gKpP8yoRBcXsBFndCoIhiCCdcmH5j70ZS+V3EAETA C6g0QBVV6HU1HVw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790495294898110807 X-GMAIL-MSGID: 1790495294898110807 In order to make the distinction of the vio_bus_type variable based on CONFIG_PPC_SMLPAR more explicit, move the required structs into a new ifdef block. This is needed in order to make vio_bus_type const and because the distinction is made explicit, there is no need to set the fields within the vio_cmo_sysfs_init function. Cc: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere --- arch/powerpc/platforms/pseries/vio.c | 59 +++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c index 2dc9cbc4bcd8..6c58824190a2 100644 --- a/arch/powerpc/platforms/pseries/vio.c +++ b/arch/powerpc/platforms/pseries/vio.c @@ -991,18 +991,6 @@ static DEVICE_ATTR_RO(cmo_allocated); static DEVICE_ATTR_RW(cmo_desired); static DEVICE_ATTR_RW(cmo_allocs_failed); -static struct attribute *vio_cmo_dev_attrs[] = { - &dev_attr_name.attr, - &dev_attr_devspec.attr, - &dev_attr_modalias.attr, - &dev_attr_cmo_entitled.attr, - &dev_attr_cmo_allocated.attr, - &dev_attr_cmo_desired.attr, - &dev_attr_cmo_allocs_failed.attr, - NULL, -}; -ATTRIBUTE_GROUPS(vio_cmo_dev); - /* sysfs bus functions and data structures for CMO */ #define viobus_cmo_rd_attr(name) \ @@ -1062,11 +1050,7 @@ static struct attribute *vio_bus_attrs[] = { }; ATTRIBUTE_GROUPS(vio_bus); -static void __init vio_cmo_sysfs_init(void) -{ - vio_bus_type.dev_groups = vio_cmo_dev_groups; - vio_bus_type.bus_groups = vio_bus_groups; -} +static void __init vio_cmo_sysfs_init(void) { } #else /* CONFIG_PPC_SMLPAR */ int vio_cmo_entitlement_update(size_t new_entitlement) { return 0; } void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired) {} @@ -1584,14 +1568,6 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, } static DEVICE_ATTR_RO(modalias); -static struct attribute *vio_dev_attrs[] = { - &dev_attr_name.attr, - &dev_attr_devspec.attr, - &dev_attr_modalias.attr, - NULL, -}; -ATTRIBUTE_GROUPS(vio_dev); - void vio_unregister_device(struct vio_dev *viodev) { device_unregister(&viodev->dev); @@ -1626,6 +1602,38 @@ static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env) return 0; } +#ifdef CONFIG_PPC_SMLPAR +static struct attribute *vio_cmo_dev_attrs[] = { + &dev_attr_name.attr, + &dev_attr_devspec.attr, + &dev_attr_modalias.attr, + &dev_attr_cmo_entitled.attr, + &dev_attr_cmo_allocated.attr, + &dev_attr_cmo_desired.attr, + &dev_attr_cmo_allocs_failed.attr, + NULL, +}; +ATTRIBUTE_GROUPS(vio_cmo_dev); + +struct bus_type vio_bus_type = { + .name = "vio", + .dev_groups = vio_cmo_dev_groups, + .bus_groups = vio_bus_groups, + .uevent = vio_hotplug, + .match = vio_bus_match, + .probe = vio_bus_probe, + .remove = vio_bus_remove, + .shutdown = vio_bus_shutdown, +}; +#else /* CONFIG_PPC_SMLPAR */ +static struct attribute *vio_dev_attrs[] = { + &dev_attr_name.attr, + &dev_attr_devspec.attr, + &dev_attr_modalias.attr, + NULL, +}; +ATTRIBUTE_GROUPS(vio_dev); + struct bus_type vio_bus_type = { .name = "vio", .dev_groups = vio_dev_groups, @@ -1635,6 +1643,7 @@ struct bus_type vio_bus_type = { .remove = vio_bus_remove, .shutdown = vio_bus_shutdown, }; +#endif /* CONFIG_PPC_SMLPAR */ /** * vio_get_attribute: - get attribute for virtual device From patchwork Sat Feb 10 00:07:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 199229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1343414dyd; Fri, 9 Feb 2024 23:36:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHW+Wqt+Y4+/ssNrpDSJUsBkep3njPRBMNk8ewINwuTW5ZdTj4h13WTRQqkFEUCiI9pV/l0BmMENRix1eGVLcBZ0Y2Lw== X-Google-Smtp-Source: AGHT+IHdssAeAjAV0CQNowJNKxv5Mb19DOlRJGF5uiymKCDurpuWI0oRP6WRekKoma4/z27u2Ouz X-Received: by 2002:aa7:c510:0:b0:560:e51e:bea0 with SMTP id o16-20020aa7c510000000b00560e51ebea0mr599416edq.40.1707550596044; Fri, 09 Feb 2024 23:36:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707550596; cv=pass; d=google.com; s=arc-20160816; b=LWAZaAM/U0vTMR8Zb/xWe4rxBb3hEq3Lwc3PT/Euv062ymYNPFU5+Mez3vMFU5cwor C9A9bOGos1NDNpR7udovObBXieqYYCEq2napK4Ksm8CVlBk+g9wFppDkpn59YdTn2GtE igox3IHKyyYH8/R60uAKFKISL7N10PvU4JFbOfdhY8T4LBkwMoAQnVK5YVI13p9KXIKt w+nNhbg3bnCLCfjusiplCqhN0Z8yX8Rj6XV9qNS9WaDMh0jp/0sRPsj6BunbsCtUmJej 0C64pgKbSYMBJ0XrYanN3tWqxdRlqyQc+bs/t9UL3oEgv1eCW0SecNbpCMwPXajm6ksO 0UFw== 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=Yi69j1upLo7LhugioHkzMb7KbBVXvRMTBj7zALLM3Gk=; b=P/nb+lMenJS8Uuv7WRoNyuaT1LeELkNJ5j4yCLT2gqjzNca4rPGlOt3Gv/1uLMJVt4 ReciBSNPNm+L3vyYUZlHVIj4FaYiBZ+r91tqk3pPCdVYnS9+Ge5Brs+cMsKdpCUaZu78 vhCjkHI2NFxjg4Xo7yGCtJqCbZOmWMLO8+zlGCSLrGj5542Cx6EcCcQAAvEgBW3G2sn5 341GXJJQ21cllOaNo134FL9/2HQ5HMudvo1KwHI0ZeCXPSZgAWFD+9XQWTjJHVwoa/Pq xURScnpHDOxtw0OHZY4NZDSak3V9SbvLsht4sTHfPNE8qJkOe8F2Ne7vvv4svkfPBSXD 1n9A==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60168-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWxjeg22RWEzNL6cthdQffj8oIdLdlEtx8NTF0YhdZawEVbcBAPR8mzFUqbSyyr2scLJ83hChwvOD6hL1DwZ6VC3WfGew== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s10-20020a056402164a00b00560ae7e5939si584768edx.366.2024.02.09.23.36.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:36:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60168-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60168-ouuuleilei=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 6E5921F2859D for ; Sat, 10 Feb 2024 00:07:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE9F84414; Sat, 10 Feb 2024 00:07:22 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790496573628600955 X-GMAIL-MSGID: 1790496573628600955 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, From patchwork Sat Feb 10 00:07:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 199227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1343129dyd; Fri, 9 Feb 2024 23:35:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdmKLBW2CB+9Nd+PglizoUreTvniYx3X2sIFOdYaPiKTmnuspRmndOtFdoVxmV5kA/y7Sr X-Received: by 2002:a05:620a:15a7:b0:785:4fc5:f982 with SMTP id f7-20020a05620a15a700b007854fc5f982mr1404158qkk.51.1707550528676; Fri, 09 Feb 2024 23:35:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707550528; cv=pass; d=google.com; s=arc-20160816; b=Q1AV7GvFXsuzpVeKctHIjoW2LRrt5FUD7Sei4ZXnEBLUZ8WpuUdcmehm7EECsVuNUZ bIByTWyWc51eYrAJ1YQzeWjzu1NS1sQa7FLOrVXYigGd802QKVXGLhjujFQwD0hAqypf bY+E4hz4RZV3ackVYyO5GdzhgVEbyNhr5aAG1gIBx1a8uxDe9zhDp0zycaeP9oxJ7O8W iJIQkxGrcv8/ZjCKQ6Hzi0kKoBKahK6gfM3OzNwoBL50JqFPfmwHTindu/yS5EP8zWp9 T4tcR1ZH29HSOaW1obrxtH3xpZRRczUA9KSVun5Ac724YS7QhUynRKxt5qUPgmhilr9T ralw== 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=gK8p55xLirSUiR9q0E6ZCWh0WNCH7QbqUfIi685HA9U=; fh=/LnAIj2M2spFTILlyzr1ltzWKVTxB6iVh8ENVyiQs1U=; b=oacAEIMML4zjXuaiBs3I4p0Pkk80xdslIJgdE1EzJAfxYXxwZ5qrpRKVClAPhSmdi2 Mn25iLfwU6odqPI2/dWUbXCBLT0veFKFCULza+L2UaXrYpnDibU6NiNSmwiKjTq9ALP5 ubWEp36oSJPy3bMdaget9+XiZuNfGoKCnObMxwZKhRLYbEZpK0zxc0Cbt+9n+kHq5f42 nOHZH3SGvCQbcPG5hYRQvTi41aUPQPF6o6nkOPkcwYmWOz8vWMoGsqO4DTYAPNawiPaz a7m3ShSrroxh9xSeCOlHRrQuLd5C4MQaxI1yLgNLe+iYpFKs3EIohdh9deHZvO5Fz2gN AkYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=ZPpCzVbg; 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-60169-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60169-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCXR7U7MiuUabqpyy0GtttIU7POPKnlMKQYmotLKePRKSw9pPFuUN+6zKLw+Jq8MEVdGhOAP3G4nKERbxh9A7mKqShuEpQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a15-20020a05620a102f00b00785ca5be585si162678qkk.422.2024.02.09.23.35.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:35:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60169-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=ZPpCzVbg; 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-60169-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60169-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 692591C2621E for ; Sat, 10 Feb 2024 00:08:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 185535238; Sat, 10 Feb 2024 00:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="ZPpCzVbg" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 AD6D53D64 for ; Sat, 10 Feb 2024 00:07:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523643; cv=none; b=l6b5/P1XdXl90Gm6yPQrnX2mNDImstiwTTIea0DGQo8lybXhok7IldQBV2cBsEqMmJdf3xr4f125Cg+TMA1aXBztdfRIDIBb+jwEDgPSPVqQ5npSaYnB9pd98Y3h5OzHIewWpL4z5EC4F7ymmfNB1llwJzxRDhv1PhgGDdhjo+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523643; c=relaxed/simple; bh=C8aIrz+YvO9fxNUkdAMJJ6XdrDgygMKYTt1snLgv0Dc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=omq5Awum+wlbiRlbi2U5kbAX+yfm68yN/opIKZ/RYyS1nYwrdPRQToCbW38I7ISG43aVAaOcoXTNuhrL74ugXQiJizeuOK0X9wNAiahIFAeT04J6Qv9DL6CZVbjYLP2AVn9VHkFv72uVY0hodNZNAWw4gUXVqmRhyFtL8+k38Ms= 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=ZPpCzVbg; arc=none smtp.client-ip=209.85.210.173 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-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e05d958b61so1311581b3a.2 for ; Fri, 09 Feb 2024 16:07:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707523641; x=1708128441; 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=gK8p55xLirSUiR9q0E6ZCWh0WNCH7QbqUfIi685HA9U=; b=TwFUYu4GXLLXI0JDqxN9aoswzP+CuHcoJREooA4lZ8o8YWlTO054M2ZTip+pPXSfvj fWQwtgxGKYhqcbXGdzUNAeklJCmZf8VTnvHlDSLDTus7ZKLKdrCjvU+zvTwo9s1VCldv 4UYzNmyR8gYXkWPTUApeTC+ZaBVqFnUEht+GzWEUvXe3CbDvtxWhWItk8tY43LorMcqy N+Hw0gFcDQvl4HGnvSMpswVM+BDtSbOi3F+HZgG9HEB4d3DvH8kdRoNc8k6rbw2dB24c liCkVhyBmQvhGIBhP6cWYplB9es5aW78boeY3zXMYDZArv1xpfiJUEtOuqC7E3hANE4W iu8Q== X-Gm-Message-State: AOJu0Yyz510Bs37tRP6RsaMZKQK1Xgg1d5e3KHDm3DFocnfpXQklkU58 MeDVBQjUtDqV5CYTVcS7hHFJGDWjLyLvURdM7YwYav4OrtZZVrGsJB7zSUFDe7aRUg== X-Received: by 2002:a05:6a21:150c:b0:19c:9418:c396 with SMTP id nq12-20020a056a21150c00b0019c9418c396mr961326pzb.31.1707523640772; Fri, 09 Feb 2024 16:07:20 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXT2cTs43LdujFWL6c11U73A539Zg6VkGsvBctFbXDLZzfwJdCYU3Hiv9HalRFxOOXcSoi94nmmGdZb2A1Wj8QvDM5Yvy0zB8Ah4ao0deJbAmtdu61d/PXq9918SqX9OcXrOBa9euAx0BqFrXbrI/v9pV1HN5HjB4N/LaAayBHu6ETnJBt8B+ncFWBiaoxlQNkL9Z4nKwDnA3sFiT8Bu764diZkRffyRjUZdNZ19hM3odfct+oNbAgWW06hM2O6/DLcyU3O7e2VbrcwEbbK Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id a21-20020a056a000c9500b006e04d2be954sm1122559pfv.187.2024.02.09.16.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:07:20 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707523639; 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=gK8p55xLirSUiR9q0E6ZCWh0WNCH7QbqUfIi685HA9U=; b=ZPpCzVbgGPtTuUzaBJWtuREqazdtp3QIB9vxKhmlqz4zTeFjuVnWAA8MgdhxEIvPwkWA8M yxM1kSS3sQQRiH6ccmFGlJAbT4idxl9R37VbEP7QjwHLBdW16k9EJNpf4Lsds9+omnPUoE 6ZQJdC5stkRuKIZIetmetYKVxMrUO1QzyCVdHaOoLWOfULIgCU4CLKYIoidRUu99XX92/A cthvOW83u6jNZ3hY6jiWvzoLV2IpDB0+5JCcA4yy/4G49QcOHDauRb6GJ+4EEIMUMp5mvL RL8qUK1qm6+1NxmNVyT3GxDwTQeZ0Fnsa5SUJZCCWdI10NX/ho67hQUELW/yOw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Fri, 09 Feb 2024 21:07:18 -0300 Subject: [PATCH 3/4] powerpc: mpic: make mpic_subsys const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240209-bus_cleanup-powerpc2-v1-3-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=1274; i=ricardo@marliere.net; h=from:subject:message-id; bh=C8aIrz+YvO9fxNUkdAMJJ6XdrDgygMKYTt1snLgv0Dc=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxr5Qw58cZ0qxku2hEjuwHGuU1ag5fHQtMwTpT OS3oV8gY0KJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZca+UAAKCRDJC4p8Y4ZY pqw4D/4ygjnvtA1sA5sgpgxrx9xkcv8vPXJEwYvNRCRDsx+zbW/PVVLWFKDlzh3Ft3xVEC7AOvE xjLSCd4Osep+KglDuHCMP3yDmrJQV9Res5X//TvtRO6FRpjO7H51NWYya4MspHcwC9W0ikFJAKj J2e0co9QS+rjoX1KFzLjEGA6WiIX8agt9zLCinLvRAprxwlLloEbtEUQKQpOFCpTXT11iS2tT9Q bx5V2Av0QdnLRwZ78cR13QOS0UG/53T4qnoblYQdJS3Fqsv0Ksy2dpWVy6aq7QAgGEAkHX9N/uK dWcEf7NFL/PElZs99AMBJfPZpkovEbCfuWZ2Rh7tUXQ41Xhrz9Rir/lqF5/1hPFUYLkkas8B9fn WinMANMuPVf2/DwNCFh5WwHWtHsLQtkMT0UFTwcp8EMyFSxs0y3mNNUyUtWNWl3YFNCSbi3cHwu x98xuIk7Dm0GzjV0oW/4pFF24hpGlwzgUwapa4VG6BAVP7lr5ssy5tklIv5Zc/7CyzkPCqRykvT HIY6SaSe4wNr83HTcbnw83IKa+241seYhpgt63kCyDfxGGkYFb4AMHfH6TPE74rOS3IazoTW0Sp DE4f25LDyeAnddhowKzBUo/4o0eGczEpbsRU+9uV62s/PuOiHkL0W5QKNK0H3NfPUtVH3HSO2jp 4GgA0aRoAv0QiVQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790496503213778654 X-GMAIL-MSGID: 1790496503213778654 Now that the driver core can properly handle constant struct bus_type, move the mpic_subsys 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/mpic.h | 2 +- arch/powerpc/sysdev/mpic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index 58353c5bd3fb..0c03a98986cd 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h @@ -336,7 +336,7 @@ struct mpic #endif }; -extern struct bus_type mpic_subsys; +extern const struct bus_type mpic_subsys; /* * MPIC flags (passed to mpic_alloc) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index dabbdd356664..d94cf36b0f65 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -49,7 +49,7 @@ #define DBG(fmt...) #endif -struct bus_type mpic_subsys = { +const struct bus_type mpic_subsys = { .name = "mpic", .dev_name = "mpic", }; From patchwork Sat Feb 10 00:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 199211 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1337388dyd; Fri, 9 Feb 2024 23:15:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHw3R1quQPV3SFc2zCuf61zAEb7SDJ7kLDxlAlF2BblKYxA6bmeMJ1+4tz+yR3Fr3kcpUKd X-Received: by 2002:a05:6214:b6e:b0:68c:5c8a:41b6 with SMTP id ey14-20020a0562140b6e00b0068c5c8a41b6mr1948736qvb.13.1707549344209; Fri, 09 Feb 2024 23:15:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707549344; cv=pass; d=google.com; s=arc-20160816; b=WUiNmcaD3gazz1F1l2yfC1xuGxd3ZO4F1rlfj1h4WWZIuJHEd/ezSYl954iT65oqLF qap/xOEwAe3QEPis3b8Qrg4lCOTT++HgXny4m82pBm4boudTtWxz34RAGVqMOZfuPRNc 1FSjVnfiZfCZZUH38tuv1ftKmTU4jYCugw44k840jUrDWdecintwwAeUaA9zwCwEpS0i Wl8G5zu6dWDIqAGRVin20NG0/gmwnc22JPewDQjhrsxr9Y58qt1zQfQ75z00TTpi+0VZ Uk8FBT1QoKpcgTN1VIvtmQbLJrJkcSad48uzS+qr9g09D7B1FuUrKqM8dBYcDR7BMoT0 0nTg== 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=RZNl1Nye2ncQoYBtuTJZGLa+1bUaHxQW2hW4pvSwI+0=; fh=8VuL4kx9YICvkWdyjYy4DHLpC1ViwljExIL4cKLHYLU=; b=bOCRTnQKMj48uhhQZlMAEjC0j3IAIOjxB4CtJchG0jM98e9f3I7gPADkkI8L03DQUT SX9X4ZjcsxwjXfoFQuX4DWPtvJCnl4ByfwhNlIx6NWBKKbxO/zHErAraAQW6lZYTZPAO NwMLb9II9gQykkAtuXmKY0U7ubU0uQgyHlvc7iBwyk70rU8DM/ZIwdJuKWdi42IZxZpB yuW5i9YfHI75wWX86Q9MNqlsMnuWHSP+rbWDNjsIGaO7GvrmkO6lytQGxyB1C5dlskN6 pHwgi8KD6ATXPxeGfYRTVA98+07OZamioe6WOHYs7V0YT8/qA4EwoPSDj3xL3z9TkPKl KYrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=HtWBl8Cz; 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-60170-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60170-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWFXdIw6qe+TN3A7OrJgOZzxy8BlVgT/NQXzsRmjSxNpmtQmB+xvUunRc2jePnh2oVY/Dy3Ecg/mSchIR4PI7VpPlv5/w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gc12-20020a056214230c00b0068cb0aa2ec6si3757351qvb.518.2024.02.09.23.15.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 23:15:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60170-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=@marliere.net header.s=2024 header.b=HtWBl8Cz; 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-60170-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60170-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ABD561C2677C for ; Sat, 10 Feb 2024 00:08:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DD4C6FC2; Sat, 10 Feb 2024 00:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="HtWBl8Cz" Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 22D424C6C for ; Sat, 10 Feb 2024 00:07:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523646; cv=none; b=dtkgLpTThqypjwNOlKsv/lSTvrGtCwYWNXW/uUjZnx7+EC2mtabTOxJLyBuDaT3SP8+Z2QHpUpEs0lGVypPDDj3k87IQSrYL/Zs+I27naoXkRtXw2TWbFinMiHGniXvXm3eQrSi7XQ6WLfnhDOWm7/nRiPITjWJPlnv8RHJGpfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707523646; c=relaxed/simple; bh=qfzL4dZjlBHFtDwhGgCc6fcqy06lU4Edb3ekIeLug9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D+5wCz6YUlzjQzywfem+E/X5mBt61wUXq12l6X6sYB+kz1z7vEQ7a9mDYxaaRHyWdcAz0D2wHlXzfEbsa1dGCmiFFAad60IZuvhfqucfSyrPgj2f8mVDJ2THPzYGfGxTK0c9g730rKdaurey/QdxI89lBWt9VLNklJM3Cth885Q= 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=HtWBl8Cz; arc=none smtp.client-ip=209.85.166.180 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-il1-f180.google.com with SMTP id e9e14a558f8ab-363ca193a7eso3831345ab.2 for ; Fri, 09 Feb 2024 16:07:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707523644; x=1708128444; 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=RZNl1Nye2ncQoYBtuTJZGLa+1bUaHxQW2hW4pvSwI+0=; b=JRtfnj3Oqsb95FaLXpzKHpBOw3fE/BvYJPoixzyQLzcY3adp+vbv0jVUDc+IjW30r+ ZHi8G5cfuxU6bLSQWY16sB9NGaHDNGzei7FeI9Z9I4Qd3EgLdhOzmQ9XT/R1Ne9igTVZ 2GpsVho8Di1hpMd5bW+eSXOmMgoILlsUB3ExFeKqgG9eLuac3uVEx+QGy0zWQVINJt89 WOBhGk23+TN06LEhrb0RzN+fUsY9Q+TrHNLG7AuvKYXIYYElF9z/JI0OPHZW8NMZu05m WRx2K9yUhgzqf8Y3sFJ40Z9qqVO+dCQ87ZjsUrxwA1QEHC9nVNCDM4N04PgcTaIs3F3O Arcw== X-Gm-Message-State: AOJu0YyF0gi47+pAO3K9+xwyCAMc/8cM/2EjIJC0W5kiNW6OGAaVnPzZ j8MWUeNW6K7rxz1aTdpoMvGSX6Bz+inUFr7L9f9cIIdFQLM8anNf X-Received: by 2002:a92:b745:0:b0:363:d9eb:c2de with SMTP id c5-20020a92b745000000b00363d9ebc2demr915116ilm.6.1707523644142; Fri, 09 Feb 2024 16:07:24 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUfkrikHMdzjZpt1BDV82uhnXds79HetY/KS5BbA2g8Q10MbHNtUiMVhwiBdAAqIh55En/wRQE2nTBjHhyauscgehZw4+FgP+lSGTCoX3fXAcQ110T/tRCWCGtjApJLlLM0XddSowx+prC6A8jy8Y99y1lMetwn/+L8g8odVu2zsKA7Eds5VToqiJ1CPOl3DdmFiy4aO1F4rHoqAm/cDzPcV+KPBTMwlv/U1HAYAiJhEE892L8LHhyzvSmij7Aak0sov3vJ8iMIzFiGcBIW Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id b30-20020a63715e000000b005cfbec9f8b4sm2386759pgn.54.2024.02.09.16.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:07:23 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707523642; 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=RZNl1Nye2ncQoYBtuTJZGLa+1bUaHxQW2hW4pvSwI+0=; b=HtWBl8CzqrlCIcxNQ3PWSqy+/Hz2YnVuaJ1AEpd3zB7827MKw6DQ41MXb+Xcjnn/2a+el8 4w4WayEjE+I5AuEIKjwnljv3PRPAiWsNGnBXEM/4R+B/I0ul9MmW9PkdeD1HTuVhxYkqrz C0xP1qjyM+SnWR+JFroMjUqnDDFuQtntH6Qx/HcRoCHwq7U6W9vlgh5bT50CPEL6Ecjzz3 c3LmF/tdM+VttOVMSOf1poQ7ADJy1sbChwuWZ2W3xLkEKv/WxfIHvk6OETicluAH7vkgty LT4N5pK6y99VREHyNg5CSaw8N+BNJzxoxBaapAtRqsq8zlNmyV2tHfPs+6Tsbw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Fri, 09 Feb 2024 21:07:19 -0300 Subject: [PATCH 4/4] powerpc: ibmebus: make ibmebus_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240209-bus_cleanup-powerpc2-v1-4-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=1622; i=ricardo@marliere.net; h=from:subject:message-id; bh=qfzL4dZjlBHFtDwhGgCc6fcqy06lU4Edb3ekIeLug9k=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxr5QhN6gVJXkQevkdbSE1nkvWBm2oOqJEqMg2 Zyb7GyHtAKJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZca+UAAKCRDJC4p8Y4ZY plKpD/sEnqDg91vGpaoLiboM7638MBJIZ2SOARbckZ2DGmj5329s1yfXSuuBSC+qEJ7nYhPWFY0 +gHWkY2T7cxt3u09NE7CEjIpwN9OggvTja9uT+iHOvrJJZ/IKy3zbNQ1wuQgAHoFVlD8iIDJ6k3 mR2Zz/DZSCPvVOVkWEXsc0Ixn4VOYOkbcznucst/fRpDlj2iL0gtjp4K1jrU79Q4IYqeWArf50h TD80+tr9T8PzVacUf60/NQ1IFVXLWgGK2SAZg/+NTcl0fPmZNbmstWYMejBk1UubcVT6Mk+1uz3 CgxnNR7uHPDLpxXXV8NhvdrbqswBuHQQYdcRcPfmsyyJKD2n5Ez0s7QWqu6bh0ZgVoTxB6Ft+lV hNV+MLWZtK6C+yJvQmuclcewGmh0UXp79iBw27zv9bcmW5LoHmdg1b51+U+rWeByILHqyXtyWy5 hzkhRBwq5wu2dddmmXV1SZDsKOuJzfH0yfS19IxAasxoTlBkJ4Y0hmwyxdbjqWdeg29SgmrxIxT px6msPaISJFtpHr4ZPt4HMRYbTtzUzYkMwE3BV1Agj5/SZ/QfONLSZKtfBOzVdY9V1aOfOUAYDg iMusaepwXHJQmsDkD19+A7VOHIAvbhuui2vDngA66iBfVqR1kMYRtsYTVQiGxwc93s1Cc6/rsKC PxlD2hang6QavZA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790495261198477485 X-GMAIL-MSGID: 1790495261198477485 Now that the driver core can properly handle constant struct bus_type, move the ibmebus_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/ibmebus.h | 2 +- arch/powerpc/platforms/pseries/ibmebus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/ibmebus.h b/arch/powerpc/include/asm/ibmebus.h index 6f33253a364a..46fe406f461c 100644 --- a/arch/powerpc/include/asm/ibmebus.h +++ b/arch/powerpc/include/asm/ibmebus.h @@ -48,7 +48,7 @@ struct platform_driver; -extern struct bus_type ibmebus_bus_type; +extern const struct bus_type ibmebus_bus_type; int ibmebus_register_driver(struct platform_driver *drv); void ibmebus_unregister_driver(struct platform_driver *drv); diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c index 998e3aff2457..4bb611afaba4 100644 --- a/arch/powerpc/platforms/pseries/ibmebus.c +++ b/arch/powerpc/platforms/pseries/ibmebus.c @@ -432,7 +432,7 @@ static int ibmebus_bus_modalias(const struct device *dev, struct kobj_uevent_env return of_device_uevent_modalias(dev, env); } -struct bus_type ibmebus_bus_type = { +const struct bus_type ibmebus_bus_type = { .name = "ibmebus", .uevent = ibmebus_bus_modalias, .bus_groups = ibmbus_bus_groups,