All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Dong Aisheng <aisheng.dong@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>, Jacky Bai <ping.bai@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sean Wang <sean.wang@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>
Subject: Re: [PATCH v1 01/11] pinctrl: berlin: Make use of struct pinfunction
Date: Tue, 28 May 2024 08:30:49 +0800	[thread overview]
Message-ID: <202405280810.6djYxvIm-lkp@intel.com> (raw)
In-Reply-To: <20240527212742.1432960-2-andy.shevchenko@gmail.com>

Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v6.10-rc1 next-20240523]
[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/Andy-Shevchenko/pinctrl-berlin-Make-use-of-struct-pinfunction/20240528-053304
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20240527212742.1432960-2-andy.shevchenko%40gmail.com
patch subject: [PATCH v1 01/11] pinctrl: berlin: Make use of struct pinfunction
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240528/202405280810.6djYxvIm-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project bafda89a0944d947fc4b3b5663185e07a397ac30)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240528/202405280810.6djYxvIm-lkp@intel.com/reproduce)

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/202405280810.6djYxvIm-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> drivers/pinctrl/berlin/berlin.c:261:45: error: passing 'const char *const *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     261 |                         groups = devm_krealloc_array(&pdev->dev, function->groups,
         |                                                                  ^~~~~~~~~~~~~~~~
   include/linux/device.h:346:47: note: passing argument to parameter 'p' here
     346 | devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags)
         |                                               ^
   6 warnings and 1 error generated.


vim +261 drivers/pinctrl/berlin/berlin.c

   200	
   201	static int berlin_pinctrl_build_state(struct platform_device *pdev)
   202	{
   203		struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev);
   204		const struct berlin_desc_group *desc_group;
   205		const struct berlin_desc_function *desc_function;
   206		int i, max_functions = 0;
   207	
   208		pctrl->nfunctions = 0;
   209	
   210		for (i = 0; i < pctrl->desc->ngroups; i++) {
   211			desc_group = pctrl->desc->groups + i;
   212			/* compute the maximum number of functions a group can have */
   213			max_functions += 1 << (desc_group->bit_width + 1);
   214		}
   215	
   216		/* we will reallocate later */
   217		pctrl->functions = kcalloc(max_functions, sizeof(*pctrl->functions), GFP_KERNEL);
   218		if (!pctrl->functions)
   219			return -ENOMEM;
   220	
   221		/* register all functions */
   222		for (i = 0; i < pctrl->desc->ngroups; i++) {
   223			desc_group = pctrl->desc->groups + i;
   224			desc_function = desc_group->functions;
   225	
   226			while (desc_function->name) {
   227				berlin_pinctrl_add_function(pctrl, desc_function->name);
   228				desc_function++;
   229			}
   230		}
   231	
   232		pctrl->functions = krealloc(pctrl->functions,
   233					    pctrl->nfunctions * sizeof(*pctrl->functions),
   234					    GFP_KERNEL);
   235		if (!pctrl->functions)
   236			return -ENOMEM;
   237	
   238		/* map functions to theirs groups */
   239		for (i = 0; i < pctrl->desc->ngroups; i++) {
   240			desc_group = pctrl->desc->groups + i;
   241			desc_function = desc_group->functions;
   242	
   243			while (desc_function->name) {
   244				struct pinfunction *function = pctrl->functions;
   245				const char **groups;
   246				bool found = false;
   247	
   248				while (function->name) {
   249					if (!strcmp(desc_function->name, function->name)) {
   250						found = true;
   251						break;
   252					}
   253					function++;
   254				}
   255	
   256				if (!found) {
   257					kfree(pctrl->functions);
   258					return -EINVAL;
   259				}
   260	
 > 261				groups = devm_krealloc_array(&pdev->dev, function->groups,
   262							     function->ngroups,
   263							     sizeof(*function->groups),
   264							     GFP_KERNEL);
   265				if (!groups) {
   266					kfree(pctrl->functions);
   267					return -ENOMEM;
   268				}
   269				function->groups = groups;
   270				while (*groups)
   271					groups++;
   272	
   273				*groups = desc_group->name;
   274	
   275				desc_function++;
   276			}
   277		}
   278	
   279		return 0;
   280	}
   281	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Dong Aisheng <aisheng.dong@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>, Jacky Bai <ping.bai@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sean Wang <sean.wang@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>
Subject: Re: [PATCH v1 01/11] pinctrl: berlin: Make use of struct pinfunction
Date: Tue, 28 May 2024 08:30:49 +0800	[thread overview]
Message-ID: <202405280810.6djYxvIm-lkp@intel.com> (raw)
In-Reply-To: <20240527212742.1432960-2-andy.shevchenko@gmail.com>

Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v6.10-rc1 next-20240523]
[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/Andy-Shevchenko/pinctrl-berlin-Make-use-of-struct-pinfunction/20240528-053304
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20240527212742.1432960-2-andy.shevchenko%40gmail.com
patch subject: [PATCH v1 01/11] pinctrl: berlin: Make use of struct pinfunction
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240528/202405280810.6djYxvIm-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project bafda89a0944d947fc4b3b5663185e07a397ac30)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240528/202405280810.6djYxvIm-lkp@intel.com/reproduce)

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/202405280810.6djYxvIm-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/pinctrl/berlin/berlin.c:10:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> drivers/pinctrl/berlin/berlin.c:261:45: error: passing 'const char *const *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     261 |                         groups = devm_krealloc_array(&pdev->dev, function->groups,
         |                                                                  ^~~~~~~~~~~~~~~~
   include/linux/device.h:346:47: note: passing argument to parameter 'p' here
     346 | devm_krealloc_array(struct device *dev, void *p, size_t new_n, size_t new_size, gfp_t flags)
         |                                               ^
   6 warnings and 1 error generated.


