Skip to contentSkip to conversation

linux-next: build failure after merge of the header_cleanup tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Dec 18, 2023 – Dec 19, 2023

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

Hi all,

After merging the header_cleanup tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from include/linux/kernel.h:27,

                 from drivers/gpu/ipu-v3/ipu-dp.c:7:

include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/time.h:6,

                 from include/linux/videodev2.h:59,
                 from include/video/imx-ipu-v3.h:16,
                 from drivers/gpu/ipu-v3/ipu-dp.c:14:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors
In file included from include/linux/kernel.h:27,
from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:7:
include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/jiffies.h:7,

                 from include/linux/ktime.h:25,
                 from include/linux/timer.h:6,
                 from include/linux/workqueue.h:9,
                 from include/linux/mm_types.h:19,
                 from include/linux/mmzone.h:22,
                 from include/linux/gfp.h:7,
                 from include/linux/stackdepot.h:25,
                 from include/drm/drm_modeset_lock.h:28,
                 from include/drm/drm_crtc.h:30,
                 from drivers/gpu/drm/omapdrm/dss/omapdss.h:11,
                 from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:9:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors

I have dropped the header_cleanup tree for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 53 lines · On Mon, 18 Dec 2023 17:40:30 +1100 Stephen Rothwell <[email protected]>…

After merging the header_cleanup tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from include/linux/kernel.h:27,

                 from drivers/gpu/ipu-v3/ipu-dp.c:7:

include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/time.h:6,

                 from include/linux/videodev2.h:59,
                 from include/video/imx-ipu-v3.h:16,
                 from drivers/gpu/ipu-v3/ipu-dp.c:14:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors
In file included from include/linux/kernel.h:27,
from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:7:
include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/jiffies.h:7,

                 from include/linux/ktime.h:25,
                 from include/linux/timer.h:6,
                 from include/linux/workqueue.h:9,
                 from include/linux/mm_types.h:19,
                 from include/linux/mmzone.h:22,
                 from include/linux/gfp.h:7,
                 from include/linux/stackdepot.h:25,
                 from include/drm/drm_modeset_lock.h:28,
                 from include/drm/drm_crtc.h:30,
                 from drivers/gpu/drm/omapdrm/dss/omapdss.h:11,
                 from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:9:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~
Quoted 7 lines

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors

This turns out to be a semantic conflict (or exposing a bug in commit

c6fbb6bca108 ("drm: Fix color LUT rounding")

from the drm tree.

I have applied the following merge fix up patch (which should probably be applied to the drm tree, if possible).

From: Stephen Rothwell <[email protected]>
Date: Tue, 19 Dec 2023 14:43:41 +1100
Subject: [PATCH] drm: using mul_u32_u32() requires linux/math64.h

Some pending include file cleanups produced this error:

In file included from include/linux/kernel.h:27,

                 from drivers/gpu/ipu-v3/ipu-dp.c:7:

include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~

---
 include/drm/drm_color_mgmt.h | 1 +
 1 file changed, 1 insertion(+)
include/drm/drm_color_mgmt.h +1 -0
index 54b2b2467bfd..ed81741036d7 100644
@@ -24,6 +24,7 @@
 #define __DRM_COLOR_MGMT_H__
 
 #include <linux/ctype.h>
+#include <linux/math64.h>
 #include <drm/drm_property.h>
 
 struct drm_crtc;
Signature · 5 lines
2.40.1

-- 
Cheers,
Stephen Rothwell
#2 lore raw
Quoted 79 lines · Stephen Rothwell

Hi all,

Quoted 53 lines · On Mon, 18 Dec 2023 17:40:30 +1100 Stephen Rothwell <[email protected]>…

After merging the header_cleanup tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from include/linux/kernel.h:27,

                 from drivers/gpu/ipu-v3/ipu-dp.c:7:

include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/time.h:6,

                 from include/linux/videodev2.h:59,
                 from include/video/imx-ipu-v3.h:16,
                 from drivers/gpu/ipu-v3/ipu-dp.c:14:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors
In file included from include/linux/kernel.h:27,
from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:7:
include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
In file included from include/linux/jiffies.h:7,

                 from include/linux/ktime.h:25,
                 from include/linux/timer.h:6,
                 from include/linux/workqueue.h:9,
                 from include/linux/mm_types.h:19,
                 from include/linux/mmzone.h:22,
                 from include/linux/gfp.h:7,
                 from include/linux/stackdepot.h:25,
                 from include/drm/drm_modeset_lock.h:28,
                 from include/drm/drm_crtc.h:30,
                 from drivers/gpu/drm/omapdrm/dss/omapdss.h:11,
                 from drivers/gpu/drm/omapdrm/dss/dispc_coefs.c:9:
include/linux/math64.h: At top level:
include/linux/math64.h:155:19: error: conflicting types for 'mul_u32_u32'; have 'u64(u32,  u32)' {aka 'long long unsigned int(unsigned int,  unsigned int)'}
  155 | static inline u64 mul_u32_u32(u32 a, u32 b)
      |                   ^~~~~~~~~~~
Quoted 7 lines

include/drm/drm_color_mgmt.h:45:46: note: previous implicit declaration of 'mul_u32_u32' with type 'int()'
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~
include/linux/math.h:104:36: note: in definition of macro 'DIV_ROUND_CLOSEST_ULL'
104 | unsigned long long _tmp = (x) + (__d) / 2; \
| ^
cc1: some warnings being treated as errors

This turns out to be a semantic conflict (or exposing a bug in commit

c6fbb6bca108 ("drm: Fix color LUT rounding")

from the drm tree.

I have applied the following merge fix up patch (which should probably be applied to the drm tree, if possible).

From: Stephen Rothwell <[email protected]>
Date: Tue, 19 Dec 2023 14:43:41 +1100
Subject: [PATCH] drm: using mul_u32_u32() requires linux/math64.h

Some pending include file cleanups produced this error:

Quoted 8 lines

In file included from include/linux/kernel.h:27,

                 from drivers/gpu/ipu-v3/ipu-dp.c:7:

include/drm/drm_color_mgmt.h: In function 'drm_color_lut_extract':
include/drm/drm_color_mgmt.h:45:46: error: implicit declaration of function 'mul_u32_u32' [-Werror=implicit-function-declaration]
45 | return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(user_input, (1 << bit_precision) - 1),
| ^~~~~~~~~~~

Mea culpa.

I slapped on a

Fixes c6fbb6bca108 ("drm: Fix color LUT rounding")

and applied this to drm-misc-next-fixes. Thanks.

Quoted 22 lines
---
 include/drm/drm_color_mgmt.h | 1 +
 1 file changed, 1 insertion(+)
include/drm/drm_color_mgmt.h +1 -0
index 54b2b2467bfd..ed81741036d7 100644
@@ -24,6 +24,7 @@
 #define __DRM_COLOR_MGMT_H__
 
 #include <linux/ctype.h>
+#include <linux/math64.h>
 #include <drm/drm_property.h>
 
 struct drm_crtc;
Signature · 5 lines
2.40.1

-- 
Cheers,
Stephen Rothwell
Signature · 2 lines
Ville Syrjälä
Intel