next-20251027: backlight.c:59:39: error: implicit declaration of function 'of_find_node_by_name'; did you mean 'bus_find_device_by_name'?

Thomas Zimmermann tzimmermann at suse.de
Tue Oct 28 01:08:10 AEDT 2025


Hi,

fix is at 
https://lore.kernel.org/dri-devel/20251027140646.227025-1-tzimmermann@suse.de/

Best regards
Thomas

Am 27.10.25 um 09:38 schrieb Naresh Kamboju:
> On Mon, 27 Oct 2025 at 13:43, Naresh Kamboju <naresh.kamboju at linaro.org> wrote:
>> The following powerpc ppc6xx_defconfig build regressions noticed on the
>> Linux next-20251027 tag with gcc-14 and gcc-8.
>>
>> * powerpc, build
>>    - gcc-14-ppc6xx_defconfig
>>    - gcc-8-ppc6xx_defconfig
>>
>> First seen on next-20251027
>> Good: next-20251024
>> Bad: next-20251027
>>
>> Regression Analysis:
>> - New regression? yes
>> - Reproducibility? yes
>>
>> Build regression: next-20251027: backlight.c:59:39: error: implicit
>> declaration of function 'of_find_node_by_name'; did you mean
>> 'bus_find_device_by_name'?
>> Build regression: next-20251027: include/linux/math.h:167:43: error:
>> first argument to '__builtin_choose_expr' not a constant
>> Build regression: next-20251027: via-pmu-backlight.c:22:20: error:
>> 'FB_BACKLIGHT_LEVELS' undeclared here (not in a function)
>> Build regression: next-20251027: minmax.h:71:17: error: first argument
>> to '__builtin_choose_expr' not a constant
>> Build regression: next-20251027: compiler.h:168:17: error:
>> '__UNIQUE_ID_x__286' undeclared (first use in this function); did you
>> mean '__UNIQUE_ID_y__287'?
> Anders bisected this down to,
> # first bad commit:
>     [243ce64b2b371cdf2cbc39c9422cb3047cab6de7]
>     backlight: Do not include <linux/fb.h> in header file
>
>> Reported-by: Linux Kernel Functional Testing <lkft at linaro.org>
>>
>> ## Build error
>> arch/powerpc/platforms/powermac/backlight.c: In function
>> 'pmac_has_backlight_type':
>> arch/powerpc/platforms/powermac/backlight.c:59:39: error: implicit
>> declaration of function 'of_find_node_by_name'; did you mean
>> 'bus_find_device_by_name'? [-Wimplicit-function-declaration]
>>     59 |         struct device_node* bk_node =
>> of_find_node_by_name(NULL, "backlight");
>>        |                                       ^~~~~~~~~~~~~~~~~~~~
>>        |                                       bus_find_device_by_name
>> arch/powerpc/platforms/powermac/backlight.c:59:39: error:
>> initialization of 'struct device_node *' from 'int' makes pointer from
>> integer without a cast [-Wint-conversion]
>> arch/powerpc/platforms/powermac/backlight.c:60:17: error: implicit
>> declaration of function 'of_property_match_string'
>> [-Wimplicit-function-declaration]
>>     60 |         int i = of_property_match_string(bk_node,
>> "backlight-control", type);
>>        |                 ^~~~~~~~~~~~~~~~~~~~~~~~
>> arch/powerpc/platforms/powermac/backlight.c:62:9: error: implicit
>> declaration of function 'of_node_put'
>> [-Wimplicit-function-declaration]
>>     62 |         of_node_put(bk_node);
>>        |         ^~~~~~~~~~~
>> drivers/macintosh/via-pmu-backlight.c:22:20: error:
>> 'FB_BACKLIGHT_LEVELS' undeclared here (not in a function)
>>     22 | static u8 bl_curve[FB_BACKLIGHT_LEVELS];
>>        |                    ^~~~~~~~~~~~~~~~~~~
>> In file included from <command-line>:
>> drivers/macintosh/via-pmu-backlight.c: In function 'pmu_backlight_curve_lookup':
>> include/linux/compiler.h:168:17: error: '__UNIQUE_ID_x__286'
>> undeclared (first use in this function); did you mean
>> '__UNIQUE_ID_y__287'?
>>    168 |         __PASTE(__UNIQUE_ID_,                                   \
>>        |                 ^~~~~~~~~~~~
>> drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
>>     45 |                 max = max((int)bl_curve[i], max);
>>        |                       ^~~
>> include/linux/minmax.h:71:17: error: first argument to
>> '__builtin_choose_expr' not a constant
>>     71 |         (typeof(__builtin_choose_expr(sizeof(ux) > 4, 1LL,
>> 1L)))(ux) >= 0)
>>        |                 ^~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler_types.h:577:23: note: in definition of macro
>> '__compiletime_assert'
>>    577 |                 if (!(condition))
>>           \
>>        |                       ^~~~~~~~~
>> drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
>>     45 |                 max = max((int)bl_curve[i], max);
>>        |                       ^~~
>> include/linux/minmax.h:71:17: error: first argument to
>> '__builtin_choose_expr' not a constant
>>     71 |         (typeof(__builtin_choose_expr(sizeof(ux) > 4, 1LL,
>> 1L)))(ux) >= 0)
>>        |                 ^~~~~~~~~~~~~~~~~~~~~
>> include/linux/compiler_types.h:577:23: note: in definition of macro
>> '__compiletime_assert'
>>    577 |                 if (!(condition))
>>           \
>>        |                       ^~~~~~~~~
>> include/linux/minmax.h:112:25: note: in expansion of macro '__careful_cmp'
>>    112 | #define max(x, y)       __careful_cmp(max, x, y)
>>        |                         ^~~~~~~~~~~~~
>> drivers/macintosh/via-pmu-backlight.c:45:23: note: in expansion of macro 'max'
>>     45 |                 max = max((int)bl_curve[i], max);
>>        |                       ^~~
>> In file included from include/linux/kernel.h:27,
>>                   from arch/powerpc/include/asm/page.h:11,
>>                   from arch/powerpc/include/asm/thread_info.h:13,
>>                   from include/linux/thread_info.h:60,
>>                   from arch/powerpc/include/asm/ptrace.h:342,
>>                   from drivers/macintosh/via-pmu-backlight.c:11:
>> include/linux/math.h:162:17: error: first argument to
>> '__builtin_choose_expr' not a constant
>>    162 |                 __builtin_choose_expr(
>>           \
>>        |                 ^~~~~~~~~~~~~~~~~~~~~
>>
>> drivers/macintosh/via-pmu-backlight.c: In function
>> 'pmu_backlight_get_level_brightness':
>> drivers/macintosh/via-pmu-backlight.c:63:38: error: 'FB_BACKLIGHT_MAX'
>> undeclared (first use in this function); did you mean 'BACKLIGHT_RAW'?
>>     63 |         pmulevel = bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
>>        |                                      ^~~~~~~~~~~~~~~~
>>        |                                      BACKLIGHT_RAW
>> drivers/macintosh/via-pmu-backlight.c:58:51: warning: parameter
>> 'level' set but not used [-Wunused-but-set-parameter]
>>     58 | static int pmu_backlight_get_level_brightness(int level)
>>        |                                               ~~~~^~~~~
>> drivers/macintosh/via-pmu-backlight.c: In function 'pmu_backlight_init':
>> drivers/macintosh/via-pmu-backlight.c:144:17: error: implicit
>> declaration of function 'of_machine_is_compatible'
>> [-Wimplicit-function-declaration]
>>    144 |                 of_machine_is_compatible("AAPL,3400/2400") ||
>>        |                 ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/macintosh/via-pmu-backlight.c: At top level:
>> drivers/macintosh/via-pmu-backlight.c:22:11: warning: 'bl_curve'
>> defined but not used [-Wunused-variable]
>>     22 | static u8 bl_curve[FB_BACKLIGHT_LEVELS];
>>        |           ^~~~~~~~
>> make[5]: *** [scripts/Makefile.build:287:
>> drivers/macintosh/via-pmu-backlight.o] Error 1
>> make[5]: Target 'drivers/macintosh/' not remade because of errors.
>>
>>
>> ## Source
>> * Kernel version: 6.18.0-rc2-next-20251027
>> * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
>> * Git describe: next-20251027
>> * Git commit: 8fec172c82c2b5f6f8e47ab837c1dc91ee3d1b87
>> * Architectures: powerpc
>> * Toolchains: gcc-14
>> * Kconfigs: defconfig
>>
>> ## Build
>> * Test log: https://storage.tuxsuite.com/public/linaro/lkft/builds/34dKrlb77LGOQQSoC8FHCiIEAZK/build.log
>> * Test details:
>> https://regressions.linaro.org/lkft/linux-next-master/next-20251027/build/gcc-14-ppc6xx_defconfig/
>> * Build plan: https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/builds/34dKrlb77LGOQQSoC8FHCiIEAZK
>> * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/34dKrlb77LGOQQSoC8FHCiIEAZK/
>> * Kernel config:
>> https://storage.tuxsuite.com/public/linaro/lkft/builds/34dKrlb77LGOQQSoC8FHCiIEAZK/config
>>
>> --
>> Linaro LKFT
> - Naresh

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)




More information about the Linuxppc-dev mailing list