lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 20 Oct 2022 09:14:38 +0800
From:   kernel test robot <lkp@...el.com>
To:     Janne Grunau <j@...nau.net>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Hector Martin <marcan@...can.st>
Subject: [asahilinux:bits/090-spi-hid 22/34]
 drivers/hid/hid-magicmouse.c:662:41: warning: format specifies type
 'unsigned short' but the argument has type 'int'

tree:   https://github.com/AsahiLinux/linux bits/090-spi-hid
head:   bd3ea9c827680dbc49e10be104d6bb78b0f5527c
commit: b01f61f3656f9f426d3de00807b60e9d913bd1cd [22/34] HID: magicmouse: add support for Macbook trackpads
config: x86_64-randconfig-a005
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/AsahiLinux/linux/commit/b01f61f3656f9f426d3de00807b60e9d913bd1cd
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux bits/090-spi-hid
        git checkout b01f61f3656f9f426d3de00807b60e9d913bd1cd
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/hid/hid-magicmouse.c:662:41: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                   hid_dbg(hdev, "ev x:%04hx y:%04hx\n", le16_to_int(f->abs_x),
                                       ~~~~~             ^~~~~~~~~~~~~~~~~~~~~
                                       %04x
   include/linux/hid.h:1213:30: note: expanded from macro 'hid_dbg'
           dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__)
                                ~~~    ^~~~~~~~~~~
   include/linux/dev_printk.h:155:39: note: expanded from macro 'dev_dbg'
           dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                        ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:273:19: note: expanded from macro 'dynamic_dev_dbg'
                              dev, fmt, ##__VA_ARGS__)
                                   ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:249:59: note: expanded from macro '_dynamic_func_call'
           _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
                                                                    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:247:65: note: expanded from macro '_dynamic_func_call_cls'
           __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
                                                                          ^~~~~~~~~~~
   include/linux/dynamic_debug.h:223:15: note: expanded from macro '__dynamic_func_call_cls'
                   func(&id, ##__VA_ARGS__);                       \
                               ^~~~~~~~~~~
   drivers/hid/hid-magicmouse.c:663:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                           le16_to_int(f->abs_y));
                           ^~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1213:30: note: expanded from macro 'hid_dbg'
           dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__)
                                ~~~    ^~~~~~~~~~~
   include/linux/dev_printk.h:155:39: note: expanded from macro 'dev_dbg'
           dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                        ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:273:19: note: expanded from macro 'dynamic_dev_dbg'
                              dev, fmt, ##__VA_ARGS__)
                                   ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:249:59: note: expanded from macro '_dynamic_func_call'
           _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
                                                                    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:247:65: note: expanded from macro '_dynamic_func_call_cls'
           __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
                                                                          ^~~~~~~~~~~
   include/linux/dynamic_debug.h:223:15: note: expanded from macro '__dynamic_func_call_cls'
                   func(&id, ##__VA_ARGS__);                       \
                               ^~~~~~~~~~~
   2 warnings generated.


vim +662 drivers/hid/hid-magicmouse.c

   620	
   621	static int magicmouse_raw_event_spi(struct hid_device *hdev,
   622			struct hid_report *report, u8 *data, int size)
   623	{
   624		struct magicmouse_sc *msc = hid_get_drvdata(hdev);
   625		struct input_dev *input = msc->input;
   626		struct tp_header *tp_hdr;
   627		struct tp_finger *f;
   628		int i, n;
   629		u32 npoints;
   630		const size_t hdr_sz = sizeof(struct tp_header);
   631		const size_t touch_sz = sizeof(struct tp_finger);
   632		u8 map_contacs[MAX_CONTACTS];
   633	
   634		// hid_warn(hdev, "%s\n", __func__);
   635		// print_hex_dump_debug("appleft ev: ", DUMP_PREFIX_OFFSET, 16, 1, data,
   636		// 		     size, false);
   637	
   638		if (data[0] != TRACKPAD2_USB_REPORT_ID)
   639			return 0;
   640	
   641		/* Expect 46 bytes of prefix, and N * 30 bytes of touch data. */
   642		if (size < hdr_sz || ((size - hdr_sz) % touch_sz) != 0)
   643			return 0;
   644	
   645		tp_hdr = (struct tp_header *)data;
   646	
   647		npoints = (size - hdr_sz) / touch_sz;
   648		if (npoints < tp_hdr->num_fingers || npoints > MAX_CONTACTS) {
   649			hid_warn(hdev,
   650				 "unexpected number of touches (%u) for "
   651				 "report\n",
   652				 npoints);
   653			return 0;
   654		}
   655	
   656		n = 0;
   657		for (i = 0; i < tp_hdr->num_fingers; i++) {
   658			f = (struct tp_finger *)(data + hdr_sz + i * touch_sz);
   659			if (le16_to_int(f->touch_major) == 0)
   660				continue;
   661	
 > 662			hid_dbg(hdev, "ev x:%04hx y:%04hx\n", le16_to_int(f->abs_x),
   663				le16_to_int(f->abs_y));
   664			msc->pos[n].x = le16_to_int(f->abs_x);
   665			msc->pos[n].y = -le16_to_int(f->abs_y);
   666			map_contacs[n] = i;
   667			n++;
   668		}
   669	
   670		input_mt_assign_slots(input, msc->tracking_ids, msc->pos, n, 0);
   671	
   672		for (i = 0; i < n; i++) {
   673			int idx = map_contacs[i];
   674			f = (struct tp_finger *)(data + hdr_sz + idx * touch_sz);
   675			report_finger_data(input, msc->tracking_ids[i], &msc->pos[i], f);
   676		}
   677	
   678		input_mt_sync_frame(input);
   679		input_report_key(input, BTN_MOUSE, data[1] & 1);
   680	
   681		input_sync(input);
   682		return 1;
   683	}
   684	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (140698 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