From 75cff725d9566699a670a02b3cfd1c6e9e9ed53e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 19:29:05 +0100 Subject: driver core: bus: mark the struct bus_type for sysfs callbacks as constant 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" Cc: "James E.J. Bottomley" Cc: "K. Y. Srinivasan" Cc: Alexander Gordeev Cc: Alexandre Bounine Cc: Alison Schofield Cc: Ben Widawsky Cc: Dexuan Cui Cc: Eric Dumazet Cc: Haiyang Zhang Cc: Hannes Reinecke Cc: Harald Freudenberger Cc: Heiko Carstens Cc: Hu Haowen Cc: Jakub Kicinski Cc: Jens Axboe Cc: Jonathan Corbet Cc: Laurentiu Tudor Cc: Matt Porter Cc: Michael Ellerman Cc: Paolo Abeni Cc: Stuart Yoder Cc: Vasily Gorbik Cc: Vishal Verma Cc: Yanteng Si Acked-by: Ilya Dryomov # rbd Acked-by: Ira Weiny # cxl Reviewed-by: Alex Shi Acked-by: Iwona Winiarska Acked-by: Dan Williams Acked-by: Bjorn Helgaas # pci Acked-by: Wei Liu Acked-by: Martin K. Petersen # scsi Link: https://lore.kernel.org/r/20230313182918.1312597-23-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/cxl/core/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/cxl') 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); -- cgit v1.2.3