From: kernel test robot <lkp@intel.com>
To: Loic Poulain <loic.poulain@linaro.org>,
kuba@kernel.org, davem@davemloft.net
Cc: kbuild-all@01.org, linux-arm-msm@vger.kernel.org,
aleksander@aleksander.es, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, bjorn.andersson@linaro.org,
gregkh@linuxfoundation.org, manivannan.sadhasivam@linaro.org,
hemantk@codeaurora.org
Subject: Re: [PATCH net-next v3] net: Add Qcom WWAN control driver
Date: Tue, 9 Mar 2021 18:10:32 +0800 [thread overview]
Message-ID: <202103091850.oTy1R5k6-lkp@intel.com> (raw)
In-Reply-To: <1615279336-27227-1-git-send-email-loic.poulain@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 9149 bytes --]
Hi Loic,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-Qcom-WWAN-control-driver/20210309-163643
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d310ec03a34e92a77302edb804f7d68ee4f01ba0
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f4fcd3ed7ac5f29a28988eed9f5516f874073802
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Loic-Poulain/net-Add-Qcom-WWAN-control-driver/20210309-163643
git checkout f4fcd3ed7ac5f29a28988eed9f5516f874073802
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:10,
from drivers/net/wwan/mhi_wwan_ctrl.c:4:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:174:49: warning: ordered comparison of pointer with null pointer [-Wextra]
174 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:14,
from drivers/net/wwan/mhi_wwan_ctrl.c:4:
drivers/net/wwan/mhi_wwan_ctrl.c: In function 'mhi_wwan_ctrl_probe':
>> drivers/net/wwan/mhi_wwan_ctrl.c:442:48: error: 'MHI_MAX_MTU' undeclared (first use in this function); did you mean 'ETH_MAX_MTU'?
442 | wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
| ^~~~~~~~~~~
include/linux/minmax.h:18:39: note: in definition of macro '__typecheck'
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:110:27: note: in expansion of macro '__careful_cmp'
110 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/net/wwan/mhi_wwan_ctrl.c:442:17: note: in expansion of macro 'min_t'
442 | wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
| ^~~~~
drivers/net/wwan/mhi_wwan_ctrl.c:442:48: note: each undeclared identifier is reported only once for each function it appears in
442 | wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
| ^~~~~~~~~~~
include/linux/minmax.h:18:39: note: in definition of macro '__typecheck'
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:110:27: note: in expansion of macro '__careful_cmp'
110 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/net/wwan/mhi_wwan_ctrl.c:442:17: note: in expansion of macro 'min_t'
442 | wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
| ^~~~~
include/linux/minmax.h:42:2: error: first argument to '__builtin_choose_expr' not a constant
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:110:27: note: in expansion of macro '__careful_cmp'
110 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/net/wwan/mhi_wwan_ctrl.c:442:17: note: in expansion of macro 'min_t'
442 | wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
| ^~~~~
drivers/net/wwan/mhi_wwan_ctrl.c: At top level:
>> drivers/net/wwan/mhi_wwan_ctrl.c:504:53: error: 'MHI_MAX_MTU' undeclared here (not in a function); did you mean 'ETH_MAX_MTU'?
504 | { .chan = MHI_WWAN_CTRL_PROTO_QCDM, .driver_data = MHI_MAX_MTU },
| ^~~~~~~~~~~
| ETH_MAX_MTU
vim +442 drivers/net/wwan/mhi_wwan_ctrl.c
409
410 static int mhi_wwan_ctrl_probe(struct mhi_device *mhi_dev,
411 const struct mhi_device_id *id)
412 {
413 struct mhi_wwan_dev *wwandev;
414 struct device *dev;
415 int index, err;
416
417 /* Create mhi_wwan data context */
418 wwandev = kzalloc(sizeof(*wwandev), GFP_KERNEL);
419 if (!wwandev)
420 return -ENOMEM;
421
422 /* Retrieve index */
423 mutex_lock(&mhi_wwan_ctrl_drv_lock);
424 index = idr_alloc(&mhi_wwan_ctrl_idr, wwandev, 0,
425 MHI_WWAN_CTRL_MAX_MINORS, GFP_KERNEL);
426 mutex_unlock(&mhi_wwan_ctrl_drv_lock);
427 if (index < 0) {
428 err = index;
429 goto err_free_wwandev;
430 }
431
432 /* Init mhi_wwan data */
433 kref_init(&wwandev->ref_count);
434 mutex_init(&wwandev->mhi_dev_lock);
435 mutex_init(&wwandev->write_lock);
436 init_waitqueue_head(&wwandev->ul_wq);
437 init_waitqueue_head(&wwandev->dl_wq);
438 spin_lock_init(&wwandev->dl_queue_lock);
439 INIT_LIST_HEAD(&wwandev->dl_queue);
440 wwandev->mhi_dev = mhi_dev;
441 wwandev->minor = index;
> 442 wwandev->mtu = min_t(size_t, id->driver_data, MHI_MAX_MTU);
443 set_bit(MHI_WWAN_CONNECTED, &wwandev->flags);
444
445 if (mhi_dev->dl_chan)
446 set_bit(MHI_WWAN_DL_CAP, &wwandev->flags);
447 if (mhi_dev->ul_chan)
448 set_bit(MHI_WWAN_UL_CAP, &wwandev->flags);
449
450 dev_set_drvdata(&mhi_dev->dev, wwandev);
451
452 /* Creates a new device and registers it with sysfs */
453 dev = device_create(mhi_wwan_ctrl_class, &mhi_dev->dev,
454 MKDEV(mhi_wwan_ctrl_major, index), wwandev,
455 "wwan_%s", dev_name(&mhi_dev->dev));
456 if (IS_ERR(dev)) {
457 err = PTR_ERR(dev);
458 goto err_free_idr;
459 }
460
461 return 0;
462
463 err_free_idr:
464 mutex_lock(&mhi_wwan_ctrl_drv_lock);
465 idr_remove(&mhi_wwan_ctrl_idr, wwandev->minor);
466 mutex_unlock(&mhi_wwan_ctrl_drv_lock);
467 err_free_wwandev:
468 kfree(wwandev);
469 dev_set_drvdata(&mhi_dev->dev, NULL);
470
471 return err;
472 };
473
474 static void mhi_wwan_ctrl_remove(struct mhi_device *mhi_dev)
475 {
476 struct mhi_wwan_dev *wwandev = dev_get_drvdata(&mhi_dev->dev);
477
478 dev_set_drvdata(&mhi_dev->dev, NULL);
479
480 mutex_lock(&mhi_wwan_ctrl_drv_lock);
481 idr_remove(&mhi_wwan_ctrl_idr, wwandev->minor);
482 mutex_unlock(&mhi_wwan_ctrl_drv_lock);
483
484 clear_bit(MHI_WWAN_CONNECTED, &wwandev->flags);
485 device_destroy(mhi_wwan_ctrl_class, MKDEV(mhi_wwan_ctrl_major, wwandev->minor));
486
487 /* Unlink mhi_dev from mhi_wwan_dev */
488 mutex_lock(&wwandev->mhi_dev_lock);
489 wwandev->mhi_dev = NULL;
490 mutex_unlock(&wwandev->mhi_dev_lock);
491
492 /* wake up any blocked user */
493 wake_up_interruptible(&wwandev->dl_wq);
494 wake_up_interruptible(&wwandev->ul_wq);
495
496 kref_put(&wwandev->ref_count, mhi_wwan_ctrl_dev_release);
497 }
498
499 /* .driver_data stores max mtu */
500 static const struct mhi_device_id mhi_wwan_ctrl_match_table[] = {
501 { .chan = MHI_WWAN_CTRL_PROTO_AT, .driver_data = 4096 },
502 { .chan = MHI_WWAN_CTRL_PROTO_MBIM, .driver_data = 4096 },
503 { .chan = MHI_WWAN_CTRL_PROTO_QMUX, .driver_data = 4096 },
> 504 { .chan = MHI_WWAN_CTRL_PROTO_QCDM, .driver_data = MHI_MAX_MTU },
505 { .chan = MHI_WWAN_CTRL_PROTO_FIREHOSE, .driver_data = MHI_MAX_MTU },
506 {},
507 };
508 MODULE_DEVICE_TABLE(mhi, mhi_wwan_ctrl_match_table);
509
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59728 bytes --]
prev parent reply other threads:[~2021-03-09 10:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 8:42 [PATCH net-next v3] net: Add Qcom WWAN control driver Loic Poulain
2021-03-09 9:35 ` Greg KH
2021-03-09 10:28 ` Loic Poulain
2021-03-09 10:33 ` Greg KH
2021-03-09 16:01 ` Jeffrey Hugo
2021-03-09 16:35 ` Greg KH
2021-03-09 10:10 ` kernel 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=202103091850.oTy1R5k6-lkp@intel.com \
--to=lkp@intel.com \
--cc=aleksander@aleksander.es \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=hemantk@codeaurora.org \
--cc=kbuild-all@01.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=netdev@vger.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 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).