vim +261 drivers/pinctrl/berlin/berlin.c

   200	
   201	static int berlin_pinctrl_build_state(struct platform_device *pdev)
   202	{
   203		struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev);
   204		const struct berlin_desc_group *desc_group;
   205		const struct berlin_desc_function *desc_function;
   206		int i, max_functions = 0;
   207	
   208		pctrl->nfunctions = 0;
   209	
   210		for (i = 0; i < pctrl->desc->ngroups; i++) {
   211			desc_group = pctrl->desc->groups + i;
   212			/* compute the maximum number of functions a group can have */
   213			max_functions += 1 << (desc_group->bit_width + 1);
   214		}
   215	
   216		/* we will reallocate later */
   217		pctrl->functions = kcalloc(max_functions, sizeof(*pctrl->functions), GFP_KERNEL);
   218		if (!pctrl->functions)
   219			return -ENOMEM;
   220	
   221		/* register all functions */
   222		for (i = 0; i < pctrl->desc->ngroups; i++) {
   223			desc_group = pctrl->desc->groups + i;
   224			desc_function = desc_group->functions;
   225	
   226			while (desc_function->name) {
   227				berlin_pinctrl_add_function(pctrl, desc_function->name);
   228				desc_function++;
   229			}
   230		}
   231	
   232		pctrl->functions = krealloc(pctrl->functions,
   233					    pctrl->nfunctions * sizeof(*pctrl->functions),
   234					    GFP_KERNEL);
   235		if (!pctrl->functions)
   236			return -ENOMEM;
   237	
   238		/* map functions to theirs groups */
   239		for (i = 0; i < pctrl->desc->ngroups; i++) {
   240			desc_group = pctrl->desc->groups + i;
   241			desc_function = desc_group->functions;
   242	
   243			while (desc_function->name) {
   244				struct pinfunction *function = pctrl->functions;
   245				const char **groups;
   246				bool found = false;
   247	
   248				while (function->name) {
   249					if (!strcmp(desc_function->name, function->name)) {
   250						found = true;
   251						break;
   252					}
   253					function++;
   254				}
   255	
   256				if (!found) {
   257					kfree(pctrl->functions);
   258					return -EINVAL;
   259				}
   260	
 > 261				groups = devm_krealloc_array(&pdev->dev, function->groups,
   262							     function->ngroups,
   263							     sizeof(*function->groups),
   264							     GFP_KERNEL);
   265				if (!groups) {
   266					kfree(pctrl->functions);
   267					return -ENOMEM;
   268				}
   269				function->groups = groups;
   270				while (*groups)
   271					groups++;
   272	
   273				*groups = desc_group->name;
   274	
   275				desc_function++;
   276			}
   277		}
   278	
   279		return 0;
   280	}
   281	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-05-28  0:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 21:24 [PATCH v1 00/11] pinctrl: pinmux: Embed and reuse struct pinfunction Andy Shevchenko
2024-05-27 21:24 ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 01/11] pinctrl: berlin: Make use of " Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-28  0:30   ` kernel test robot [this message]
2024-05-28  0:30     ` kernel test robot
2024-05-27 21:24 ` [PATCH v1 02/11] pinctrl: equilibrium: " Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 03/11] pinctrl: ingenic: Provide a helper macro INGENIC_PIN_FUNCTION() Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 04/11] pinctrl: mediatek: Provide a helper macro PINCTRL_PIN_FUNCTION() Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 05/11] pinctrl: pinmux: Add a convenient define PINCTRL_FUNCTION_DESC() Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-28  0:19   ` kernel test robot
2024-05-28  0:19     ` kernel test robot
2024-05-28  0:30   ` kernel test robot
2024-05-28  0:30     ` kernel test robot
2024-05-27 21:24 ` [PATCH v1 06/11] pinctrl: pinmux: Embed struct pinfunction into struct function_desc Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 07/11] pinctrl: imx: Convert to use func member Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 08/11] pinctrl: ingenic: " Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 09/11] pinctrl: keembay: " Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 10/11] pinctrl: mediatek: " Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko
2024-05-27 21:24 ` [PATCH v1 11/11] pinctrl: pinmux: Remove unused members from struct function_desc Andy Shevchenko
2024-05-27 21:24   ` Andy Shevchenko

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=202405280810.6djYxvIm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aisheng.dong@nxp.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=lakshmi.sowjanya.d@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=matthias.bgg@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paul@crapouillou.net \
    --cc=ping.bai@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sean.wang@kernel.org \
    --cc=shawnguo@kernel.org \
    /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.