linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: kbuild-all@lists.01.org, linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: [brgl:gpio/for-next 8/12] drivers/gpio/gpio-imx-scu.c:106:32-33: WARNING: Use ARRAY_SIZE
Date: Mon, 5 Sep 2022 06:37:02 +0800	[thread overview]
Message-ID: <202209050648.jIBKO9lr-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
head:   6ae8e1d0d5e5de922315830aea975c63e8c70b2f
commit: 0bd459ddf9e4f1af3ee3148eb319d1f8747f02ba [8/12] gpio: imx-scu: add imx-scu GPIO driver
config: openrisc-randconfig-c042-20220904 (https://download.01.org/0day-ci/archive/20220905/202209050648.jIBKO9lr-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

cocci warnings: (new ones prefixed by >>)
>> drivers/gpio/gpio-imx-scu.c:106:32-33: WARNING: Use ARRAY_SIZE

vim +106 drivers/gpio/gpio-imx-scu.c

    84	
    85	static int imx_scu_gpio_probe(struct platform_device *pdev)
    86	{
    87		struct device *dev = &pdev->dev;
    88		struct scu_gpio_priv *priv;
    89		struct gpio_chip *gc;
    90		int ret;
    91	
    92		priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
    93		if (!priv)
    94			return -ENOMEM;
    95	
    96		ret = imx_scu_get_handle(&priv->handle);
    97		if (ret)
    98			return ret;
    99	
   100		priv->dev = dev;
   101		mutex_init(&priv->lock);
   102	
   103		gc = &priv->chip;
   104		gc->base = -1;
   105		gc->parent = dev;
 > 106		gc->ngpio = sizeof(scu_rsrc_arr)/sizeof(unsigned int);
   107		gc->label = dev_name(dev);
   108		gc->get = imx_scu_gpio_get;
   109		gc->set = imx_scu_gpio_set;
   110		gc->get_direction = imx_scu_gpio_get_direction;
   111	
   112		platform_set_drvdata(pdev, priv);
   113	
   114		return devm_gpiochip_add_data(dev, gc, priv);
   115	}
   116	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-09-04 22: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=202209050648.jIBKO9lr-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brgl@bgdev.pl \
    --cc=kbuild-all@lists.01.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shenwei.wang@nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).