lkml.org 
[lkml]   [2023]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 06/21] pinctrl: equilibrium: Convert to use struct pingroup
On Fri, Nov 24, 2023 at 09:19:45PM +0800, kernel test robot wrote:

...

> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202311241401.ZPILPdov-lkp@intel.com/
>
> smatch warnings:
> drivers/pinctrl/pinctrl-equilibrium.c:719 eqbr_build_groups() warn: unsigned 'grp->npins' is never less than zero.

Thank you for the report!

...

> 718 grp->npins = of_property_count_u32_elems(np, "pins");
> > 719 if (grp->npins < 0) {
> 720 dev_err(dev, "No pins in the group: %s\n", prop->name);
> 721 of_node_put(np);
> 722 return -EINVAL;
> 723 }

Surprisingly (to me) the _count_u32_elems() can return a negative error code...
Fine, I redo a bit the code by introducing a new patch that will use err instead
of ->npins (which sounds better approach anyway).

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-11-24 15:39    [W:0.727 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site