From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [conor:pinctrl 21/25] drivers/pinctrl/pinctrl-mpfs-mssio.c:353:6-14: WARNING: Unsigned expression compared with zero: function < 0
Date: Sun, 30 Nov 2025 00:36:54 +0800 [thread overview]
Message-ID: <202511300058.NCOUIU43-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Conor Dooley <conor+lkp@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git pinctrl
head: 88f8a28f2ada6391ae9be73b9973f921aca27a3b
commit: d1b023c3a5107668f367b2bfec08d721e2b2e7dd [21/25] pinctrl: add polarfire soc mssio pinctrl driver
:::::: branch date: 27 hours ago
:::::: commit date: 2 days ago
config: arm-randconfig-r062-20251129 (https://download.01.org/0day-ci/archive/20251130/202511300058.NCOUIU43-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.5.0
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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202511300058.NCOUIU43-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/pinctrl/pinctrl-mpfs-mssio.c:353:6-14: WARNING: Unsigned expression compared with zero: function < 0
vim +353 drivers/pinctrl/pinctrl-mpfs-mssio.c
d1b023c3a51076 Conor Dooley 2025-09-24 327
d1b023c3a51076 Conor Dooley 2025-09-24 328 static int mpfs_pinctrl_set_mux(struct pinctrl_dev *pctrl_dev, unsigned int fsel,
d1b023c3a51076 Conor Dooley 2025-09-24 329 unsigned int gsel)
d1b023c3a51076 Conor Dooley 2025-09-24 330 {
d1b023c3a51076 Conor Dooley 2025-09-24 331 struct mpfs_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev);
d1b023c3a51076 Conor Dooley 2025-09-24 332 const struct group_desc *group;
d1b023c3a51076 Conor Dooley 2025-09-24 333 const char **functions;
d1b023c3a51076 Conor Dooley 2025-09-24 334
d1b023c3a51076 Conor Dooley 2025-09-24 335 group = pinctrl_generic_get_group(pctrl_dev, gsel);
d1b023c3a51076 Conor Dooley 2025-09-24 336 if (!group)
d1b023c3a51076 Conor Dooley 2025-09-24 337 return -EINVAL;
d1b023c3a51076 Conor Dooley 2025-09-24 338
d1b023c3a51076 Conor Dooley 2025-09-24 339 functions = group->data;
d1b023c3a51076 Conor Dooley 2025-09-24 340
d1b023c3a51076 Conor Dooley 2025-09-24 341 for (int i = 0; i < group->grp.npins; i++) {
d1b023c3a51076 Conor Dooley 2025-09-24 342 u32 function;
d1b023c3a51076 Conor Dooley 2025-09-24 343
d1b023c3a51076 Conor Dooley 2025-09-24 344 //TODO @Linus my new function being actually generic means that
d1b023c3a51076 Conor Dooley 2025-09-24 345 // the mapping of function string to something the hardware
d1b023c3a51076 Conor Dooley 2025-09-24 346 // understands only happens at this point.
d1b023c3a51076 Conor Dooley 2025-09-24 347 // I think this is fine, because dt validation would whinge
d1b023c3a51076 Conor Dooley 2025-09-24 348 // about something invalid, but it's the "catch" with my approach.
d1b023c3a51076 Conor Dooley 2025-09-24 349 // The other option I considered was to provide a mapping
d1b023c3a51076 Conor Dooley 2025-09-24 350 // function pointer that the driver can populate, but I think
d1b023c3a51076 Conor Dooley 2025-09-24 351 // that's overkill.
d1b023c3a51076 Conor Dooley 2025-09-24 352 function = mpfs_pinctrl_function_map(functions[i]);
d1b023c3a51076 Conor Dooley 2025-09-24 @353 if (function < 0) {
d1b023c3a51076 Conor Dooley 2025-09-24 354 dev_err(pctrl->dev, "invalid function %s\n", functions[i]);
d1b023c3a51076 Conor Dooley 2025-09-24 355 return function;
d1b023c3a51076 Conor Dooley 2025-09-24 356 }
d1b023c3a51076 Conor Dooley 2025-09-24 357
d1b023c3a51076 Conor Dooley 2025-09-24 358 mpfs_pinctrl_set_pin_func(pctrl, group->grp.pins[i], function);
d1b023c3a51076 Conor Dooley 2025-09-24 359 }
d1b023c3a51076 Conor Dooley 2025-09-24 360
d1b023c3a51076 Conor Dooley 2025-09-24 361 return 0;
d1b023c3a51076 Conor Dooley 2025-09-24 362 }
d1b023c3a51076 Conor Dooley 2025-09-24 363
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-11-29 16:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202511300058.NCOUIU43-lkp@intel.com \
--to=lkp@intel.com \
--cc=julia.lawall@inria.fr \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.