From patchwork Mon Feb 12 20:04:59 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: 200248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp382805dyb; Mon, 12 Feb 2024 23:50:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1SSoi7ixVBOUyIcbC9uVpOsBfgvHzmYS4F1X3ZwFp7GU9EIU2v9xUouyGu4t6A/dwZAxU/jNI/DhQNh77yqXL4q1d5g== X-Google-Smtp-Source: AGHT+IGa9huKG+dWC51IZv0DoyFgoc+cq3jctsyKt+HrTQOEt0UfJf7BAm5B75XaRGrMGNubdtEw X-Received: by 2002:a05:6a21:6315:b0:1a0:5de4:2f53 with SMTP id wu21-20020a056a21631500b001a05de42f53mr2407722pzb.25.1707810635505; Mon, 12 Feb 2024 23:50:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707810635; cv=pass; d=google.com; s=arc-20160816; b=ks4huVLyq4i0r8TakRwrZJHUgm4GymqrHNoWZDmkVfBzfrr/0ElM7nnpy3/ZTLpGhR tnx0Wn3vtv0n+XBs9tjLb53Xs8aW0ceWjMk0H+exM5VnelDxnhZ/cq+j2tZ97XzH7n6x J1wzfGuXOKuvjPiJRbqE9CRKnhsT02z2m8vxHYx+GRbOWzaPjfpwj0gyVUnAfPd+a859 OEX0yAqK8TCiFOBw0iNlQT0tSJTxmbrsaPnr1X+YGyg3EGHhBHaW8k9lMtz6oXDqI/VD jTKTKtErQMlYdZg8s3yLUGDUKjbK7oWoVZcnp4FynwBj0KyQlxdR8vOaX4Ph6Mou6IGc bYXg== 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=msKH/30r+dYCyvQI/GPznRZU3o7kJBdNoj2X+2Xt2vs=; b=FL66oMQ5bq6/RkipamF55ranlqXyv5O4WKV4Qyd7i/MNshidhHtINjaV65mNJL3C9w Dv/doZzLCJwwCMFXoqPE9DC5msoXQhTYvJwVKS9e6EFcqUfzmHhhCE2dQSkoh5Syg0C6 Vd3qD0Lk/1bc8mVbePjp7hKYaw8Jaycd7wdBDzB92ECkS2PoK5j56hSc8mi7kAXsecmC cxjuOMV6yLEOxZq3K3C7XPHqC4n0jUWXlVe8QFq8eXMS0tjvRn1qhMLnVF+FXm76ZLaQ DXGYXhtegViDwkMt6KN8OYf2eERFbZpn09vLLgLkZvGxUgddsBnqJTUssWwPD7xjHISG 7ZfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=bP3iAHEn; 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-62303-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62303-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCW/3KIIZLs/VBtB2dsYjr+B3VWcswXt/srJldiN9NYk1G50H21ECssxi+KVKlyeU6kLjfBJ4hpCsnn2RLVsH2S5+7fGWw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z126-20020a633384000000b005d795f96f31si1551811pgz.152.2024.02.12.23.50.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:50:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62303-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=bP3iAHEn; 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-62303-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62303-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BF7F2B2347E for ; Mon, 12 Feb 2024 20:05:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BED7495FD; Mon, 12 Feb 2024 20:04:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="bP3iAHEn" 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 4FA3947F6A for ; Mon, 12 Feb 2024 20:04:30 +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=1707768271; cv=none; b=EuvO5Ob5XZDl0BCdj61gSkwXdy+C31lZSz07MBc8tRVutFrUddFpvnior+K7fvGWNCt8PElHw6iD66UeJRIXsfY1s2uLG/gG6/XXjEp+rzsugdzygK7+hcoCiepdJM/ju9uCbrkFqk56CpL57oTwa5rTMpGDIri0OewlBx6MDzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768271; c=relaxed/simple; bh=/dPB3W4ot4IPM57QJHJQ3SgqCr0LIpHfgk+Di4Umxa8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ezEYv2ZDm/cALc49pCYQc87kg8AzS+kRU8uiBwEuAY9w7BHgmCEYkFI+63K3T1EhtKhSqtlcL+ovW2g7CtMnbadzyvymvtnuI2pCDgTuFRkHRCQiBwkMySRlDqFgaGtn76uQPdkJmJ1YBBLdLYzByfgwFSRw6k1vHjhzQKm1AnU= 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=bP3iAHEn; 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-6e08dd0fa0bso2435300b3a.1 for ; Mon, 12 Feb 2024 12:04:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768269; x=1708373069; 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=V0jKTLUzHSjmgBkSAJyqqwN2KLokY77pdxWFuNEJ1bhEDUEaSWwyoC6zQk+HpKRNNT OPgzU4eduk/bJ/bJ7VbWDxnowsVQrQvI195S7st/MPu59f0s3RxpHM+it98nWYoZF7DJ 5trR8l6vXvEFC0xqEF+RBMMk7PGBEG3hoSZ9sQEYGpFlU7JJ/K0NP4Jtz9n6kDsrruTN yCvPcu62VRPxLTgMSrlCP9AH6fpAiDklUNGW6UKKzIyvbc6Ll98HYoCm308TKoMSMG54 i8cNZJeseQhSIBo2TvnSfqgF7aUyZ93Iu6dOEQMSDdd6ik0O5kcPvemaJWKhRFn97Gpt RD0Q== X-Forwarded-Encrypted: i=1; AJvYcCXz+jpdwCo1XOeFHiHuWHz1JioID/H1t36j2OmlTL/ThqXW9UK8duMvE8Js42CC9iAr+paIlRNvvhBpfqvRIaMlWiYnmxxAUppK3P27 X-Gm-Message-State: AOJu0YxS0BSJdd98SDgzpmRPWGgRhOJGMC6W6XZ6kV4vNXaK+vQPmKBc YCzvvkvbdmmi4qI2S6wocCQdxycM7qBo/JOv6s6LQb7aKWaV4KBm X-Received: by 2002:a05:6a00:2285:b0:6e0:e83f:22b2 with SMTP id f5-20020a056a00228500b006e0e83f22b2mr690051pfe.6.1707768269378; Mon, 12 Feb 2024 12:04:29 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXgCKtXsirL9+QyNsE0b5YkwqaCJEVuunHmZiNUfim68vjnO8XGkKWA2NreEOZ0RSlBb3qqPDE9lmUmMvdr98zBQy8+1jKmB9dfhrw8nu6MM5mlX8CEaZ/iT0CgLQnTGOAZydd0Csi8eeyOx2IKo6VZ/n/Ut8LWuj66AZ2+5UXFInwWbYcjtpnFYkA3p/WGduxbKaZbt62JulX6ZC71jRy4yujVg07lxtY7ckd/Fq9yMi/FfOd6tejjrmZB7odbngxdb11zlm5mXngl+xli Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id f10-20020a056a001aca00b006da2aad58adsm6111971pfv.176.2024.02.12.12.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:04:28 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707768267; 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=bP3iAHEn0t2yIJiVbc1IyGN2VF+//5u0L0EATzxHY3YxIY4L1r0vN0V9Cbv9NQDfzFpT3q Bqgo27U94aD0xX6d4v+y7PNjMECKek+XV449DEEKPWFRYq/oAcXGXh/D4AX+UCYmcCBklV NP10gnmtADQzI+Ousof7Y2oArHK4kfo+uwnQT2Fm+8qh19D/q3GzF45gQHdhsCJqwKnghe oA6IVAbiuyv/s26a9Ar/wddXkkOOfQqip4dNNYdy8YbeToIp6UYDa79/gLsXX6k2Z76nUz s7J9EUiy6wlS/MJeSIBjouw9VM8uNzcmDqGciSBZ3avEsAKouc3jRDfobjMquA== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 12 Feb 2024 17:04:59 -0300 Subject: [PATCH v2 1/5] 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: <20240212-bus_cleanup-powerpc2-v2-1-8441b3f77827@marliere.net> References: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@marliere.net> In-Reply-To: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@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/ZANAwAKAckLinxjhlimAcsmYgBlynnuYhyrYfoN9ksVb2HrsIX3LZN4DUe/acctL x6Xnv1jhDaJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcp57gAKCRDJC4p8Y4ZY pogdEACTenv2YC6Xsjpap9+JxL5O8Hq3ORJnwXLvrAn4x6mBHwtceDg/pPNfOqkVy9XQZRxfFVJ KwWQV0VqIM2Z52von87F2QcHJxdL6F6WanAxjOzy27t5q0qAzTUxERt37hiHxKAHK7rL44KmhEK +hpKTYyBAh26HMTqROzSD/KenTsWP/vcmiNYVpMcPy+5iF/Z9U+cbkByxndneohlOxnbHGZ0Rj9 +8K3wWMo7QWf6ZVFIrDbUozum0iw4tKBYoPOcWTTt21zVRE+2Z10E9EDhaXZ/XxWD5Xz/MjjOSh xVXmwjsEy9T03nNVoHxWTtPzM3y35XIvvQGgCV5ZuhXOiAFD2EAV7aSCMY8+fNW+xi70zgw73c0 PIYgw2TbBATBlTe4kHi+S0gffDNmN/aiLOOd0F0EpW66emuyI5k2HhEW86uTvedC3SlQJupi3PX QosGuWCkcwsvFqHhIcPHh8m3LJ8RpGm7kavGSVij1fmPvNNd+ba588nPqJTz93vS7H4KEOQ2pmh oWInWLPm+ONFZReKtvOnJRjuapq5ktmelIMwSQmGeB0vchpwU49Zg5wsAG8NV+Lhszu1nztPuWi Fiz07LP/fRLsHcsF2JCIGLhZ6JbhgXnVrcTZzrOxB7qYcJLd7i5fIvgKfoPgYaDslzaiOb8OLG7 4+8MdJT/Qw5wCqA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790769244697697386 X-GMAIL-MSGID: 1790769244697697386 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 Mon Feb 12 20:05:00 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: 200243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp365977dyb; Mon, 12 Feb 2024 23:00:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUAVmXMxF82Rf/xA3/8nJPjKmnmueaPZIGOZW/xShTU+q5N+hJ6WZSWiUWHYGKfCLaYF43djexUIwgnFwSY/3/O0xbavQ== X-Google-Smtp-Source: AGHT+IGhuHMjGzVY5Mwj2jKXgN5m8pelrE8zHawn5xjo/wnzcIpJEgub0u835NcWHsgoEEK1tAv9 X-Received: by 2002:a17:90b:1956:b0:293:bdef:ce72 with SMTP id nk22-20020a17090b195600b00293bdefce72mr6701905pjb.9.1707807618074; Mon, 12 Feb 2024 23:00:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707807618; cv=pass; d=google.com; s=arc-20160816; b=CU6TjXwueCAkzr8pTOZbSZHrWqbepEDIc5bQRz3WipNgTqNyb9hNK41TQuIgMZHZ45 SMyGGJxJsR7CmI3QnzKqWvgg00XYL3IvyI0FO8oeZVXOnsuJPdTqP1qaf10vLmea2+ra jlqlUaLEwPcTIj1gSuUFMlfHNuN6s9fxqCsNqYqdcx+kEPvJKKHrmquQSRuTxSlBCNZ4 wuB3i0ysMFwCzHVEXctrwgsTfjEVmy1b6D4lbLKbEEoJAT2NpxR9jLg6RLSaWPae93+0 Tf1dIOYeRXu3TRYCvUHXzOcXTy9EqZxvjbNdtVL7Kclf3NTTtZdmoFL6JpB7QBJ9perx LCvw== 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=uM4Z12hpk6ywnXmg4o7JBjzuS2oolDAHFENYm+t/mgg=; fh=nYeB96oRtxUZcb+rCgeRnvK/waokVUpyRuA9nk6AUUM=; b=L/yA4IEGs4EVU9aifTizFty32tnEtt9rbYUiOHa7O9OlSlGbcTEArYZa7bZd9Ume6I 30Jjej6p6ZtWNMMVwT4lFZPYtugkNP5uVOsfSonp3xu91eYokuJMFQCtJkU1v9cNAH1K lvcWndwCWGO1QLNEhNOScVWJmaSHLRlFCo8l7DXZiy3s4XSHZ/30LQLFbkY21ugr46hq ZVYD+qDhd/x/PlYXfsT4WslZ3C1OMP1v5qSS8Azy8QchZDKersKhE7BPMkrYp74v8eCs T32V+SaMst6WC6mO+vRjb/sfgzyM5nT3TUEbt8RMvMF2Rg3MIlkIHSmwVwnity2gDoQg UZ4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Mu+f6XZq; 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-62304-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62304-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWYaw/NqeUGUIVFIX949i/BOfk2oBxR924j2ghW2uJ2+68hhKqzT18yYRdGZEW2Kf7YmCdbPjFsfjbTNTPtEFfJ+yMIrA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u3-20020a17090ac88300b0028cb18e31d5si1605593pjt.160.2024.02.12.23.00.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:00:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62304-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=@marliere.net header.s=2024 header.b=Mu+f6XZq; 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-62304-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62304-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9B2F9B239D7 for ; Mon, 12 Feb 2024 20:05:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB13C4C62B; Mon, 12 Feb 2024 20:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="Mu+f6XZq" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.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 359C3482E9 for ; Mon, 12 Feb 2024 20:04:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768274; cv=none; b=s0hGTQdSn6H5u1503hwc43BwjIlkY4wVFIXSX+T7Ym9hIw7Q0pzAFmixUUfXng+gJyOl+gG0/mB0O3+vepXmH6K0gPF3xQK1MunHvIYWfIYUYN6A+mVeDTvuGAlNT47h/7lXz2Y6EurlBZ6rH3EtzpyKI6ltVAI1rJDHlV4SQ+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768274; c=relaxed/simple; bh=wq2ksQ7riCsovFQtWGfWa+BPPUeBF8MZW1gziCVsNGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WxClXWuMnSskh0FL3jKaMmcO+A4ZydxGsHA2219ChfD6YiTf5JLbnUK7z33hU0cxTefX5M1RdgOk4fG57Gk6MfEPgO/rK38MgZcOnG/miT71sN/dRjmHGMFLnUVpyM32akHSDEd9OhOhELcwHWsm6X61klfHSfW6ICb6d5Y1k3s= 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=Mu+f6XZq; arc=none smtp.client-ip=209.85.210.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-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e0f5934813so186926b3a.2 for ; Mon, 12 Feb 2024 12:04:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768272; x=1708373072; 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=uM4Z12hpk6ywnXmg4o7JBjzuS2oolDAHFENYm+t/mgg=; b=n/F2OLAtH9CuqkSxHNDSFxdtHbz77yRhsNL0pHAwKNyFndUyBaGLxSqrSfX2a9L5G+ 34wbUJc2mRgbusUfEe/JNwSpgdZA8c6GIO9vJkU5dLKJJ9+ljM9/Y0dOGWgJjPugcYHM at3a1BvvWFRgPebHNQJcljHALv963TflS6ptKpgC/cQ5uxCpiuiL1mVgpLfRkMAZHHEq kkRE4xTSh+P2RDlqUYSbGWioyomoFJGLh2v5sc253SQtQGSdhdJPrNVAaUnVzfJ8j//R CkhrNxRnLxKll/ECjyZPNDdGiQKdxgJHA+EgWGMRtG8xSJhnoeSlFWxOrH0rxlz+nTUK SQ+g== X-Forwarded-Encrypted: i=1; AJvYcCWzmOs03FzmISv4VboKQhEMdo97fK8ahImxwt/Y39qVLzisd2/nQ2DEsFW+pJXvXKJxW5o0Gd+PVtRJj0/eDtvjt5QUsQbfftNg9I7g X-Gm-Message-State: AOJu0Yye36UJzI6dLGmAaQmcvw9CgaogMKOCPOV9V0/TfjNH/H10P2VI U6xzZL4RljxXJELgwQtDhCB2fsGcYoVYbbWmtxJlPFQfeEWOdb26 X-Received: by 2002:a62:ee03:0:b0:6e0:9968:87e1 with SMTP id e3-20020a62ee03000000b006e0996887e1mr7194757pfi.20.1707768272484; Mon, 12 Feb 2024 12:04:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVinwUqKSkKJYv+R/n7EffgHxiGUzgM35n6oa1VEuy9ZvuyKBWxjlADigt3y3pzhUJqrNRwXgWnCX0dNI71O+S/wor5D1PlIOn6NoZiFHVyNjxFeLEpgW9LH5COqxddNWR0H8XxBDAiFU55yQ46GA5D6LmGp/qqcc9OxriEqbgymJUetyIaZhvI7HVDlG7+iTqZPJpSJOs6iHjnDD5oWMnXerLJ+bp7uB8Sdw+7NPb7YPyc7BjCc7LlQS84RrefPx0z+4V9AiXZ53aYDWOj Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id m15-20020a62f20f000000b006d9b35b2602sm5811979pfh.3.2024.02.12.12.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:04:32 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707768271; 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=uM4Z12hpk6ywnXmg4o7JBjzuS2oolDAHFENYm+t/mgg=; b=Mu+f6XZqXzB5rLbeydHSZDUmtAFIJg2dn9KaXSgbCpUMbMBnYriFsCK75v1YeEyHp4m5se +tH7WC6PT8LPYeH6LREYA2pQ25PpYGu5IW6FelQEstIZDi5Xa0zebeZ5JWRYUnscuQtX+M SLkN8jZENSKRqJwzmD3xdZv7y/iWOUo4hP0jsTA+DxFrzfhtDJ0wVi5Qb4d+TjqQAb83tu cyk6YtcC8kssV+3STawo1Jb8DHGqJOt7NquuobFaThTvWfJcG9pgG167lldNYdFtskOyBe rZD0Zt0lyvK+9aiu3CKSzws2ZkPyzl0u/xlXXCwW9QIp3So1MoTgbjYssjdwmw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 12 Feb 2024 17:05:00 -0300 Subject: [PATCH v2 2/5] 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: <20240212-bus_cleanup-powerpc2-v2-2-8441b3f77827@marliere.net> References: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@marliere.net> In-Reply-To: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@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=1757; i=ricardo@marliere.net; h=from:subject:message-id; bh=wq2ksQ7riCsovFQtWGfWa+BPPUeBF8MZW1gziCVsNGU=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlynnu5I52P5SuFmly4enraO0oN3OCpnat1fA57 nImlIfWOsWJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcp57gAKCRDJC4p8Y4ZY plOOEACKsrsOIpmokRU6VXNzK5ezwmSY1tKdNJU9PusraupJcKE2n+zNbTsO7P5miK+XDIoxMgp gAKt4L7OYDC1SLDWnwrvjBh3KT87u7myz6lDXxktjBDIVvW8nn5NGWLZLuZ1qGwJ9LAWoDFjHoo 8b6Io7uvYUtxXe/ySxu0RSFrt+EYRbg04RtFr8SVICTdjxIuzCioMfRtkNLR7N3QySEB2HIyPtc kSKqp5cl1g8IMkHarHcoXAhBYjCk6aPwEE3kfPUl3gcs8v7DUV3rWH7dGdcq+VuwXrClS7tLItU 617tRgXwDdLnyahFel6MpI2ox8xCWlqsvcluCBVoTpzF+sTkZfrQ1/4Ek+Cve77dEnrEHK5JS2C NYY9i7EwVZRRIByV+fUbiKJnUZv09JWMGLEEpu3KQiWOZAqX2EJsjt0KMK5MiOY5RE+sszSSzci jyXHCXTU9kiOs6IJW1ajSp/su1epRKrroB78gNK7PLQjL0HdH9eWz4W5UmtevA8K2fxFk478PSU nKiJkGFws5DkY9GM3cF6QTfSwG9cG8RGm9h0TSnRRKVZd0/aZFEwnfwuoAzLawtEOL+cegctqMP 7Phk4cJcihQhz1rIbkojDNncrIFvqVV0Vqo5sSjfDSpbOd/hyzNANnrMcsFNYxS0WjDM37UoPsF iBzsz4gniZJWHRQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790766081214125335 X-GMAIL-MSGID: 1790766081214125335 Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), 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 Mon Feb 12 20:05:01 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: 200250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp383042dyb; Mon, 12 Feb 2024 23:51:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUO4//zpruY1NWQk0GQ6vizpO/FxXmMsnGg1A86c5QxtrDvic75UrGxzgpGEEOCkGul6/S/B4a0fRtFcxcN6cGYTYu39w== X-Google-Smtp-Source: AGHT+IESeQALXgIbY0dslSiCP7/sOZ+2d74vegE2OxFW8o6P/zM9yXEwA06esGP9+2gAQqymRfF4 X-Received: by 2002:a17:906:6d17:b0:a3c:85cf:1214 with SMTP id m23-20020a1709066d1700b00a3c85cf1214mr3610662ejr.43.1707810678850; Mon, 12 Feb 2024 23:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707810678; cv=pass; d=google.com; s=arc-20160816; b=NnyJn15Nlw6P/GqKgRlwXKZn/l0soirYrLOVnbfXR/qmi1SLifccaLCTatckVT+g6/ qsV3jrHULKYmJ3O3ovIp/TV0IVYQ1CXma7ljKTpiUngDoBq3jdPIN3H5wte23b7p7Bv3 5QgbjssPveNgi3N+EwnAMQUbuHOwclXCOoIMdamRfatfBwIAz+Wz4jBcUcJa+Prr8XDp GlJWY1W0X6cJksQEduH27tRgnOiSSGz2crfOFfiPjSjWRmLTjSxbTtJUJY17wiLxXNVG briQlmPLSq6JgYC2P/z7Ss0GWT0nZNHOZZVVG9hunv/kweJzZ7VswpwueD8FJ94cdJuT EmaQ== 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=WXWSV+y18LZ5HLeeHfMaArrF2sqw5eZ12bKConVfkds=; fh=63ki+Fgr5eGi0C5rTyLThFFR/Oh4LSeJQeunxri7ly8=; b=adIFoNHwYO0s12J7+LoB//znh9C6UifzgN/jjTk4BKvBINsAfQPQsu9M3KYYXm2op5 06Lt0MScH0VTAKyWx5XkBNRI/rn4f2OVk8bQ/Ss+TUh9EKA+cNy26g11jDlw7MTxnI0T mK7O6TCanzLtPB2tVJxIbWRyJjDV/xMkCAllCnD1zwdBFghmISTVViCYcWjZw4rSt4gO 9GyUz4e5TLXOmeMFkq7qv8eMoxCjjaK2WTeUGNhyHfFv0DpBdO04GHp0Xx75S218S1uc ui/DNaMdp63ojlBtjxBjEBxlwKI2lneNCkY0W2xBGqmqHEB/LSISUnn3QrWIvbqjxGt6 zu6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=QytN18AT; 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-62305-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62305-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCUF4ncNbOjJ5KKJ9wjqjqK6UbnyM+P47q6S6DoFVYDvje0J93N9rSTtQXTtuXPPGCOBC+ATtZd1yKXqRPbeE1ka90Dp2g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jw9-20020a17090776a900b00a3d0f84f7dbsi160019ejc.410.2024.02.12.23.51.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62305-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=QytN18AT; 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-62305-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62305-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 B19E01F24948 for ; Mon, 12 Feb 2024 20:05:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC56C4CDE0; Mon, 12 Feb 2024 20:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="QytN18AT" Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (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 8DA254C61B for ; Mon, 12 Feb 2024 20:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768278; cv=none; b=RX75WYMqAKW5jvKuTHimZTN9qY7jvwZTkZBpE2k7NmsTMfr9QGMVlR1UqbcX4kHTDFdAw2WDNp3AQsmu/Q9SUv+3V5YCh29JJyFudYu1FAjXngMWsvMgX5mrYM1QaOLt3frK53lvN6c9FXxfwgOJ5zq1dOxLa/jGyoNtbCGFn0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768278; c=relaxed/simple; bh=0dAO+EHiuSLBj8m4VZ3xVszabZA/PMRk3GFVh4R9llo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g37q9ErbNa82ncK5zOmRG9wyQc0C0vMLOUbsCvcpYoYPHtbnYFFCbBXzT68tETmrB0YSmdUV+fmOuCmdTDCfSGPdWLDzLtGfshNsu5dnySjTRxXAXE+/mp+QmSOhUsllEUAPz597eGDKBugHtIzCW17gDJ5mZYUhu+fRreEoHKU= 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=QytN18AT; arc=none smtp.client-ip=209.85.215.182 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-pg1-f182.google.com with SMTP id 41be03b00d2f7-5d8b519e438so135993a12.1 for ; Mon, 12 Feb 2024 12:04:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768276; x=1708373076; 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=WXWSV+y18LZ5HLeeHfMaArrF2sqw5eZ12bKConVfkds=; b=XuaMI+w7me3rwPeUgOuhopzg1+xYHF/ZeMw2H7CC5KidCNpshI4X7EhYKYAAdSvdIl y388OKKXbN2cAfvxE4Ks1bEKrtV77MpRJ0fS3TBLCZ3lfSwWCzKA5gK9MknaWAYD5Iug WVF3TGZYPBTNrAaLe3X/eB2Ujs+5uriYwCeRGIBGQa03j7hid8lnxaXLIElkusA0VCWP PU5iwplImv6zP6wjRVFlTV00BMnHaydoNVdkwOPBTOwqQGTFG13yfZYsYUoh2lAU4gnk 6jECtgcLCTGpJv18WPf6qA+Bq7tV+S9DbQpES8IDhUfzqY8UC5Jakjma5ORaWb+Dh7yE 9drw== X-Forwarded-Encrypted: i=1; AJvYcCWp9jVyzoA9EADGtNVoboGEmOsnE6R0Ga+jnxC180V/RjNjB109nkdh2HmTa+pPbeQIf9uh2csdOBxnWFhNkzEsHi9+Jq5yl54yXsXw X-Gm-Message-State: AOJu0Yx9GGqTVH1GOgJYhTLyyR9r8ZdLQlMlGQUNYdLk5iPeeKQ3bUk8 BZvpXQ8nG58kOr3hEnJX5Ctxh20+2n9LHX9zMkEBtYedueLiWaoQ X-Received: by 2002:a17:903:230b:b0:1d9:40f3:ada8 with SMTP id d11-20020a170903230b00b001d940f3ada8mr8856086plh.3.1707768275779; Mon, 12 Feb 2024 12:04:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUDHjxpA0uU3XGvuzhI5SZIquSVLx1zmfFKybGvheSex+hPZy/JzWjZ7CTiIwYLPLehe0po1yJVJC+qBzUb596l742Nkw3KRlh3qazWfWfyUohTv9MGhO+dbyCHa6MnzupDF6nm3JvKh8Ci7crYGe3QSBM9XUHC0Ni5r37pSz/LNHUA3EQt803b9wkUQIPqiPvg1Gul5BTtJgS/Gk4Ub1tbfT/py/ThCrx4v5Z+2eQY1nWr4mA8taDd8P1h6mHV+AkpU960x3GjVIntAmC1 Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id ld16-20020a170902fad000b001d70c6d40f3sm704783plb.237.2024.02.12.12.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:04:35 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707768274; 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=WXWSV+y18LZ5HLeeHfMaArrF2sqw5eZ12bKConVfkds=; b=QytN18ATL8fKnUEP2ncuOPGuiXEIsGGbkVZ6wJhrjBcmLZmNTLs/hIJyiHTWkr2hyZt81s 5pmTK4iknYS51FMajxkKa9HQcswI1uO6at9zJuVR5N0bJdVftvWgO7WGc7qn/sLtcz8YlC TNtn0/iQBImF0B25aCCBWx+X1mWYvGkw3qWmK1wqvnfVigcPUaXdi/1Dmx/9BO+Yz8Q3l4 Y6nRPb7hLuw7QM6ufoFBTuvf/mKGotBW07erL1H3JFiQeJJrPrGGAvAfVxnHrUvYn5qjg4 GU7VoCVqIAdhsppoD9KXGJe1gB8mog4q3L/WD2HAgAZ/R1LjhWZa0PRJM+AAew== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 12 Feb 2024 17:05:01 -0300 Subject: [PATCH v2 3/5] 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: <20240212-bus_cleanup-powerpc2-v2-3-8441b3f77827@marliere.net> References: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@marliere.net> In-Reply-To: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@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=1352; i=ricardo@marliere.net; h=from:subject:message-id; bh=0dAO+EHiuSLBj8m4VZ3xVszabZA/PMRk3GFVh4R9llo=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlynnutnni9XUVE9ggMNrQa0bFx3O0p8SdcpMnT bc4vf6TJT2JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcp57gAKCRDJC4p8Y4ZY pjVVD/4nYBGZn22+WZU78auZCxMYQWDaHW9MiL8IaAxdjcjFLzfkLKAjb5ss+BIQ7Mqu11gKx+K VXEWgxDmIbpAuJpsxSlljamuz00Mjf0+Dx6tP5CyVBLesDUyE0DgAYa+5fGQpLj3QpDhZsMuWz8 LyRMpA7WcmmOf8p0hGvx4V4qq7qa2KFWitkKeIwaOdNVI6syzYPkvNhjkR1Wci9jjHk7Kde4cfo zos7RaoLqbd0DgIc1CPIKOeOtF2xQdCMcn91M7vKvXLgzsDfrJ9x2SjeHHOKMRTkaCjwq8nzPyi mbfv7xaccaEFdhjzOSB/FLCf5SNgHyHOiESuhqOdjj66yvtw+5YZfBOyrfpculJ2lOO5H9mzlib l1MGtq0uOA8WMrVi71TYlX2NutQBmqoWCaZHknJigYm6zMrtk8LOc/v7rPBiy5o3oO6XF4lhO/d IqHkqluyASaq+luXDw1jqu+Fl69wepx6Hv2UDSi3CXohCaz7BUwdqs6Y6AkMS+a0Sa2Llr1cvex ypVfDu6UKs09/okvR2aFne7wcvtEQXpWxLkueA6PFSzpxyJLcgXr6WHPf/2xGZMATf/p+eCxeU1 GdmUtxO0L2sPy7cHh/6f0KnRFGVg4a7cHWOSp++wKy3vmODpIydvixJrk4y4OqGrWriPzFG3Kr1 VkRPilS+S4Yn7Ww== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790769290563838761 X-GMAIL-MSGID: 1790769290563838761 Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), 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 Mon Feb 12 20:05:02 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: 200246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp371600dyb; Mon, 12 Feb 2024 23:15:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWdi9nMq1mwdsADkxw42QlhOlQr7jxTD9iGjCaxdkJAoXa0QnaS4nZpCY/7RABSYXarF0+woe70P8jMSVxsjgSQ7iJ8xA== X-Google-Smtp-Source: AGHT+IFVfBiZ4KFuQjoLK+BJbvkCVIx2mSNWNQvaTzs9WzJWOUvlCjU2qpcTG4J7K7JvqTERLDzk X-Received: by 2002:a05:6870:970c:b0:21a:345c:731c with SMTP id n12-20020a056870970c00b0021a345c731cmr8199777oaq.0.1707808506244; Mon, 12 Feb 2024 23:15:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707808506; cv=pass; d=google.com; s=arc-20160816; b=I8OrqeTWpNaayEgyGw5PMQOa7qbVgAfrhk8Xg09lkZJuBPXku0tup/Kd5d/uxT7uTS lT3km6vOo5HoJKSGLi3zXqYSXLFbTOadK4ouj8cHOa8RNKvOGgBZxrwtIsfHfuwJNXHe Yt/g4vyb7YLMmtCa32IijL4z6CQU0gX02r3gxIXqDjsLDw+Jykomv3wO+gY5iZ4X77rs KCJiww5uaQqC4/fN72qQ49MNGVZmGrFOxowbH1Cjee4MEKpQUPLN5ejIKcdwRF31Q/Gw jijEnq65bYnvrkq5hbHDlk9/2qLyxvxn1V3qUjhtKsXvxLJhqqrMYEgwSmODfGJYbpcJ QxzA== 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=IRMd3DmLaPwuNfy5qvMqAI9wlvK5phDwU9Cy7L0yCdE=; fh=3VmKdGtDiXpOcQcoUGa1dodsHkwureJ4wFR1g5m41P4=; b=yb1RASJuELmZbkyjd2rRQ5NVyinEFR4iMYjLVsfI/2qkkYeOcNU9EXjavG9bVkRK9U tuWojWUTN6Ho6kbS6sbYUA7+Rh/1BySjt2WOa78U0NJC6lEZSJ6ARJmhfuo89//ZjjKv mbDFPpBR0PcwGsPwgWabUi3GHjq8PAce8en2DYjJdX0bgFzxZORflZRpoxlFPgTG+04t l+xt32h13c9fEHtqyHb4xDTOchEID0DFsA0xqmEwqyC9yE0GDmsQ2S3iGJkF8etLqV46 KzYHaoHoWEs6m1efoCKn+Sm0gsFObf4jWnuK72J9fpzSv14WlG3ASVLSpOl+yAGLvE0x /1yQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=c4zIn2tb; 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-62306-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62306-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCVHRnuTejzH6IkeUfRBKFk3Calj54WB1+eBERg9o+w3Oc3gJ7BJO0KLkyRprO9xCGmtqQB+7prGVP4kPLlqR2IJididpQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id cl15-20020a056a02098f00b005c1b58a321asi1632529pgb.411.2024.02.12.23.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:15:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62306-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=@marliere.net header.s=2024 header.b=c4zIn2tb; 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-62306-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62306-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 70796B242A4 for ; Mon, 12 Feb 2024 20:05:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E80594D584; Mon, 12 Feb 2024 20:04:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="c4zIn2tb" 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 8C2C84CB46 for ; Mon, 12 Feb 2024 20:04:39 +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=1707768280; cv=none; b=DO6fwgPcKuOI2XLlJ0QLJjIAHumpH6G6R8c64X1XZRdt404Mwl5OpfinCsp8i1PDn0+SrloeixtRj2VZZACjDd0cdkQ8DJyrhJMMRdBy/GfQPW3Z8ssDUDnKf/N7rERcWxrxTLCPfR6mX+ti8SvP51wNa+gBpr+4CnMrhZkk+mQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768280; c=relaxed/simple; bh=4ZVBO+ZZ7qJwYsFNWtQW7anbtRxiXhpsOjP25YzoSmg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pPg+IksD9v45u31jtMDY23mRU9KC2nQWMK/kqWlaZkcyyVVsLf/lS4mVwLamZaJsBsilIb5R8VoBjG5iRUj6S/nVNjXqSe9PNUQeKy4ICBiaNp8Xs1p5NWowY3V4p9aOGXNavEEDcE0lKl+3k5Nv2pPxLdH9FwmIFT98KGqyby0= 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=c4zIn2tb; 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-1d76671e5a4so29911465ad.0 for ; Mon, 12 Feb 2024 12:04:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768279; x=1708373079; 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=IRMd3DmLaPwuNfy5qvMqAI9wlvK5phDwU9Cy7L0yCdE=; b=VsD8yadLuUeSW1Uxu0h1JExm7tYbwEjWB86Qp6MjLvEF/H+jmBOklC39ZkUzU7bU95 LPNAxZ9AlOmZhbaMadZHht8UXxMYUbRzvhNLddSs+FnNOFzV1vT134uq/PzA6gTmNl9x NPfRTGArEw/XImJzYuuGe0BsVjHYppTt6mO/77sAmbJEJQuwr5QjrUlZhFZgaLtWwOkq q4Ee8cB8pceWbM0huUG7kFFzwJcwMdYtku4SL8l2FmjtXlP9GB6Q5PJo5qAA1eXepzbH f7tOptN/UtyWeQyECOgS34OdWnRt72z9J6J/jcl49k7RQmhcR9dLgoHZ6ZaHlZ30Jzkh MPrA== X-Forwarded-Encrypted: i=1; AJvYcCWy63SuJ3NKmRaeYdjRt7ijSWCdaC6rlUOukhToA6dpAWV8Ylt4v5djp5g1ui83tq/rjjdoVH/i+E5hIKrAEPyIaIE7SXPgPyufMZmm X-Gm-Message-State: AOJu0Yx0gVzURaYUTcN469Cxe0riFANudgQWaFa1dSAgng3s5cHhzsLu 0H7sb/cru0VGXsyAaB4U5HHq1tVC8+HU/JmQy9E+Rd4AHGdHnC2F X-Received: by 2002:a17:902:e88a:b0:1db:29c2:b695 with SMTP id w10-20020a170902e88a00b001db29c2b695mr1426718plg.41.1707768278917; Mon, 12 Feb 2024 12:04:38 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXIOq0hF/hPZhlh32fYalDvFXC50l3uTYP7hWSp53+wbYCWPD2U7Vnt2zNEe0fbKw/ztcM5EpHruheRt4S22jq14gk7kSPwNdXAd1xZd/3ugxhg+bZZtGsKQIvXGpXPEw5ot+K28yTs5goz5anrzjYvZHlhfXgHmE60+plzST2cGcJjO0FTHpNyKvxPdYLf5QPXp4DMTfwacyxhS9A1MSzNK8wWioUVDLtt6kaNqvEdET6EkP9On3OZd0FMVjvDBi4YZcL0cCvtShqWxNuA Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id l4-20020a170903244400b001d8aadaa7easm722394pls.96.2024.02.12.12.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:04:38 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707768277; 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=IRMd3DmLaPwuNfy5qvMqAI9wlvK5phDwU9Cy7L0yCdE=; b=c4zIn2tbz7DFJpPM+h4TYSt72F581hIWGPMZ+GP0MavbXRgsAwG9eiMvW1/B3iNTvx+Ph5 shCbkAJuNCo1mRxMWL9VNjqDhSBJFKPiaU7uuFd5i8JttlVeJP6cypsUewlXtv2GdO8tRC OpGan+0/nF2g10lB62EDjACYeT4I6vMv1sqmih/drcSfZd0tcZnAndH9kUk9EsBZpzz4P+ RepKnvlD4Ra8SiHFIR75HIA9z6TVQm5FqO82oepZZjDnacdHRjHbx1CglO3hq0AyOIQLe6 azQ0zyyWA9Qw+jQMNsJl8fxC/G5t3wGSyL23nJEFzN4GgfFm3nqpOdj43M0XBw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 12 Feb 2024 17:05:02 -0300 Subject: [PATCH v2 4/5] powerpc: pmac: make macio_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: <20240212-bus_cleanup-powerpc2-v2-4-8441b3f77827@marliere.net> References: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@marliere.net> In-Reply-To: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@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=1614; i=ricardo@marliere.net; h=from:subject:message-id; bh=4ZVBO+ZZ7qJwYsFNWtQW7anbtRxiXhpsOjP25YzoSmg=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlynnv/PyVOgYd2KioAchyKJniQdC3OK4ih9i3z OsxAU/kd92JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcp57wAKCRDJC4p8Y4ZY ph/CD/0RYe4KY9dYDXRqeYmp4qRRSwGRmT9hPk6kjIJFbgBXGecdcHXlNKVqPQr9d7p4lPydOTO U83sQwz3r9UwkhC/yl2h9/2SoDTq2zyko5a34Ll+Iluxlr6BYlZNughubGVIJ9vZawZQKHaQtZs G4cSss9vMQSmSdm18aWOYTDhYJgYSdhVakInGFV3WqOKjNrOxhUI95lsYI8TYZrB5W1x0a3CGFY muRnV6/RzblkFVSGoU6R/vyJs/u1+X6Xp1cRVyr9MxMxJNqLuLH0NGbDnaHVVOcpPVbXA0FKHFH LSLJZ+s+bFuPCak+Iahex9CpyyQnxY3pfNKBnoQVdAe9QLuT6KyLsn5YtnsQRncNIz/Ni0OwMkP g0SodtetAf9V/l3MdY3SMjz2qKqLYgPP6uzScXbi7YN1XwzWTEmwzNkcLMbFwvLLv1pubhfVolu QRqiAqO7JkMLBQe7MsfTqdQ+mfev67du1MR4pePULICnFRBY7lBdVLjsDepRu5q1D5OaCDe56aM RPq0al7Iff/wG6oi/LdJJrONKHtBU+taar+xpcVYVyquc/PTQkxjrx03xq1Ec43Kiq8rJTopwYs 1mJVkf/n3ywVGC/x153u6FzchRyTRn5//f2gzcyNZZ1448srkQZBO8uiEw0NQnvuyGKbEqAZfM/ Vn++nulIlYLNpuA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790767012221035574 X-GMAIL-MSGID: 1790767012221035574 Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the macio_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/macio.h | 2 +- drivers/macintosh/macio_asic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h index 3a07c62973aa..ab9608e63e40 100644 --- a/arch/powerpc/include/asm/macio.h +++ b/arch/powerpc/include/asm/macio.h @@ -6,7 +6,7 @@ #include #include -extern struct bus_type macio_bus_type; +extern const struct bus_type macio_bus_type; /* MacIO device driver is defined later */ struct macio_driver; diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index a5ee8f736a8e..565f1e21ff7d 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -136,7 +136,7 @@ static int macio_device_modalias(const struct device *dev, struct kobj_uevent_en extern const struct attribute_group *macio_dev_groups[]; -struct bus_type macio_bus_type = { +const struct bus_type macio_bus_type = { .name = "macio", .match = macio_bus_match, .uevent = macio_device_modalias, From patchwork Mon Feb 12 20:05:03 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: 200255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp384092dyb; Mon, 12 Feb 2024 23:55:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUcEOVsfPvh3N8r78kk05r6RJyJnMw/fLfHoWK2m8yBPRmad9p/CE8Fefmxpgla7li9FYe X-Received: by 2002:a05:6214:4012:b0:686:4db2:ccc with SMTP id kd18-20020a056214401200b006864db20cccmr12059154qvb.54.1707810908111; Mon, 12 Feb 2024 23:55:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707810908; cv=pass; d=google.com; s=arc-20160816; b=gfr9gc0R/zBB/3EFsiL3jv3EIzbiujyJXsgrPBSevxhIrMFB3/SDEI0bsLWNfAExF+ pUq38T1QdBYoHFcjHCt97lREtYUZfxjw1Io10Cuut1NIMkGVgf5hWlEBIsg7wor34mOY ndd9Y3asnWY0zrwVqpDKLP0Exb5dxm/QbbDunwvdPJcZiYON/sFax97VqsJmypb8blV3 4fXKh68b8law1kK2qZO3o836ojKfOst0InurYAAY5bH6Y7s++QLg+iO1vNR9aq4N9MiH WsINcE2UB4bY8CFo74i0oQE5Jv+d5cYmz6wtxPW2PH6jZFlEv04Z+9vVL7PsLdPpOFIm 3pnA== 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=db2Uhnapp+w5dyUlo+M8v03nvRL1AyZA94jDVlSeXjQ=; fh=nNGYtOK84nuJyQtvvPsCBmaSocyw4B0K578YnYYSqV0=; b=xoKe0pgxde7YWosBc2IKq2Um8lv+JyW8qhxED/AvvGonlej20PWtW+sF3dHu+WFmZ6 VMxnSqbGorPjzN+npomEAqT/h85y1EEGz0XD9jLLnbCZ8yADCB4I283vObSN14MQZIov mzG2F0llcw4H4Hp4pYqmOZZV8MWtHh2QtXd64zrCqa2zLDpMoW3+lI9jm6S8pvKPaqkp CgIKJ8myPY4G+yczVzk1sh8r9qv2SVydrFsvACa1bYucMH+SGEwqPJjMo2zw5ogk/yze MXURnJ1v+8yCnmzZ3/hAILoQeiWWEGG4nOxCQUYn2SjJuigrHUwAGRGfmdouB65qw89b Xdjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b="cj+Gm/K7"; 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-62307-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62307-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCVhEv9iBr7NHfhsYW7o+EscZN9OhNimP97bnCK4qXVCAUhAOEL01VeoxhWNglU15GOgsKiM0vsWWOqoMnlQD4t7UEHEmQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 3-20020ad45ba3000000b0068cbab16e08si2336164qvq.22.2024.02.12.23.55.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:55:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62307-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="cj+Gm/K7"; 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-62307-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62307-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 985101C22E3C for ; Mon, 12 Feb 2024 20:06:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B5634D9F1; Mon, 12 Feb 2024 20:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="cj+Gm/K7" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 D7A784D12D for ; Mon, 12 Feb 2024 20:04:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768284; cv=none; b=HfugDngDLAiV2aV+cPm3BWiWr9ZY/O30Fttd8PL4Q4vnDHdNhMWAWt96vIBhBQK0ZGQz+DN0+EqgIndlepzbRPgXMGF5Vmu4HZtWoS1lirHC7TMsTgqoIajoaOUz51fitsmqUE+J4dGSce5FEDLQguO+JBzGZ6JpVVoJpXK/BPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707768284; c=relaxed/simple; bh=nVdAcq5qBuV+u2+BDT0vbbPtDSUMY5Jwqu+E2afCaAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZW1jB8iOb2+9soxHxOBorkDC7uSmVkQL6vLAOH9eubLK6mxCrdZD25+EzJ4v4Y4B2eH3wPiiSJ1yI71InqD0OkXwC8d/fdlnITIMSf9iwLrvo0luC0CMbfi6FesXgZdKOMiCIbiCj98QrDJMq2akz6i5qDKaKy/bu8RF8HH8NAw= 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=cj+Gm/K7; arc=none smtp.client-ip=209.85.214.170 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-f170.google.com with SMTP id d9443c01a7336-1d746856d85so26794145ad.0 for ; Mon, 12 Feb 2024 12:04:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707768282; x=1708373082; 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=db2Uhnapp+w5dyUlo+M8v03nvRL1AyZA94jDVlSeXjQ=; b=omPk3PQNS7mTh2N9qiZZkxb6tYvt+dRDeXFEEmJlTT2q4Io8N/IBEdzk7aGc3ZH94z 0c2s8qdnCYMtWt+a+MvmoYPugdqvfY8gLjMl1Za4ACVQEd1iC6FaAFn3Cb4U4Pw9w+5Z 0Im5u4ZKeiTPGQgLD57EHZ7xgynnwMAnOxZm6ZPb4BE9JZ+1C5NQbkP/TKgpmynNpma2 shpweoTwBLqAexxyYcwFbTvIwPdu6DnmevaD/5laeAnR5KG6Hr7+dywdE6j1q3jcFE6/ rOryWWPFHx3y7OzQC/gfLUh1je0TYM5P32nPb2Ft9U97uF2ieywSbLe5YoNZjo5SS9A2 EvMg== X-Gm-Message-State: AOJu0Yz6Y9GuX2+1YJe1pxCBPAgocX6DLuc7zW5gBHvUQI1m0nMRvFP5 4WKwwLt26SprcfC1Qsn9uo5yx70ohKP9WLK6OYDmiuxY0hbAWnjK X-Received: by 2002:a17:902:f809:b0:1d9:427a:99b with SMTP id ix9-20020a170902f80900b001d9427a099bmr6869869plb.32.1707768282176; Mon, 12 Feb 2024 12:04:42 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWh06n6YhsaJA8HcOSOeEyE9tkWsBCUMlmMXjeAnxBL4mwLpDYhrSU2gThu1OCwH7Tau36MBJYZphBqkJchgGjcyncBBsXHIJruIwI8Ole3n3F9/VRVKVB2qTX2N58J23sA47waUHOedZm391zeUNE+j14/lsHLrrhmeE9snpx+RZDvn6UQTIuX9YkVt8JooBJawbmG+IUTM/zc6+4pJNgcrM+SSCcdyLXEva9I5s2NuwFIeFRTfdz/ML1VMMmAhCF2D7ZeKLIjeIFTmOQB Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id s2-20020a170902c64200b001d958de13c7sm759098pls.0.2024.02.12.12.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:04:41 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707768280; 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=db2Uhnapp+w5dyUlo+M8v03nvRL1AyZA94jDVlSeXjQ=; b=cj+Gm/K7r/ULgwd1zluQ8A+gbU2ta02TRefNIMEOMo0pSU1uNofUxpm4ooY+ye2Iy6fHzd XlX/D+Kz7L1VgVRzoTUFqmBOT9oZGmouYaiKKAAmhvU/bgC/+v9k1GhSrAfhWID44UVfxS EN55cY/ZxwvygA3SM9wJ7CbIju4vcYE3Qht4GWa/PssSB64Yx0ppDk4GHnl+5ZyLtKwQkh /zpDf674RgUBRT2n3i181r1hIzyKtkiaZBJwiYeemDB8RcsiRwTlgwkellA93FfVNmxYxg 9Ap6d8BNw/d9/OeWUgoM6AEQH7xlb82Q+yOWADkwBn5SZqO0R1qT/+g3M6ciAg== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 12 Feb 2024 17:05:03 -0300 Subject: [PATCH v2 5/5] 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: <20240212-bus_cleanup-powerpc2-v2-5-8441b3f77827@marliere.net> References: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@marliere.net> In-Reply-To: <20240212-bus_cleanup-powerpc2-v2-0-8441b3f77827@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=2050; i=ricardo@marliere.net; h=from:subject:message-id; bh=nVdAcq5qBuV+u2+BDT0vbbPtDSUMY5Jwqu+E2afCaAQ=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlynnv/phT/tgLAi3w01xX1x1lm+XkR/vq3YP08 H7MNNK8uo6JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcp57wAKCRDJC4p8Y4ZY pqLmD/wIPQTXfZHkPBsZz+WbeisckhU1iPI9/FW4ze2PGk/olNSI56xfFPbRxqvEQpuVUjym3t3 Rx7QRjXneci1tfF+gw7xi2JJIAeXHtECUF+sox6V2X4B9SW9i35gGWfQHAZMUgyuJew/UuFWkW9 II8liY2MgGjEhVDudIf8uaiazWWzQiS5INaA6NtQdDgjKWRLO8bZ9jgOh41GSRbmJ6ce1RhCan4 q+QChn0KQKd2xTCxGAC/5cffnhOTyqhDW98TLHou90NiFJR4lAGuI1vu87fOsJ7466CT95W82iv th6FiAUmNSErQkN4uHdr95oDgXsx/xQP73ccL+TRNiAZmy+opUIvaxZXyG29euJNIxdQnfmGZV/ j3UnxUIzcx7pVierP7VmNtIb7I1ISXYyVRdtmBYepA6p57OdiSkpizqoM/6+Rts55swvYVIQ9bl VkwMmBHWio39eH0MKHv8HyDOY4uBsJbvPD5qrPZiv6ukIsbyaJpv8d+I6JgUSqhOzYJeMezFlah kLxLtsQhvIf/UgmB0FAfmkBLSse5FhFGk6/18o+fx0Ix+VNLD+JT48G99Fyv/MUdfSK82izeSiC cF/9SaUKQTYG93oeKu6+dHB0zGDihLVkUyZ5guQDxwJZez53nwi8VhxF7keoTqTuE3oA61bl35x YIjcK1OIQ3FScuA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790769530632912290 X-GMAIL-MSGID: 1790769530632912290 Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), 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 | 4 ++-- 2 files changed, 3 insertions(+), 3 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..b401282727a4 100644 --- a/arch/powerpc/platforms/pseries/ibmebus.c +++ b/arch/powerpc/platforms/pseries/ibmebus.c @@ -55,7 +55,7 @@ static struct device ibmebus_bus_device = { /* fake "parent" device */ .init_name = "ibmebus", }; -struct bus_type ibmebus_bus_type; +const struct bus_type ibmebus_bus_type; /* These devices will automatically be added to the bus during init */ static const struct of_device_id ibmebus_matches[] __initconst = { @@ -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,