From: kernel test robot <lkp@intel.com>
To: Pho Tran <photranvan0712@gmail.com>,
johan@kernel.org, gregkh@linuxfoundation.org
Cc: kbuild-all@lists.01.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Hung.Nguyen@silabs.com,
Tung.Pham@silabs.com, Pho Tran <pho.tran@silabs.com>
Subject: Re: [PATCH v8] USB: serial: cp210x: Add support for GPIOs on CP2108
Date: Tue, 6 Apr 2021 21:10:35 +0800 [thread overview]
Message-ID: <202104062106.NYon4VJK-lkp@intel.com> (raw)
In-Reply-To: <20210406101850.3111-1-photranvan0712@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3514 bytes --]
Hi Pho,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb-serial/usb-next]
[also build test WARNING on usb/usb-testing tty/tty-testing v5.12-rc6 next-20210401]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Pho-Tran/USB-serial-cp210x-Add-support-for-GPIOs-on-CP2108/20210406-182022
base: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-next
config: i386-randconfig-s001-20210406 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-279-g6d5d9b42-dirty
# https://github.com/0day-ci/linux/commit/850a69bacbd236b7bbdadfa4007e7f13b3c79471
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pho-Tran/USB-serial-cp210x-Add-support-for-GPIOs-on-CP2108/20210406-182022
git checkout 850a69bacbd236b7bbdadfa4007e7f13b3c79471
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/usb/serial/cp210x.c:1540:15: sparse: sparse: cast to restricted __le16
vim +1540 drivers/usb/serial/cp210x.c
1496
1497 static int cp210x_gpio_get(struct gpio_chip *gc, unsigned int gpio)
1498 {
1499 struct usb_serial *serial = gpiochip_get_data(gc);
1500 struct cp210x_serial_private *priv = usb_get_serial_data(serial);
1501 u8 req_type = REQTYPE_DEVICE_TO_HOST;
1502 int result;
1503 u16 buf;
1504
1505 result = usb_autopm_get_interface(serial->interface);
1506 if (result)
1507 return result;
1508 /*
1509 * This function will be read latch value of gpio and storage to buf(16bit)
1510 * where bit 0 is GPIO0, bit 1 is GPIO1, etc. Up to GPIOn where n is
1511 * total number of GPIO pins the interface supports.
1512 * Interfaces on CP2102N supports 7 GPIOs
1513 * Interfaces on CP2103 amd CP2104 supports 4 GPIOs
1514 * Enhanced interfaces on CP2105 support 3 GPIOs
1515 * Standard interfaces on CP2105 support 4 GPIOs
1516 * Interfaces on CP2108 supports 16 GPIOs
1517 */
1518 switch (priv->partnum) {
1519 /*
1520 * Request type to Read_Latch of CP2105 and Cp2108
1521 * is 0xc1 <REQTYPE_INTERFACE_TO_HOST>
1522 */
1523 case CP210X_PARTNUM_CP2108:
1524 req_type = REQTYPE_INTERFACE_TO_HOST;
1525 result = cp210x_read_vendor_block(serial, req_type,
1526 CP210X_READ_LATCH, &buf, sizeof(__le16));
1527 break;
1528 case CP210X_PARTNUM_CP2105:
1529 req_type = REQTYPE_INTERFACE_TO_HOST;
1530 result = cp210x_read_vendor_block(serial, req_type,
1531 CP210X_READ_LATCH, &buf, sizeof(u8));
1532 break;
1533 default:
1534 result = cp210x_read_vendor_block(serial, req_type,
1535 CP210X_READ_LATCH, &buf, sizeof(u8));
1536 break;
1537 }
1538 if (result < 0)
1539 return result;
> 1540 buf = le16_to_cpu(buf);
1541 usb_autopm_put_interface(serial->interface);
1542 return !!(buf & BIT(gpio));
1543 }
1544
---
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: 35508 bytes --]
next prev parent reply other threads:[~2021-04-06 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 10:18 Pho Tran
2021-04-06 13:10 ` kernel test robot [this message]
[not found] ` <CAHp75Vf8jwhLkaHL2D6FvRJpmbBqpTzePpNqVAFVt8EhSCgxnw@mail.gmail.com>
[not found] ` <CAG-T6mP98t6JuQ68bi0aD9PDEpLbkAVwrf-Gp7H7GLQV5rW_GQ@mail.gmail.com>
2021-04-07 12:38 ` Andy Shevchenko
2021-04-09 15:50 ` Johan Hovold
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=202104062106.NYon4VJK-lkp@intel.com \
--to=lkp@intel.com \
--cc=Hung.Nguyen@silabs.com \
--cc=Tung.Pham@silabs.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pho.tran@silabs.com \
--cc=photranvan0712@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
all inboxes | Powered by JetHome®