[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALkUMdSzeH-7=jXsGV1+ubzfqHVOC3z0RbN9BG08HTKwFoAWeg@mail.gmail.com>
Date: Thu, 17 Oct 2024 16:38:58 +0530
From: Vimal Agrawal <avimalin@...il.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: oe-kbuild@...ts.linux.dev, linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org, arnd@...db.de, lkp@...el.com,
oe-kbuild-all@...ts.linux.dev, vimal.agrawal@...hos.com
Subject: Re: [PATCH] misc: misc_minor_alloc to allocate ids for all
dynamic/misc dynamic minors
Hi Dan,
Both warning and missed case for return from this function for static
minor are already fixed in the v2 version of the patch. I will be
sending out the v3 version shortly ( after splitting it from kunit
changes).
Thanks for pointing this out.
Vimal
On Wed, Oct 16, 2024 at 7:52 PM Dan Carpenter <dan.carpenter@...aro.org> wrote:
>
> Hi Vimal,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Vimal-Agrawal/misc-misc_minor_alloc-to-allocate-ids-for-all-dynamic-misc-dynamic-minors/20241014-211915
> base: char-misc/char-misc-testing
> patch link: https://lore.kernel.org/r/20241014131416.27324-1-vimal.agrawal%40sophos.com
> patch subject: [PATCH] misc: misc_minor_alloc to allocate ids for all dynamic/misc dynamic minors
> config: sparc64-randconfig-r072-20241015 (https://download.01.org/0day-ci/archive/20241016/202410161811.aIPEJHOt-lkp@intel.com/config)
> compiler: sparc64-linux-gcc (GCC) 14.1.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@...el.com>
> | Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> | Closes: https://lore.kernel.org/r/202410161811.aIPEJHOt-lkp@intel.com/
>
> smatch warnings:
> drivers/char/misc.c:89 misc_minor_alloc() error: uninitialized symbol 'ret'.
>
> vim +/ret +89 drivers/char/misc.c
>
> d52c84545e305b Vimal Agrawal 2024-10-14 66 static int misc_minor_alloc(int minor)
> ab760791c0cfbb D Scott Phillips 2022-11-14 67 {
> ab760791c0cfbb D Scott Phillips 2022-11-14 68 int ret;
> ab760791c0cfbb D Scott Phillips 2022-11-14 69
> d52c84545e305b Vimal Agrawal 2024-10-14 70 if (minor == MISC_DYNAMIC_MINOR) {
> d52c84545e305b Vimal Agrawal 2024-10-14 71 /* allocate free id */
> ab760791c0cfbb D Scott Phillips 2022-11-14 72 ret = ida_alloc_max(&misc_minors_ida, DYNAMIC_MINORS - 1, GFP_KERNEL);
> ab760791c0cfbb D Scott Phillips 2022-11-14 73 if (ret >= 0) {
> ab760791c0cfbb D Scott Phillips 2022-11-14 74 ret = DYNAMIC_MINORS - ret - 1;
> ab760791c0cfbb D Scott Phillips 2022-11-14 75 } else {
> ab760791c0cfbb D Scott Phillips 2022-11-14 76 ret = ida_alloc_range(&misc_minors_ida, MISC_DYNAMIC_MINOR + 1,
> ab760791c0cfbb D Scott Phillips 2022-11-14 77 MINORMASK, GFP_KERNEL);
> ab760791c0cfbb D Scott Phillips 2022-11-14 78 }
> d52c84545e305b Vimal Agrawal 2024-10-14 79 } else {
> d52c84545e305b Vimal Agrawal 2024-10-14 80 /* specific minor, check if it is in dynamic or misc dynamic range */
> d52c84545e305b Vimal Agrawal 2024-10-14 81 if (minor < DYNAMIC_MINORS) {
> d52c84545e305b Vimal Agrawal 2024-10-14 82 minor = DYNAMIC_MINORS - minor - 1;
> d52c84545e305b Vimal Agrawal 2024-10-14 83 ret = ida_alloc_range(&misc_minors_ida, minor, minor, GFP_KERNEL);
> d52c84545e305b Vimal Agrawal 2024-10-14 84 }
> d52c84545e305b Vimal Agrawal 2024-10-14 85
> d52c84545e305b Vimal Agrawal 2024-10-14 86 if (minor > MISC_DYNAMIC_MINOR)
> d52c84545e305b Vimal Agrawal 2024-10-14 87 ret = ida_alloc_range(&misc_minors_ida, minor, minor, GFP_KERNEL);
>
> What about if minor is >= DYNAMIC_MINORS (128) but <= MISC_DYNAMIC_MINOR (255)?
>
> d52c84545e305b Vimal Agrawal 2024-10-14 88 }
> ab760791c0cfbb D Scott Phillips 2022-11-14 @89 return ret;
> ab760791c0cfbb D Scott Phillips 2022-11-14 90 }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
Powered by blists - more mailing lists