linux-next: build failure after merge of the driver-core tree
Subsystems (2)
Hi all,
After merging the driver-core tree, today's linux-next build (powerpc ppc64_defconfig) failed like this:
drivers/i2c/i2c-core-base.c: In function 'delete_device_store':drivers/i2c/i2c-core-base.c:1350:58: error: passing argument 3 of 'device_find_child' from incompatible pointer type [-Wincompatible-pointer-types]
1350 | child_dev = device_find_child(&adap->dev, &addr, __i2c_find_user_addr);
| ^~~~~~~~~~~~~~~~~~~~
| |
| int (*)(struct device *, void *)
In file included from include/linux/acpi.h:14,
from drivers/i2c/i2c-core-base.c:16:
include/linux/device.h:1085:49: note: expected 'device_match_t' {aka 'int (*)(struct device *, const void *)'} but argument is of type 'int (*)(struct device *, void *)'
1085 | device_match_t match);
| ~~~~~~~~~~~~~~~^~~~~Caused by commit
f1e8bf56320a ("driver core: Constify API device_find_child() and adapt for various usages")
interacting with commit
3cfe39b3a845 ("i2c: Replace list-based mechanism for handling userspace-created clients")
from the i2c tree.
I have applied the following merge fix patch.
From: Stephen Rothwell <[email protected]>
Date: Mon, 6 Jan 2025 15:33:36 +1100
Subject: [PATCH] fix up for "driver core: Constify API device_find_child() and
adapt for various usages"
interacting with commit
3cfe39b3a845 ("i2c: Replace list-based mechanism for handling userspace-created clients")
from the i2c tree.
--- drivers/i2c/i2c-core-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core-base.c +2 -2
@@ -1306,10 +1306,10 @@ new_device_store(struct device *dev, struct device_attribute *attr, }static DEVICE_ATTR_WO (new_device); -static int __i2c_find_user_addr (struct device *dev,void *addrp) +static int __i2c_find_user_addr (struct device *dev,const void *addrp) {struct i2c_client *client =i2c_verify_client (dev); -unsigned short addr = *(unsigned short *)addrp; +unsigned short addr = *(const unsigned short *)addrp;return client && client->flags &I2C_CLIENT_USER &&i2c_encode_flags_to_addr (client) == addr;
Signature · 5 lines
2.45.2 -- Cheers, Stephen Rothwell
Zijun Hu
Reviewed-byQuoted 52 lines · Stephen Rothwell
Hi all,
After merging the driver-core tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:
drivers/i2c/i2c-core-base.c: In function 'delete_device_store':drivers/i2c/i2c-core-base.c:1350:58: error: passing argument 3 of 'device_find_child' from incompatible pointer type [-Wincompatible-pointer-types]1350 | child_dev = device_find_child(&adap->dev, &addr, __i2c_find_user_addr); | ^~~~~~~~~~~~~~~~~~~~ | | | int (*)(struct device *, void *) In file included from include/linux/acpi.h:14, from drivers/i2c/i2c-core-base.c:16: include/linux/device.h:1085:49: note: expected 'device_match_t' {aka 'int (*)(struct device *, const void *)'} but argument is of type 'int (*)(struct device *, void *)' 1085 | device_match_t match); | ~~~~~~~~~~~~~~~^~~~~Caused by commit
f1e8bf56320a("driver core: Constify APIdevice_find_child()and adapt for various usages")interacting with commit
3cfe39b3a845("i2c: Replace list-based mechanism for handling userspace-created clients")from the i2c tree.
I have applied the following merge fix patch.
From: Stephen Rothwell <[email protected]>
Date: Mon, 6 Jan 2025 15:33:36 +1100
Subject: [PATCH] fix up for "driver core: Constify APIdevice_find_child()and
adapt for various usages"interacting with commit
3cfe39b3a845("i2c: Replace list-based mechanism for handling userspace-created clients")from the i2c tree.
Signed-off-by Stephen Rothwell <[email protected]>--- drivers/i2c/i2c-core-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/i2c-core-base.c +0
-0@@ -1306,10 +1306,10 @@ new_device_store(struct device *dev, struct device_attribute *attr, }static DEVICE_ATTR_WO (new_device);
drivers/i2c/i2c-core-base.c new_device_store(struct device *dev, struct device_attribute *attr, · line 1315
Quoted 10 lines
drivers/i2c/i2c-core-base.c +2
-2-static int __i2c_find_user_addr (struct device *dev,void *addrp) +static int __i2c_find_user_addr (struct device *dev,const void *addrp) {struct i2c_client *client =i2c_verify_client (dev); -unsigned short addr = *(unsigned short *)addrp; +unsigned short addr = *(const unsigned short *)addrp;return client && client->flags &I2C_CLIENT_USER &&i2c_encode_flags_to_addr (client) == addr;
LGTM, thank you Stephen for this fix.