Messages in this thread | | | From | "Winiarska, Iwona" <> | Subject | Re: [PATCH 23/36] driver core: bus: mark the struct bus_type for sysfs callbacks as constant | Date | Wed, 15 Mar 2023 15:05:38 +0000 |
| |
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@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> > --- > 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@intel.com>
Thanks -Iwona
| |