driver core: fix up some missing class.devnode() conversions.
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 1/1 driver core: fix up some missing class.devnode() conversions.
In commit ff62b8e6588f ("driver core: make struct class.devnode() take a const *") the ->devnode callback changed the pointer to be const, but a few instances of PowerPC drivers were not caught for some reason.
Fix this up by changing the pointers to be const.
--- arch/powerpc/platforms/book3s/vas-api.c | 2 +- drivers/misc/cxl/file.c | 2 +- drivers/misc/ocxl/file.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/platforms/book3s/vas-api.c +1 -1
@@ -53,7 +53,7 @@ struct coproc_instance {struct vas_window *txwin; }; -static char *coproc_devnode (struct device *dev,umode_t *mode) +static char *coproc_devnode (const struct device *dev,umode_t *mode) {return kasprintf (GFP_KERNEL ,"crypto/%s" ,dev_name (dev)); }
drivers/misc/cxl/file.c +1 -1
@@ -546,7 +546,7 @@ static const struct file_operations afu_master_fops = { }; -static char *cxl_devnode (struct device *dev,umode_t *mode) +static char *cxl_devnode (const struct device *dev,umode_t *mode) {if (cpu_has_feature (CPU_FTR_HVMODE ) &&CXL_DEVT_IS_CARD (dev->devt)) {
drivers/misc/ocxl/file.c +1 -1
@@ -581,7 +581,7 @@ void ocxl_file_unregister_afu(struct ocxl_afu *afu)device_unregister (&info->dev); } -static char *ocxl_devnode (struct device *dev,umode_t *mode) +static char *ocxl_devnode (const struct device *dev,umode_t *mode) {return kasprintf (GFP_KERNEL ,"ocxl/%s" ,dev_name (dev)); }
Signature · 1 line
2.38.1
Le 28/11/2022 à 18:35, Greg Kroah-Hartman a écrit :
Quoted 5 lines
In commit
ff62b8e6588f("driver core: make structclass.devnode()take a const *") the ->devnode callback changed the pointer to be const, but a few instances of PowerPC drivers were not caught for some reason.Fix this up by changing the pointers to be const.
Build fails:
/linux/arch/powerpc/platforms/book3s/vas-api.c: In function 'vas_register_coproc_api':
/linux/arch/powerpc/platforms/book3s/vas-api.c:590:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
coproc_device.class->devnode = coproc_devnode;
^cc1: all warnings being treated as errors
Quoted 56 lines
Reported-by Stephen Rothwell <[email protected]>Cc Michael Ellerman <[email protected]>Cc Nicholas Piggin <[email protected]>Cc Christophe Leroy <[email protected]>Cc Frederic Barrat <[email protected]>Cc Andrew Donnellan <[email protected]>Cc Arnd Bergmann <[email protected]>Fixes ff62b8e6588f ("driver core: make struct class.devnode() take a const *")Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/powerpc/platforms/book3s/vas-api.c | 2 +- drivers/misc/cxl/file.c | 2 +- drivers/misc/ocxl/file.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)arch/powerpc/platforms/book3s/vas-api.c +1
-1@@ -53,7 +53,7 @@ struct coproc_instance {struct vas_window *txwin; }; -static char *coproc_devnode (struct device *dev,umode_t *mode) +static char *coproc_devnode (const struct device *dev,umode_t *mode) {return kasprintf (GFP_KERNEL ,"crypto/%s" ,dev_name (dev)); }drivers/misc/cxl/file.c +1
-1@@ -546,7 +546,7 @@ static const struct file_operations afu_master_fops = { }; -static char *cxl_devnode (struct device *dev,umode_t *mode) +static char *cxl_devnode (const struct device *dev,umode_t *mode) {if (cpu_has_feature (CPU_FTR_HVMODE ) &&CXL_DEVT_IS_CARD (dev->devt)) {drivers/misc/ocxl/file.c +1
-1@@ -581,7 +581,7 @@ void ocxl_file_unregister_afu(struct ocxl_afu *afu)device_unregister (&info->dev); } -static char *ocxl_devnode (struct device *dev,umode_t *mode) +static char *ocxl_devnode (const struct device *dev,umode_t *mode) {return kasprintf (GFP_KERNEL ,"ocxl/%s" ,dev_name (dev)); }
Greg Kroah-Hartman
maintainerQuoted 11 lines · Christophe Leroy
Le 28/11/2022 à 18:35, Greg Kroah-Hartman a écrit :
Quoted 5 lines
In commit
ff62b8e6588f("driver core: make structclass.devnode()take a const *") the ->devnode callback changed the pointer to be const, but a few instances of PowerPC drivers were not caught for some reason.Fix this up by changing the pointers to be const.
Build fails:
Quoted 7 lines
/linux/arch/powerpc/platforms/book3s/vas-api.c: In function '
vas_register_coproc_api':
/linux/arch/powerpc/platforms/book3s/vas-api.c:590:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]coproc_device.class->devnode = coproc_devnode; ^cc1: all warnings being treated as errors
What did you build this against? It has to be be against my driver-core-next tree as that is where the Fixes: commit is.
thanks,
greg k-h
Le 29/11/2022 à 09:27, Greg Kroah-Hartman a écrit :
Quoted 20 lines · Christophe Leroy
Quoted 11 lines
Le 28/11/2022 à 18:35, Greg Kroah-Hartman a écrit :
Quoted 5 lines
In commit
ff62b8e6588f("driver core: make structclass.devnode()take a const *") the ->devnode callback changed the pointer to be const, but a few instances of PowerPC drivers were not caught for some reason.Fix this up by changing the pointers to be const.
Build fails:
Quoted 7 lines
/linux/arch/powerpc/platforms/book3s/vas-api.c: In function '
vas_register_coproc_api':
/linux/arch/powerpc/platforms/book3s/vas-api.c:590:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]coproc_device.class->devnode = coproc_devnode; ^cc1: all warnings being treated as errors
Quoted 3 lines
What did you build this against? It has to be be against my driver-core-next tree as that is where the Fixes: commit is.
Failure was reported by powerpc patchwork :
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/[email protected]/