Hi Fenglin, Thank you for the patch! Yet something to improve: [auto build test ERROR on pavel-leds/for-next] [also build test ERROR on linus/master v6.2-rc6 next-20230202] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Fenglin-Wu/leds-flash-add-driver-to-support-flash-LED-module-in-QCOM-PMICs/20230202-143622 base: git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next patch link: https://lore.kernel.org/r/20230202062906.211565-2-quic_fenglinw%40quicinc.com patch subject: [PATCH v6 1/2] leds: flash: add driver to support flash LED module in QCOM PMICs config: sh-allmodconfig compiler: sh4-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8be378e85fb32bddc05ee23cc8f98d85ecdb270e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Fenglin-Wu/leds-flash-add-driver-to-support-flash-LED-module-in-QCOM-PMICs/20230202-143622 git checkout 8be378e85fb32bddc05ee23cc8f98d85ecdb270e # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/leds/flash/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from include/linux/kernel.h:26, from include/linux/cpumask.h:10, from include/linux/smp.h:13, from include/linux/lockdep.h:14, from include/linux/rcupdate.h:29, from include/linux/rculist.h:11, from include/linux/pid.h:5, from include/linux/sched.h:14, from include/linux/ratelimit.h:6, from include/linux/dev_printk.h:16, from include/linux/device.h:15, from include/linux/leds.h:12, from drivers/leds/flash/leds-qcom-flash.c:8: drivers/leds/flash/leds-qcom-flash.c: In function 'qcom_flash_v4l2_init': >> drivers/leds/flash/leds-qcom-flash.c:501:37: error: 's' undeclared (first use in this function); did you mean 's8'? 501 | intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); | ^ include/linux/minmax.h:20:28: note: in definition of macro '__typecheck' 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^ include/linux/minmax.h:36:31: note: in expansion of macro '__safe_cmp' 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ include/linux/minmax.h:126:33: note: in expansion of macro '__careful_cmp' 126 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/leds/flash/leds-qcom-flash.c:501:26: note: in expansion of macro 'min_t' 501 | intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); | ^~~~~ drivers/leds/flash/leds-qcom-flash.c:501:37: note: each undeclared identifier is reported only once for each function it appears in 501 | intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); | ^ include/linux/minmax.h:20:28: note: in definition of macro '__typecheck' 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^ include/linux/minmax.h:36:31: note: in expansion of macro '__safe_cmp' 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ include/linux/minmax.h:126:33: note: in expansion of macro '__careful_cmp' 126 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/leds/flash/leds-qcom-flash.c:501:26: note: in expansion of macro 'min_t' 501 | intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); | ^~~~~ >> include/linux/minmax.h:36:9: error: first argument to '__builtin_choose_expr' not a constant 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:126:33: note: in expansion of macro '__careful_cmp' 126 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/leds/flash/leds-qcom-flash.c:501:26: note: in expansion of macro 'min_t' 501 | intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); | ^~~~~ >> drivers/leds/flash/leds-qcom-flash.c:513:46: error: 'struct qcom_flash_led' has no member named 'chip' 513 | led->v4l2_flash = v4l2_flash_init(led->chip->dev, fwnode, &led->flash, | ^~ vim +501 drivers/leds/flash/leds-qcom-flash.c 490 491 static int qcom_flash_v4l2_init(struct qcom_flash_led *led, struct fwnode_handle *fwnode) 492 { 493 struct v4l2_flash_config v4l2_cfg = { 0 }; 494 struct led_flash_setting *intensity = &v4l2_cfg.intensity; 495 496 if (!(led->flash.led_cdev.flags & LED_DEV_CAP_FLASH)) 497 return 0; 498 499 intensity->min = intensity->step = TORCH_IRES_UA * led->chan_count; 500 intensity->max = led->max_torch_current_ma * UA_PER_MA; > 501 intensity->val = min_t(u32, s->max, TORCH_CURRENT_DEFAULT_UA); 502 503 strscpy(v4l2_cfg.dev_name, led->flash.led_cdev.dev->kobj.name, 504 sizeof(v4l2_cfg.dev_name)); 505 506 v4l2_cfg.has_external_strobe = true; 507 v4l2_cfg.flash_faults = LED_FAULT_INPUT_VOLTAGE | 508 LED_FAULT_OVER_CURRENT | 509 LED_FAULT_SHORT_CIRCUIT | 510 LED_FAULT_OVER_TEMPERATURE | 511 LED_FAULT_TIMEOUT; 512 > 513 led->v4l2_flash = v4l2_flash_init(led->chip->dev, fwnode, &led->flash, 514 &qcom_v4l2_flash_ops, &v4l2_cfg); 515 return PTR_ERR_OR_ZERO(led->v4l2_flash); 516 } 517 # else 518 static int qcom_flash_v4l2_init(struct qcom_flash_led *led, struct fwnode_handle *fwnode) 519 { 520 return 0; 521 } 522 #endif 523 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests