[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <640fab62cdd53_239fd62942@iweiny-mobl.notmuch>
Date: Mon, 13 Mar 2023 16:01:54 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
<linux-kernel@...r.kernel.org>
CC: <rafael@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"David S. Miller" <davem@...emloft.net>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Alex Shi <alexs@...nel.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Alexandre Bounine <alex.bou9@...il.com>,
Alison Schofield <alison.schofield@...el.com>,
"Ben Widawsky" <bwidawsk@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Dan Williams" <dan.j.williams@...el.com>,
Dexuan Cui <decui@...rosoft.com>,
"Eric Dumazet" <edumazet@...gle.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"Hannes Reinecke" <hare@...e.de>,
Harald Freudenberger <freude@...ux.ibm.com>,
"Heiko Carstens" <hca@...ux.ibm.com>, Hu Haowen <src.res@...il.cn>,
Ilya Dryomov <idryomov@...il.com>,
Ira Weiny <ira.weiny@...el.com>,
Iwona Winiarska <iwona.winiarska@...el.com>,
Jakub Kicinski <kuba@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Jonathan Corbet <corbet@....net>,
Laurentiu Tudor <laurentiu.tudor@....com>,
Matt Porter <mporter@...nel.crashing.org>,
"Michael Ellerman" <mpe@...erman.id.au>,
Paolo Abeni <pabeni@...hat.com>,
Stuart Yoder <stuyoder@...il.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Wei Liu <wei.liu@...nel.org>,
Yanteng Si <siyanteng@...ngson.cn>
Subject: Re: [PATCH 23/36] driver core: bus: mark the struct bus_type for
sysfs callbacks as constant
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@...emloft.net>
> Cc: "James E.J. Bottomley" <jejb@...ux.ibm.com>
> Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
> Cc: "Martin K. Petersen" <martin.petersen@...cle.com>
> Cc: Alex Shi <alexs@...nel.org>
> Cc: Alexander Gordeev <agordeev@...ux.ibm.com>
> Cc: Alexandre Bounine <alex.bou9@...il.com>
> Cc: Alison Schofield <alison.schofield@...el.com>
> Cc: Ben Widawsky <bwidawsk@...nel.org>
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Dexuan Cui <decui@...rosoft.com>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> Cc: Hannes Reinecke <hare@...e.de>
> Cc: Harald Freudenberger <freude@...ux.ibm.com>
> Cc: Heiko Carstens <hca@...ux.ibm.com>
> Cc: Hu Haowen <src.res@...il.cn>
> Cc: Ilya Dryomov <idryomov@...il.com>
> Cc: Ira Weiny <ira.weiny@...el.com>
> Cc: Iwona Winiarska <iwona.winiarska@...el.com>
> Cc: Jakub Kicinski <kuba@...nel.org>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: Jonathan Corbet <corbet@....net>
> Cc: Laurentiu Tudor <laurentiu.tudor@....com>
> Cc: Matt Porter <mporter@...nel.crashing.org>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: Stuart Yoder <stuyoder@...il.com>
> Cc: Vasily Gorbik <gor@...ux.ibm.com>
> Cc: Vishal Verma <vishal.l.verma@...el.com>
> Cc: Wei Liu <wei.liu@...nel.org>
> Cc: Yanteng Si <siyanteng@...ngson.cn>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Acked-by: Ira Weiny <ira.weiny@...el.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);
Powered by blists - more mailing lists