Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: idxd: use const struct bus_type *

In the functions unbind_store() and bind_store(), a struct bus_type *
should be a const one, as the driver core bus functions used by this
variable are expecting the pointer to be constant, and these functions
do not modify the pointer at all.

Cc: dmaengine@vger.kernel.org
Acked-by: Vinod Koul <vkoul@kernel.org>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230313182918.1312597-32-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -2
+2 -2
drivers/dma/idxd/compat.c
··· 16 16 17 17 static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) 18 18 { 19 - struct bus_type *bus = drv->bus; 19 + const struct bus_type *bus = drv->bus; 20 20 struct device *dev; 21 21 int rc = -ENODEV; 22 22 ··· 32 32 33 33 static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) 34 34 { 35 - struct bus_type *bus = drv->bus; 35 + const struct bus_type *bus = drv->bus; 36 36 struct device *dev; 37 37 struct device_driver *alt_drv = NULL; 38 38 int rc = -ENODEV;