From: kernel test robot <lkp@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: oe-kbuild-all@lists.linux.dev, alsa-devel@alsa-project.org,
Jaroslav Kysela <perex@perex.cz>
Subject: [tiwai-sound:topic/midi20 9/40] sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16
Date: Sat, 27 May 2023 06:02:34 +0800 [thread overview]
Message-ID: <202305270534.odwHL9F0-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git topic/midi20
head: 77700b81bd0e47d89d50eb4b3f2f323492f79998
commit: ff49d1df79aef7580fe3ac99d17c3f886655d080 [9/40] ALSA: usb-audio: USB MIDI 2.0 UMP support
config: microblaze-randconfig-s032-20230526 (https://download.01.org/0day-ci/archive/20230527/202305270534.odwHL9F0-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 12.1.0
reproduce:
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?id=ff49d1df79aef7580fe3ac99d17c3f886655d080
git remote add tiwai-sound https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
git fetch --no-tags tiwai-sound topic/midi20
git checkout ff49d1df79aef7580fe3ac99d17c3f886655d080
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash sound/usb/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305270534.odwHL9F0-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16
>> sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16
>> sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16
>> sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16
vim +548 sound/usb/midi2.c
530
531 /* get the full group terminal block descriptors and return the size */
532 static int get_group_terminal_block_descs(struct snd_usb_midi2_interface *umidi)
533 {
534 struct usb_host_interface *hostif = umidi->hostif;
535 struct usb_device *dev = umidi->chip->dev;
536 struct usb_ms20_gr_trm_block_header_descriptor header = { 0 };
537 unsigned char *data;
538 int err, size;
539
540 err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
541 USB_REQ_GET_DESCRIPTOR,
542 USB_RECIP_INTERFACE | USB_TYPE_STANDARD | USB_DIR_IN,
543 USB_DT_CS_GR_TRM_BLOCK << 8 | hostif->desc.bAlternateSetting,
544 hostif->desc.bInterfaceNumber,
545 &header, sizeof(header));
546 if (err < 0)
547 return err;
> 548 size = __le16_to_cpu(header.wTotalLength);
549 if (!size) {
550 dev_err(&dev->dev, "Failed to get GTB descriptors for %d:%d\n",
551 hostif->desc.bInterfaceNumber, hostif->desc.bAlternateSetting);
552 return -EINVAL;
553 }
554
555 data = kzalloc(size, GFP_KERNEL);
556 if (!data)
557 return -ENOMEM;
558
559 err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
560 USB_REQ_GET_DESCRIPTOR,
561 USB_RECIP_INTERFACE | USB_TYPE_STANDARD | USB_DIR_IN,
562 USB_DT_CS_GR_TRM_BLOCK << 8 | hostif->desc.bAlternateSetting,
563 hostif->desc.bInterfaceNumber, data, size);
564 if (err < 0) {
565 kfree(data);
566 return err;
567 }
568
569 umidi->blk_descs = data;
570 umidi->blk_desc_size = size;
571 return 0;
572 }
573
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2023-05-26 22:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 22:02 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-25 21:31 [tiwai-sound:topic/midi20 9/40] sound/usb/midi2.c:548:16: sparse: sparse: cast to restricted __le16 kernel test robot
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=202305270534.odwHL9F0-lkp@intel.com \
--to=lkp@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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