From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v4 05/10] usb: gadget: f_uac2: Support multiple sampling rates
Date: Wed, 12 Jan 2022 23:19:15 +0800 [thread overview]
Message-ID: <202201122317.eiQOLXzP-lkp@intel.com> (raw)
In-Reply-To: <20220110073742.394237-6-pavel.hofman@ivitera.com>
[-- Attachment #1: Type: text/plain, Size: 5946 bytes --]
Hi Pavel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on next-20220112]
[cannot apply to linus/master balbi-usb/testing/next peter-chen-usb/for-usb-next v5.16]
[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/Pavel-Hofman/usb-gadget-audio-Multiple-rates-notify/20220110-154453
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: i386-randconfig-s001 (https://download.01.org/0day-ci/archive/20220112/202201122317.eiQOLXzP-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/275344f5925d7804375e3572fd2fbd1febb029a6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pavel-Hofman/usb-gadget-audio-Multiple-rates-notify/20220110-154453
git checkout 275344f5925d7804375e3572fd2fbd1febb029a6
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/usb/gadget/function/
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/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
>> drivers/usb/gadget/function/f_uac2.c:1553:33: sparse: sparse: restricted __le16 degrades to integer
drivers/usb/gadget/function/f_uac2.c:1625:15: sparse: sparse: cast to restricted __le32
vim +1553 drivers/usb/gadget/function/f_uac2.c
1511
1512 static int
1513 in_rq_range(struct usb_function *fn, const struct usb_ctrlrequest *cr)
1514 {
1515 struct usb_request *req = fn->config->cdev->req;
1516 struct g_audio *agdev = func_to_g_audio(fn);
1517 struct f_uac2_opts *opts = g_audio_to_uac2_opts(agdev);
1518 u16 w_length = le16_to_cpu(cr->wLength);
1519 u16 w_index = le16_to_cpu(cr->wIndex);
1520 u16 w_value = le16_to_cpu(cr->wValue);
1521 u8 entity_id = (w_index >> 8) & 0xff;
1522 u8 control_selector = w_value >> 8;
1523 int value = -EOPNOTSUPP;
1524
1525 if ((entity_id == USB_IN_CLK_ID) || (entity_id == USB_OUT_CLK_ID)) {
1526 if (control_selector == UAC2_CS_CONTROL_SAM_FREQ) {
1527 struct cntrl_ranges_lay3_srates rs;
1528 int i;
1529 int wNumSubRanges = 0;
1530 int srate;
1531 int *srates;
1532
1533 if (entity_id == USB_IN_CLK_ID)
1534 srates = opts->p_srates;
1535 else if (entity_id == USB_OUT_CLK_ID)
1536 srates = opts->c_srates;
1537 else
1538 return -EOPNOTSUPP;
1539 for (i = 0; i < UAC_MAX_RATES; i++) {
1540 srate = srates[i];
1541 if (srate == 0)
1542 break;
1543
1544 rs.r[wNumSubRanges].dMIN = cpu_to_le32(srate);
1545 rs.r[wNumSubRanges].dMAX = cpu_to_le32(srate);
1546 rs.r[wNumSubRanges].dRES = 0;
1547 wNumSubRanges++;
1548 dev_dbg(&agdev->gadget->dev,
1549 "%s(): clk %d: rate ID %d: %d\n",
1550 __func__, entity_id, wNumSubRanges, srate);
1551 }
1552 rs.wNumSubRanges = cpu_to_le16(wNumSubRanges);
> 1553 value = min_t(unsigned int, w_length, ranges_lay3_size(rs));
1554 dev_dbg(&agdev->gadget->dev, "%s(): sending %d rates, size %d\n",
1555 __func__, rs.wNumSubRanges, value);
1556 memcpy(req->buf, &rs, value);
1557 } else {
1558 dev_err(&agdev->gadget->dev,
1559 "%s:%d control_selector=%d TODO!\n",
1560 __func__, __LINE__, control_selector);
1561 }
1562 } else if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
1563 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
1564 unsigned int is_playback = 0;
1565
1566 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
1567 is_playback = 1;
1568
1569 if (control_selector == UAC_FU_VOLUME) {
1570 struct cntrl_range_lay2 r;
1571 s16 max_db, min_db, res_db;
1572
1573 if (is_playback) {
1574 max_db = opts->p_volume_max;
1575 min_db = opts->p_volume_min;
1576 res_db = opts->p_volume_res;
1577 } else {
1578 max_db = opts->c_volume_max;
1579 min_db = opts->c_volume_min;
1580 res_db = opts->c_volume_res;
1581 }
1582
1583 r.wMAX = cpu_to_le16(max_db);
1584 r.wMIN = cpu_to_le16(min_db);
1585 r.wRES = cpu_to_le16(res_db);
1586 r.wNumSubRanges = cpu_to_le16(1);
1587
1588 value = min_t(unsigned int, w_length, sizeof(r));
1589 memcpy(req->buf, &r, value);
1590 } else {
1591 dev_err(&agdev->gadget->dev,
1592 "%s:%d control_selector=%d TODO!\n",
1593 __func__, __LINE__, control_selector);
1594 }
1595 } else {
1596 dev_err(&agdev->gadget->dev,
1597 "%s:%d entity_id=%d control_selector=%d TODO!\n",
1598 __func__, __LINE__, entity_id, control_selector);
1599 }
1600
1601 return value;
1602 }
1603
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2022-01-12 15:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 7:37 [PATCH v4 00/10] usb: gadget: audio: Multiple rates, notify Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 01/10] usb: gadget:audio: Replace deprecated macro S_IRUGO Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 02/10] usb: gadget: u_audio: Support multiple sampling rates Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 03/10] usb: gadget: u_audio: Move dynamic srate from params to rtd Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 04/10] usb: gadget: u_audio: Add capture/playback srate getter Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 05/10] usb: gadget: f_uac2: Support multiple sampling rates Pavel Hofman
2022-01-12 15:19 ` kernel test robot [this message]
2022-01-10 7:37 ` [PATCH v4 06/10] usb: gadget: f_uac1: " Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 07/10] usb: gadget: u_audio: Rate ctl notifies about current srate (0=stopped) Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 08/10] usb: gadget: u_audio: Add suspend call Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 09/10] usb: gadget: f_uac2: Add suspend callback Pavel Hofman
2022-01-10 7:37 ` [PATCH v4 10/10] usb: gadget: f_uac1: " Pavel Hofman
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=202201122317.eiQOLXzP-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.