Re: [PATCH] rpmsg: Make rpmsg_create_ept() propagate error

From: kbuild test robot
Date: Tue May 09 2017 - 04:48:02 EST


Hi Bjorn,

[auto build test WARNING on next-20170505]
[also build test WARNING on v4.11]
[cannot apply to v4.9-rc8 v4.9-rc7 v4.9-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Bjorn-Andersson/rpmsg-Make-rpmsg_create_ept-propagate-error/20170509-135640
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All warnings (new ones prefixed by >>):

drivers/rpmsg/virtio_rpmsg_bus.c:227:31: sparse: incorrect type in return expression (different base types)
drivers/rpmsg/virtio_rpmsg_bus.c:227:31: expected struct rpmsg_endpoint *
drivers/rpmsg/virtio_rpmsg_bus.c:227:31: got long
drivers/rpmsg/virtio_rpmsg_bus.c: In function '__rpmsg_create_ept':
>> drivers/rpmsg/virtio_rpmsg_bus.c:227:18: warning: passing argument 1 of 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
return PTR_ERR(-ENOMEM);
^
In file included from include/linux/rwsem.h:17:0,
from include/linux/notifier.h:14,
from include/linux/memory_hotplug.h:6,
from include/linux/mmzone.h:757,
from include/linux/gfp.h:5,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from drivers/rpmsg/virtio_rpmsg_bus.c:23:
include/linux/err.h:28:33: note: expected 'const void *' but argument is of type 'int'
static inline long __must_check PTR_ERR(__force const void *ptr)
^~~~~~~
>> drivers/rpmsg/virtio_rpmsg_bus.c:227:10: warning: return makes pointer from integer without a cast [-Wint-conversion]
return PTR_ERR(-ENOMEM);
^~~~~~~~~~~~~~~~

vim +/PTR_ERR +227 drivers/rpmsg/virtio_rpmsg_bus.c

211 */
212 kfree(ept);
213 }
214
215 /* for more info, see below documentation of rpmsg_create_ept() */
216 static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp,
217 struct rpmsg_device *rpdev,
218 rpmsg_rx_cb_t cb,
219 void *priv, u32 addr)
220 {
221 int id_min, id_max, id;
222 struct rpmsg_endpoint *ept;
223 struct device *dev = rpdev ? &rpdev->dev : &vrp->vdev->dev;
224
225 ept = kzalloc(sizeof(*ept), GFP_KERNEL);
226 if (!ept)
> 227 return PTR_ERR(-ENOMEM);
228
229 kref_init(&ept->refcount);
230 mutex_init(&ept->cb_lock);
231
232 ept->rpdev = rpdev;
233 ept->cb = cb;
234 ept->priv = priv;
235 ept->ops = &virtio_endpoint_ops;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip