Re: [PATCH v5 2/2] leds: mt6360: Add LED driver for MT6360

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gene,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pavel-linux-leds/for-next]
[also build test WARNING on v5.9-rc8 next-20201006]
[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]

url:    https://github.com/0day-ci/linux/commits/Gene-Chen/leds-mt6360-Add-LED-driver-for-MT6360/20201007-094408
base:   git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git for-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/cdafaffefe3568d483b764206c6cea243203b370
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Gene-Chen/leds-mt6360-Add-LED-driver-for-MT6360/20201007-094408
        git checkout cdafaffefe3568d483b764206c6cea243203b370
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/leds.h:12,
                    from include/linux/led-class-flash.h:11,
                    from drivers/leds/leds-mt6360.c:7:
   drivers/leds/leds-mt6360.c: In function 'mt6360_led_probe':
>> drivers/leds/leds-mt6360.c:696:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]
     696 |   dev_err(&pdev->dev, "No child node or node count over max led number %d\n", count);
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/leds/leds-mt6360.c:696:3: note: in expansion of macro 'dev_err'
     696 |   dev_err(&pdev->dev, "No child node or node count over max led number %d\n", count);
         |   ^~~~~~~
   drivers/leds/leds-mt6360.c:696:73: note: format string is defined here
     696 |   dev_err(&pdev->dev, "No child node or node count over max led number %d\n", count);
         |                                                                        ~^
         |                                                                         |
         |                                                                         int
         |                                                                        %ld

vim +696 drivers/leds/leds-mt6360.c

   686	
   687	static int mt6360_led_probe(struct platform_device *pdev)
   688	{
   689		struct mt6360_priv *priv;
   690		struct fwnode_handle *child;
   691		size_t count;
   692		int i = 0, ret;
   693	
   694		count = device_get_child_node_count(&pdev->dev);
   695		if (!count || count > MT6360_MAX_LEDS) {
 > 696			dev_err(&pdev->dev, "No child node or node count over max led number %d\n", count);
   697			return -EINVAL;
   698		}
   699	
   700		priv = devm_kzalloc(&pdev->dev, struct_size(priv, leds, count), GFP_KERNEL);
   701		if (!priv)
   702			return -ENOMEM;
   703	
   704		priv->leds_count = count;
   705		priv->dev = &pdev->dev;
   706		mutex_init(&priv->lock);
   707	
   708		priv->regmap = dev_get_regmap(pdev->dev.parent, NULL);
   709		if (!priv->regmap) {
   710			dev_err(&pdev->dev, "Failed to get parent regmap\n");
   711			return -ENODEV;
   712		}
   713	
   714		device_for_each_child_node(&pdev->dev, child) {
   715			struct mt6360_led *led = priv->leds + i;
   716			struct led_init_data init_data = { .fwnode = child, };
   717			u32 reg;
   718	
   719			ret = fwnode_property_read_u32(child, "reg", &reg);
   720			if (ret)
   721				goto out_flash_release;
   722	
   723			if (reg >= MT6360_MAX_LEDS || priv->leds_active & BIT(reg))
   724				return -EINVAL;
   725			priv->leds_active |= BIT(reg);
   726	
   727			led->led_no = reg;
   728			led->priv = priv;
   729	
   730			ret = mt6360_init_common_properties(led, &init_data);
   731			if (ret)
   732				goto out_flash_release;
   733	
   734			if (reg == MT6360_LED_ISNKRGB || reg == MT6360_LED_ISNKML)
   735				ret = mt6360_init_isnk_properties(led, &init_data);
   736			else
   737				ret = mt6360_init_flash_properties(led, &init_data);
   738	
   739			if (ret)
   740				goto out_flash_release;
   741	
   742			ret = mt6360_led_register(&pdev->dev, led, &init_data);
   743			if (ret)
   744				goto out_flash_release;
   745	
   746			i++;
   747		}
   748	
   749		platform_set_drvdata(pdev, priv);
   750		return 0;
   751	
   752	out_flash_release:
   753		mt6360_v4l2_flash_release(priv);
   754		return ret;
   755	}
   756	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux