From: kbuild test robot <lkp@intel.com>
To: Kent Gibson <warthog618@gmail.com>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
bgolaszewski@baylibre.com, linus.walleij@linaro.org
Cc: kbuild-all@lists.01.org, Kent Gibson <warthog618@gmail.com>
Subject: Re: [PATCH] gpiolib: split character device into gpiolib-cdev
Date: Tue, 2 Jun 2020 02:33:41 +0800 [thread overview]
Message-ID: <202006020221.C4AD44rR%lkp@intel.com> (raw)
In-Reply-To: <20200527154005.6827-1-warthog618@gmail.com>
Hi Kent,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.7-rc5]
[cannot apply to gpio/for-next linus/master linux/master v5.7-rc7 v5.7-rc6 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Kent-Gibson/gpiolib-split-character-device-into-gpiolib-cdev/20200528-000035
base: 2ef96a5bb12be62ef75b5828c0aab838ebb29cb8
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/gpio/gpiolib-cdev.c:1035:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = atomic_notifier_chain_register(&gdev->notifier,
^
drivers/gpio/gpiolib-cdev.c:1016:0: note: Variable 'ret' is reassigned a value before the old one has been used.
int ret = -ENOMEM;
^
drivers/gpio/gpiolib-cdev.c:1035:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = atomic_notifier_chain_register(&gdev->notifier,
^
vim +/ret +1035 drivers/gpio/gpiolib-cdev.c
1004
1005 /**
1006 * gpio_chrdev_open() - open the chardev for ioctl operations
1007 * @inode: inode for this chardev
1008 * @filp: file struct for storing private data
1009 * Returns 0 on success
1010 */
1011 static int gpio_chrdev_open(struct inode *inode, struct file *filp)
1012 {
1013 struct gpio_device *gdev = container_of(inode->i_cdev,
1014 struct gpio_device, chrdev);
1015 struct gpio_chardev_data *priv;
1016 int ret = -ENOMEM;
1017
1018 /* Fail on open if the backing gpiochip is gone */
1019 if (!gdev->chip)
1020 return -ENODEV;
1021
1022 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
1023 if (!priv)
1024 return -ENOMEM;
1025
1026 priv->watched_lines = bitmap_zalloc(gdev->chip->ngpio, GFP_KERNEL);
1027 if (!priv->watched_lines)
1028 goto out_free_priv;
1029
1030 init_waitqueue_head(&priv->wait);
1031 INIT_KFIFO(priv->events);
1032 priv->gdev = gdev;
1033
1034 priv->lineinfo_changed_nb.notifier_call = lineinfo_changed_notify;
> 1035 ret = atomic_notifier_chain_register(&gdev->notifier,
1036 &priv->lineinfo_changed_nb);
1037 if (ret)
1038 goto out_free_bitmap;
1039
1040 get_device(&gdev->dev);
1041 filp->private_data = priv;
1042
1043 ret = nonseekable_open(inode, filp);
1044 if (ret)
1045 goto out_unregister_notifier;
1046
1047 return ret;
1048
1049 out_unregister_notifier:
1050 atomic_notifier_chain_unregister(&gdev->notifier,
1051 &priv->lineinfo_changed_nb);
1052 out_free_bitmap:
1053 bitmap_free(priv->watched_lines);
1054 out_free_priv:
1055 kfree(priv);
1056 return ret;
1057 }
1058
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
prev parent reply other threads:[~2020-06-01 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 15:40 [PATCH] gpiolib: split character device into gpiolib-cdev Kent Gibson
2020-05-28 0:47 ` kbuild test robot
2020-05-28 4:56 ` kbuild test robot
2020-06-01 18:33 ` kbuild test robot [this message]
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=202006020221.C4AD44rR%lkp@intel.com \
--to=lkp@intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=kbuild-all@lists.01.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=warthog618@gmail.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