Content-Type: multipart/mixed; boundary="===============8289801993274829711==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH] gpiolib: split character device into gpiolib-cdev Date: Tue, 02 Jun 2020 02:33:41 +0800 Message-ID: <202006020221.C4AD44rR%lkp@intel.com> In-Reply-To: <20200527154005.6827-1-warthog618@gmail.com> List-Id: --===============8289801993274829711== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 h= elp 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/37406= 982] 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 cppcheck warnings: (new ones prefixed by >>) >> drivers/gpio/gpiolib-cdev.c:1035:6: warning: Variable 'ret' is reassigne= d a value before the old one has been used. [redundantAssignment] ret =3D 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 =3D -ENOMEM; ^ drivers/gpio/gpiolib-cdev.c:1035:6: note: Variable 'ret' is reassigned a= value before the old one has been used. ret =3D 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 =3D container_of(inode->i_cdev, 1014 struct gpio_device, chrdev); 1015 struct gpio_chardev_data *priv; 1016 int ret =3D -ENOMEM; 1017 = 1018 /* Fail on open if the backing gpiochip is gone */ 1019 if (!gdev->chip) 1020 return -ENODEV; 1021 = 1022 priv =3D kzalloc(sizeof(*priv), GFP_KERNEL); 1023 if (!priv) 1024 return -ENOMEM; 1025 = 1026 priv->watched_lines =3D 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 =3D gdev; 1033 = 1034 priv->lineinfo_changed_nb.notifier_call =3D lineinfo_changed_notify; > 1035 ret =3D 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 =3D priv; 1042 = 1043 ret =3D 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(a)lists.01.org --===============8289801993274829711==--