From: Ira Weiny <ira.weiny@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>
Cc: <rafael@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"David S. Miller" <davem@davemloft.net>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Alex Shi <alexs@kernel.org>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Alexandre Bounine <alex.bou9@gmail.com>,
Alison Schofield <alison.schofield@intel.com>,
"Ben Widawsky" <bwidawsk@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
"Dan Williams" <dan.j.williams@intel.com>,
Dexuan Cui <decui@microsoft.com>,
"Eric Dumazet" <edumazet@google.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"Hannes Reinecke" <hare@suse.de>,
Harald Freudenberger <freude@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
Hu Haowen <src.res@email.cn>, Ilya Dryomov <idryomov@gmail.com>,
Ira Weiny <ira.weiny@intel.com>,
Iwona Winiarska <iwona.winiarska@intel.com>,
Jakub Kicinski <kuba@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Jonathan Corbet <corbet@lwn.net>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>,
Matt Porter <mporter@kernel.crashing.org>,
"Michael Ellerman" <mpe@ellerman.id.au>,
Paolo Abeni <pabeni@redhat.com>,
Stuart Yoder <stuyoder@gmail.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Wei Liu <wei.liu@kernel.org>, Yanteng Si <siyanteng@loongson.cn>
Subject: Re: [PATCH 23/36] driver core: bus: mark the struct bus_type for sysfs callbacks as constant
Date: Mon, 13 Mar 2023 16:01:54 -0700 [thread overview]
Message-ID: <640fab62cdd53_239fd62942@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20230313182918.1312597-23-gregkh@linuxfoundation.org>
Greg Kroah-Hartman wrote:
> struct bus_type should never be modified in a sysfs callback as there is
> nothing in the structure to modify, and frankly, the structure is almost
> never used in a sysfs callback, so mark it as constant to allow struct
> bus_type to be moved to read-only memory.
>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
> Cc: "K. Y. Srinivasan" <kys@microsoft.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: Alex Shi <alexs@kernel.org>
> Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> Cc: Alexandre Bounine <alex.bou9@gmail.com>
> Cc: Alison Schofield <alison.schofield@intel.com>
> Cc: Ben Widawsky <bwidawsk@kernel.org>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Dexuan Cui <decui@microsoft.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Harald Freudenberger <freude@linux.ibm.com>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Hu Haowen <src.res@email.cn>
> Cc: Ilya Dryomov <idryomov@gmail.com>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Iwona Winiarska <iwona.winiarska@intel.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> Cc: Matt Porter <mporter@kernel.crashing.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Stuart Yoder <stuyoder@gmail.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Cc: Wei Liu <wei.liu@kernel.org>
> Cc: Yanteng Si <siyanteng@loongson.cn>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Ira Weiny <ira.weiny@intel.com> # cxl
> ---
> Note, this is a patch that is a prepatory cleanup as part of a larger
> series of patches that is working on resolving some old driver core
> design mistakes. It will build and apply cleanly on top of 6.3-rc2 on
> its own, but I'd prefer if I could take it through my driver-core tree
> so that the driver core changes can be taken through there for 6.4-rc1.
>
> Documentation/driver-api/driver-model/bus.rst | 4 +-
> Documentation/filesystems/sysfs.rst | 4 +-
> .../translations/zh_CN/filesystems/sysfs.txt | 4 +-
> .../translations/zh_TW/filesystems/sysfs.txt | 4 +-
> arch/powerpc/platforms/pseries/ibmebus.c | 4 +-
> arch/powerpc/platforms/pseries/vio.c | 8 ++--
> drivers/ata/pata_parport/pata_parport.c | 6 +--
> drivers/base/bus.c | 8 ++--
> drivers/block/rbd.c | 34 +++++++--------
> drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +--
> drivers/cxl/core/port.c | 2 +-
> drivers/hv/vmbus_drv.c | 2 +-
> drivers/net/netdevsim/bus.c | 4 +-
> drivers/pci/pci-sysfs.c | 2 +-
> drivers/pci/pci.c | 4 +-
> drivers/peci/sysfs.c | 2 +-
> drivers/rapidio/rio-sysfs.c | 2 +-
> drivers/s390/crypto/ap_bus.c | 42 +++++++++----------
> drivers/scsi/fcoe/fcoe_sysfs.c | 8 ++--
> drivers/scsi/fcoe/fcoe_transport.c | 6 +--
> include/linux/device/bus.h | 4 +-
> include/scsi/libfcoe.h | 6 +--
> 22 files changed, 78 insertions(+), 88 deletions(-)
>
[...]
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index 8ee6b6e2e2a4..66333cd6248e 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -1927,7 +1927,7 @@ bool schedule_cxl_memdev_detach(struct cxl_memdev *cxlmd)
> EXPORT_SYMBOL_NS_GPL(schedule_cxl_memdev_detach, CXL);
>
> /* for user tooling to ensure port disable work has completed */
> -static ssize_t flush_store(struct bus_type *bus, const char *buf, size_t count)
> +static ssize_t flush_store(const struct bus_type *bus, const char *buf, size_t count)
> {
> if (sysfs_streq(buf, "1")) {
> flush_workqueue(cxl_bus_wq);
next prev parent reply other threads:[~2023-03-13 23:04 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 18:28 [PATCH 01/36] EDAC/sysfs: move to use bus_get_dev_root() Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 02/36] ACPI: LPIT: " Greg Kroah-Hartman
2023-03-13 18:43 ` Rafael J. Wysocki
2023-03-17 14:50 ` Greg Kroah-Hartman
2023-03-22 8:36 ` [PATCH v2 02/19] " Greg Kroah-Hartman
2023-03-22 14:15 ` Rafael J. Wysocki
2023-03-13 18:28 ` [PATCH 03/36] cpufreq: " Greg Kroah-Hartman
2023-03-13 18:45 ` Rafael J. Wysocki
2023-03-13 18:28 ` [PATCH 04/36] platform/x86: ibm_rtl: " Greg Kroah-Hartman
2023-03-15 12:46 ` Hans de Goede
2023-03-13 18:28 ` [PATCH 05/36] platform/x86: intel-uncore-freq: " Greg Kroah-Hartman
2023-03-13 19:14 ` srinivas pandruvada
2023-03-15 12:46 ` Hans de Goede
2023-03-13 18:28 ` [PATCH 06/36] cpuidle: " Greg Kroah-Hartman
2023-03-13 18:58 ` Rafael J. Wysocki
2023-03-22 9:04 ` Greg Kroah-Hartman
2023-03-22 9:05 ` [PATCH v2 03/19] " Greg Kroah-Hartman
2023-03-22 14:27 ` Rafael J. Wysocki
2023-03-24 8:56 ` Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 07/36] cpu/hotplug: " Greg Kroah-Hartman
2023-03-20 13:59 ` Thomas Gleixner
2023-03-13 18:28 ` [PATCH 08/36] workqueue: " Greg Kroah-Hartman
2023-03-14 3:31 ` Tejun Heo
2023-03-13 18:28 ` [PATCH 09/36] x86/microcode: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 10/36] x86/umwait: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 11/36] arm64: cpufeature: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 12/36] powerpc/sysfs: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 13/36] powerpc/powernv: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 14/36] powerpc/pseries: " Greg Kroah-Hartman
2023-03-15 2:00 ` Michael Ellerman
2023-03-13 18:28 ` [PATCH 15/36] powerpc/fsl: " Greg Kroah-Hartman
2023-03-13 18:28 ` [PATCH 16/36] sh: dma-sysfs: " Greg Kroah-Hartman
2023-03-13 18:38 ` John Paul Adrian Glaubitz
2023-03-13 18:48 ` John Paul Adrian Glaubitz
2023-03-13 18:28 ` [PATCH 17/36] sh: intc: " Greg Kroah-Hartman
2023-03-13 18:39 ` John Paul Adrian Glaubitz
2023-03-13 18:29 ` [PATCH 18/36] s390/topology: " Greg Kroah-Hartman
2023-03-14 11:34 ` Heiko Carstens
2023-03-13 18:29 ` [PATCH 19/36] s390/smp: " Greg Kroah-Hartman
2023-03-14 11:35 ` Heiko Carstens
2023-03-13 18:29 ` [PATCH 20/36] cpufreq: amd-pstate: " Greg Kroah-Hartman
2023-03-14 6:04 ` Huang Rui
2023-03-13 18:29 ` [PATCH 21/36] irqchip/mbigen: " Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 22/36] driver core: bus: move dev_root out of struct bus_type Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 23/36] driver core: bus: mark the struct bus_type for sysfs callbacks as constant Greg Kroah-Hartman
2023-03-13 19:14 ` Bjorn Helgaas
2023-03-13 22:41 ` Wei Liu
2023-03-13 23:01 ` Ira Weiny [this message]
2023-03-14 7:10 ` Harald Freudenberger
2023-03-14 17:43 ` Dan Williams
2023-03-15 2:33 ` Martin K. Petersen
2023-03-15 11:10 ` Ilya Dryomov
2023-03-15 11:51 ` Alex Shi
2023-03-15 15:05 ` Winiarska, Iwona
2023-03-13 18:29 ` [PATCH 24/36] driver core: bus: constantify bus_register() Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 25/36] driver core: bus: constify bus_rescan_devices() Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 26/36] driver core: bus: constify driver_find() Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 27/36] driver core: bus: constify bus_get() Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 28/36] driver core: make the bus_type in struct device_driver constant Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 29/36] crypto: hisilicon/qm - make struct bus_type * const Greg Kroah-Hartman
2023-03-14 8:22 ` Herbert Xu
2023-03-13 18:29 ` [PATCH 30/36] drm/i915/huc: use const struct bus_type pointers Greg Kroah-Hartman
2023-03-15 10:15 ` Tvrtko Ursulin
2023-03-13 18:29 ` [PATCH 31/36] vhost-vdpa: vhost_vdpa_alloc_domain() should be using a const struct bus_type * Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 32/36] dmaengine: idxd: use " Greg Kroah-Hartman
2023-03-13 19:07 ` Fenghua Yu
2023-03-16 10:16 ` Greg Kroah-Hartman
2023-03-16 23:57 ` Fenghua Yu
2023-03-24 8:57 ` Greg Kroah-Hartman
2023-03-17 17:19 ` Vinod Koul
2023-03-17 17:33 ` Dave Jiang
2023-03-13 18:29 ` [PATCH 33/36] ARM/dma-mapping: const a pointer to bus_type in arm_iommu_create_mapping() Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 34/36] iommu: make the pointer to struct bus_type constant Greg Kroah-Hartman
2023-03-22 12:13 ` Joerg Roedel
2023-03-13 18:29 ` [PATCH 35/36] driver core: device.h: make struct bus_type a const * Greg Kroah-Hartman
2023-03-13 18:29 ` [PATCH 36/36] USB: mark all struct bus_type as const Greg Kroah-Hartman
2023-03-14 8:48 ` Heikki Krogerus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=640fab62cdd53_239fd62942@iweiny-mobl.notmuch \
--to=ira.weiny@intel.com \
--cc=agordeev@linux.ibm.com \
--cc=alex.bou9@gmail.com \
--cc=alexs@kernel.org \
--cc=alison.schofield@intel.com \
--cc=axboe@kernel.dk \
--cc=bhelgaas@google.com \
--cc=bwidawsk@kernel.org \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=hare@suse.de \
--cc=hca@linux.ibm.com \
--cc=idryomov@gmail.com \
--cc=iwona.winiarska@intel.com \
--cc=jejb@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=laurentiu.tudor@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpe@ellerman.id.au \
--cc=mporter@kernel.crashing.org \
--cc=pabeni@redhat.com \
--cc=rafael@kernel.org \
--cc=siyanteng@loongson.cn \
--cc=src.res@email.cn \
--cc=stuyoder@gmail.com \
--cc=vishal.l.verma@intel.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox