[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57762efb335cb27ff2995a8c4263083f66546061.camel@intel.com>
Date: Wed, 15 Mar 2023 15:05:38 +0000
From: "Winiarska, Iwona" <iwona.winiarska@...el.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "alexs@...nel.org" <alexs@...nel.org>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"siyanteng@...ngson.cn" <siyanteng@...ngson.cn>,
"agordeev@...ux.ibm.com" <agordeev@...ux.ibm.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
"kys@...rosoft.com" <kys@...rosoft.com>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"hca@...ux.ibm.com" <hca@...ux.ibm.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"corbet@....net" <corbet@....net>,
"Verma, Vishal L" <vishal.l.verma@...el.com>,
"laurentiu.tudor@....com" <laurentiu.tudor@....com>,
"bwidawsk@...nel.org" <bwidawsk@...nel.org>,
"mpe@...erman.id.au" <mpe@...erman.id.au>,
"rafael@...nel.org" <rafael@...nel.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"Cui, Dexuan" <decui@...rosoft.com>, "hare@...e.de" <hare@...e.de>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"src.res@...il.cn" <src.res@...il.cn>,
"gor@...ux.ibm.com" <gor@...ux.ibm.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"mporter@...nel.crashing.org" <mporter@...nel.crashing.org>,
"Weiny, Ira" <ira.weiny@...el.com>,
"idryomov@...il.com" <idryomov@...il.com>,
"freude@...ux.ibm.com" <freude@...ux.ibm.com>,
"alex.bou9@...il.com" <alex.bou9@...il.com>,
"stuyoder@...il.com" <stuyoder@...il.com>,
"Schofield, Alison" <alison.schofield@...el.com>
Subject: Re: [PATCH 23/36] driver core: bus: mark the struct bus_type for
sysfs callbacks as constant
On Mon, 2023-03-13 at 19:29 +0100, 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>
> ---
> 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/peci/sysfs.c b/drivers/peci/sysfs.c
> index db9ef05776e3..c04244075794 100644
> --- a/drivers/peci/sysfs.c
> +++ b/drivers/peci/sysfs.c
> @@ -15,7 +15,7 @@ static int rescan_controller(struct device *dev, void *data)
> return peci_controller_scan_devices(to_peci_controller(dev));
> }
>
> -static ssize_t rescan_store(struct bus_type *bus, const char *buf, size_t
> count)
> +static ssize_t rescan_store(const struct bus_type *bus, const char *buf,
> size_t count)
> {
> bool res;
> int ret;
Acked-by: Iwona Winiarska <iwona.winiarska@...el.com>
Thanks
-Iwona
Powered by blists - more mailing lists