Skip to contentSkip to conversation

linux-next: build failure after merge of the driver-core tree

PATCH Stephen Rothwell 3 participants 3 messages Jan 30, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the driver-core tree, today's linux-next build (powerpc ppc64_defconfig) failed like this:

arch/powerpc/platforms/ps3/system-bus.c:472:19: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
472 | .uevent = ps3_system_bus_uevent,

      |                   ^~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/ps3/system-bus.c:472:19: note: (near initialization for 'ps3_system_bus_type.uevent')
arch/powerpc/platforms/pseries/ibmebus.c:436:22: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
  436 |         .uevent    = ibmebus_bus_modalias,
      |                      ^~~~~~~~~~~~~~~~~~~~

arch/powerpc/platforms/pseries/ibmebus.c:436:22: note: (near initialization for 'ibmebus_bus_type.uevent')

Caused by commit

2a81ada32f0e ("driver core: make struct bus_type.uevent() take a const *")

I have applied the following merge fix patch.

From: Stephen Rothwell <[email protected]>
Date: Mon, 30 Jan 2023 14:31:49 +1100
Subject: [PATCH] driver core: fixup for "driver core: make struct bus_type.uevent() take a const *"

---
 arch/powerpc/include/asm/ps3.h           | 2 +-
 arch/powerpc/platforms/ps3/system-bus.c  | 2 +-
 arch/powerpc/platforms/pseries/ibmebus.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/ps3.h +1 -1
index d503dbd7856c..a5f36546a052 100644
@@ -396,7 +396,7 @@ static inline struct ps3_system_bus_driver *ps3_drv_to_system_bus_drv(
 	return container_of(_drv, struct ps3_system_bus_driver, core);
 }
 static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev(
-	struct device *_dev)
+	const struct device *_dev)
 {
 	return container_of(_dev, struct ps3_system_bus_device, core);
 }
arch/powerpc/platforms/ps3/system-bus.c +1 -1
index 38a7e02295c8..d6b5f5ecd515 100644
@@ -439,7 +439,7 @@ static void ps3_system_bus_shutdown(struct device *_dev)
 	dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
 }
 
-static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env)
+static int ps3_system_bus_uevent(const struct device *_dev, struct kobj_uevent_env *env)
 {
 	struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
 
arch/powerpc/platforms/pseries/ibmebus.c +1 -1
index 58b798a0e879..bb9c18682783 100644
@@ -426,7 +426,7 @@ static struct attribute *ibmebus_bus_device_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ibmebus_bus_device);
 
-static int ibmebus_bus_modalias(struct device *dev, struct kobj_uevent_env *env)
+static int ibmebus_bus_modalias(const struct device *dev, struct kobj_uevent_env *env)
 {
 	return of_device_uevent_modalias(dev, env);
 }
Signature · 5 lines
2.35.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 73 lines · Stephen Rothwell

Hi all,

After merging the driver-core tree, today's linux-next build (powerpc ppc64_defconfig) failed like this:

arch/powerpc/platforms/ps3/system-bus.c:472:19: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
472 | .uevent = ps3_system_bus_uevent,

      |                   ^~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/ps3/system-bus.c:472:19: note: (near initialization for 'ps3_system_bus_type.uevent')
arch/powerpc/platforms/pseries/ibmebus.c:436:22: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
  436 |         .uevent    = ibmebus_bus_modalias,
      |                      ^~~~~~~~~~~~~~~~~~~~

arch/powerpc/platforms/pseries/ibmebus.c:436:22: note: (near initialization for 'ibmebus_bus_type.uevent')

Caused by commit

2a81ada32f0e ("driver core: make struct bus_type.uevent() take a const *")

I have applied the following merge fix patch.

From: Stephen Rothwell <[email protected]>
Date: Mon, 30 Jan 2023 14:31:49 +1100
Subject: [PATCH] driver core: fixup for "driver core: make struct bus_type.uevent() take a const *"

---
 arch/powerpc/include/asm/ps3.h           | 2 +-
 arch/powerpc/platforms/ps3/system-bus.c  | 2 +-
 arch/powerpc/platforms/pseries/ibmebus.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/ps3.h +1 -1
index d503dbd7856c..a5f36546a052 100644
@@ -396,7 +396,7 @@ static inline struct ps3_system_bus_driver *ps3_drv_to_system_bus_drv(
 	return container_of(_drv, struct ps3_system_bus_driver, core);
 }
 static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev(
-	struct device *_dev)
+	const struct device *_dev)
 {
 	return container_of(_dev, struct ps3_system_bus_device, core);
 }
arch/powerpc/platforms/ps3/system-bus.c +1 -1
index 38a7e02295c8..d6b5f5ecd515 100644
@@ -439,7 +439,7 @@ static void ps3_system_bus_shutdown(struct device *_dev)
 	dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
 }
 
-static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env)
+static int ps3_system_bus_uevent(const struct device *_dev, struct kobj_uevent_env *env)
 {
 	struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
 
arch/powerpc/platforms/pseries/ibmebus.c +1 -1
index 58b798a0e879..bb9c18682783 100644
@@ -426,7 +426,7 @@ static struct attribute *ibmebus_bus_device_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ibmebus_bus_device);
 
-static int ibmebus_bus_modalias(struct device *dev, struct kobj_uevent_env *env)
+static int ibmebus_bus_modalias(const struct device *dev, struct kobj_uevent_env *env)
 {
 	return of_device_uevent_modalias(dev, env);
 }
Signature · 1 line
2.35.1

Ick, 0-day didn't catch this, which is odd, it must not build those arches :(

I'll go queue this up now, thanks for the fix!

greg k-h

#2 lore raw

Hi Greg,

Quoted 13 lines · Greg KH
Quoted 12 lines · Stephen Rothwell

After merging the driver-core tree, today's linux-next build (powerpc ppc64_defconfig) failed like this:

arch/powerpc/platforms/ps3/system-bus.c:472:19: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
472 | .uevent = ps3_system_bus_uevent,

      |                   ^~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/ps3/system-bus.c:472:19: note: (near initialization for 'ps3_system_bus_type.uevent')
arch/powerpc/platforms/pseries/ibmebus.c:436:22: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
  436 |         .uevent    = ibmebus_bus_modalias,
      |                      ^~~~~~~~~~~~~~~~~~~~

arch/powerpc/platforms/pseries/ibmebus.c:436:22: note: (near initialization for 'ibmebus_bus_type.uevent')

Quoted 6 lines
Quoted 3 lines

Caused by commit

2a81ada32f0e ("driver core: make struct bus_type.uevent() take a const *")

Ick, 0-day didn't catch this, which is odd, it must not build those arches :(

It does, but the bot seems to have some issues, as I didn't receive any reports for a few days.
Last report of a ps3_defconfig build is 5 days old...

etje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds