Skip to contentSkip to conversation

drivers/hid/hid-mcp2221.c:734:18: warning: unused variable 'tmp'

PATCH Jiri Kosina 2 participants 2 messages Oct 20, 2022 1 message not in the archive HID

lore
Share & tools
lore

Jiri Kosina

author maintainer
#1 lore raw
In reply to a message not in the archive
Quoted 17 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-6.2/mcp2221
head:   960f9df7c620ecb6030aff1d9a6c3d67598b8290
commit: 960f9df7c620ecb6030aff1d9a6c3d67598b8290 [3/3] HID: mcp2221: add ADC/DAC support via iio subsystem
config: i386-randconfig-a014
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?id=960f9df7c620ecb6030aff1d9a6c3d67598b8290
        git remote add hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
        git fetch --no-tags hid for-6.2/mcp2221
        git checkout 960f9df7c620ecb6030aff1d9a6c3d67598b8290
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <[email protected]>

Quoted 6 lines

All warnings (new ones prefixed by >>):

   drivers/hid/hid-mcp2221.c: In function 'mcp2221_raw_event':
Quoted 1 line
Quoted 1 line

drivers/hid/hid-mcp2221.c:734:18: warning: unused variable 'tmp' [-Wunused-variable]

     734 |         u8 *buf, tmp;
         |                  ^~~

Matt, I have fixed this one in the tree now by moving the declaration into the conditional block.

Could you please look into the other one that sparse reported regarding casting to __le16?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw
Quoted 25 lines · Jiri Kosina
Quoted 1 line · kernel test robot

tree: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git

for-6.2/mcp2221

Quoted 2 lines
head:   960f9df7c620ecb6030aff1d9a6c3d67598b8290
commit: 960f9df7c620ecb6030aff1d9a6c3d67598b8290 [3/3] HID: mcp2221: add

ADC/DAC support via iio subsystem

Quoted 4 lines

config: i386-randconfig-a014
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):

        #

https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?id=960f9df7c620ecb6030aff1d9a6c3d67598b8290

Quoted 1 line

git remote add hid

https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git

Quoted 11 lines
        git fetch --no-tags hid for-6.2/mcp2221
        git checkout 960f9df7c620ecb6030aff1d9a6c3d67598b8290
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

Quoted 10 lines
Quoted 2 lines
   drivers/hid/hid-mcp2221.c: In function 'mcp2221_raw_event':
Quoted 1 line
Quoted 1 line

drivers/hid/hid-mcp2221.c:734:18: warning: unused variable 'tmp'

[-Wunused-variable]

Quoted 2 lines
     734 |         u8 *buf, tmp;
         |                  ^~~

Matt, I have fixed this one in the tree now by moving the declaration into the conditional block.

Thanks!

Quoted 4 lines

Could you please look into the other one that sparse reported regarding casting to __le16?

I'll take a look.

- Matt

Quoted 7 lines

Thanks,

--
Jiri Kosina
SUSE Labs