LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int'
@ 2021-11-26  6:44 kernel test robot
  2021-11-30  0:19 ` Doug Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-11-26  6:44 UTC (permalink / raw)
  To: Douglas Anderson; +Cc: llvm, kbuild-all, linux-kernel, Benjamin Tissoires

Hi Douglas,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a4849f6000e29235a2707f22e39da6b897bb9543
commit: c1ed18c11bdb80eced208a61d40b1988f36a014f HID: i2c-hid: Introduce goodix-i2c-hid using i2c-hid core
date:   10 months ago
config: arm64-randconfig-r034-20211116 (https://download.01.org/0day-ci/archive/20211126/202111261447.lxHTeAhi-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c1ed18c11bdb80eced208a61d40b1988f36a014f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c1ed18c11bdb80eced208a61d40b1988f36a014f
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                           le16_to_cpu(hdesc->bcdVersion));
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
           _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                 ~~~     ^~~~~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
   #define le16_to_cpu __le16_to_cpu
                       ^
   include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
           (__builtin_constant_p((__u16)(x)) ?     \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/i2c-hid/i2c-hid-core.c:992:18: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat]
                    client->name, hid->vendor, hid->product);
                                  ^~~~~~~~~~~
   drivers/hid/i2c-hid/i2c-hid-core.c:992:31: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat]
                    client->name, hid->vendor, hid->product);
                                               ^~~~~~~~~~~~
   3 warnings generated.


vim +867 drivers/hid/i2c-hid/i2c-hid-core.c

4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  836  
0fe763c570ad27 drivers/hid/i2c-hid/i2c-hid.c      Greg Kroah-Hartman 2012-12-21  837  static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  838  {
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  839  	struct i2c_client *client = ihid->client;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  840  	struct i2c_hid_desc *hdesc = &ihid->hdesc;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  841  	unsigned int dsize;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  842  	int ret;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  843  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  844  	/* i2c hid fetch using a fixed descriptor size (30 bytes) */
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  845  	if (i2c_hid_get_dmi_i2c_hid_desc_override(client->name)) {
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  846  		i2c_hid_dbg(ihid, "Using a HID descriptor override\n");
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  847  		ihid->hdesc =
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  848  			*i2c_hid_get_dmi_i2c_hid_desc_override(client->name);
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  849  	} else {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  850  		i2c_hid_dbg(ihid, "Fetching the HID descriptor\n");
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  851  		ret = i2c_hid_command(client, &hid_descr_cmd,
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  852  				      ihid->hdesc_buffer,
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  853  				      sizeof(struct i2c_hid_desc));
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  854  		if (ret) {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  855  			dev_err(&client->dev, "hid_descr_cmd failed\n");
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  856  			return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  857  		}
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  858  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  859  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  860  	/* Validate the length of HID descriptor, the 4 first bytes:
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  861  	 * bytes 0-1 -> length
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  862  	 * bytes 2-3 -> bcdVersion (has to be 1.00) */
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  863  	/* check bcdVersion == 1.0 */
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  864  	if (le16_to_cpu(hdesc->bcdVersion) != 0x0100) {
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  865  		dev_err(&client->dev,
9972dcc29cd1fc drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-12-04  866  			"unexpected HID descriptor bcdVersion (0x%04hx)\n",
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12 @867  			le16_to_cpu(hdesc->bcdVersion));
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  868  		return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  869  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  870  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  871  	/* Descriptor length should be 30 bytes as per the specification */
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  872  	dsize = le16_to_cpu(hdesc->wHIDDescLength);
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  873  	if (dsize != sizeof(struct i2c_hid_desc)) {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  874  		dev_err(&client->dev, "weird size of HID descriptor (%u)\n",
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  875  			dsize);
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  876  		return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  877  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  878  	i2c_hid_dbg(ihid, "HID Descriptor: %*ph\n", dsize, ihid->hdesc_buffer);
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  879  	return 0;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  880  }
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  881  

:::::: The code at line 867 was first introduced by commit
:::::: 4a200c3b9a40242652b5734630bdd0bcf3aca75f HID: i2c-hid: introduce HID over i2c specification implementation

:::::: TO: Benjamin Tissoires <benjamin.tissoires@gmail.com>
:::::: CC: Jiri Kosina <jkosina@suse.cz>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int'
  2021-11-26  6:44 drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' kernel test robot
@ 2021-11-30  0:19 ` Doug Anderson
  2021-12-02  0:26   ` Rong Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Anderson @ 2021-11-30  0:19 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, kbuild-all, linux-kernel, Benjamin Tissoires

<Beep> <Boop> <Bop> (translates as "Hello Mr. Robot"),

On Thu, Nov 25, 2021 at 10:44 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Douglas,
>
> First bad commit (maybe != root cause):
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   a4849f6000e29235a2707f22e39da6b897bb9543
> commit: c1ed18c11bdb80eced208a61d40b1988f36a014f HID: i2c-hid: Introduce goodix-i2c-hid using i2c-hid core
> date:   10 months ago
> config: arm64-randconfig-r034-20211116 (https://download.01.org/0day-ci/archive/20211126/202111261447.lxHTeAhi-lkp@intel.com/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
> 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
>         # install arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c1ed18c11bdb80eced208a61d40b1988f36a014f
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout c1ed18c11bdb80eced208a61d40b1988f36a014f
>         # save the config file to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
>                            le16_to_cpu(hdesc->bcdVersion));
>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
>            _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>                                  ~~~     ^~~~~~~~~~~
>    include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
>    #define le16_to_cpu __le16_to_cpu
>                        ^
>    include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
>    #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
>                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
>            (__builtin_constant_p((__u16)(x)) ?     \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

May I kindly point to the reply I gave to the same error last month
when you mailed it out?

https://lore.kernel.org/r/CAD=FV=WkUEkkkfGa+6QJSBvj8EgVrnGYYbd6RrC_5HdTue=mDw@mail.gmail.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int'
  2021-11-30  0:19 ` Doug Anderson
@ 2021-12-02  0:26   ` Rong Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Rong Chen @ 2021-12-02  0:26 UTC (permalink / raw)
  To: Doug Anderson, kernel test robot
  Cc: llvm, kbuild-all, linux-kernel, Benjamin Tissoires


On 11/30/21 08:19, Doug Anderson wrote:
> <Beep> <Boop> <Bop> (translates as "Hello Mr. Robot"),
>
> On Thu, Nov 25, 2021 at 10:44 PM kernel test robot <lkp@intel.com> wrote:
>> Hi Douglas,
>>
>> First bad commit (maybe != root cause):
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   a4849f6000e29235a2707f22e39da6b897bb9543
>> commit: c1ed18c11bdb80eced208a61d40b1988f36a014f HID: i2c-hid: Introduce goodix-i2c-hid using i2c-hid core
>> date:   10 months ago
>> config: arm64-randconfig-r034-20211116 (https://download.01.org/0day-ci/archive/20211126/202111261447.lxHTeAhi-lkp@intel.com/config)
>> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
>> 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
>>          # install arm64 cross compiling tool for clang build
>>          # apt-get install binutils-aarch64-linux-gnu
>>          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c1ed18c11bdb80eced208a61d40b1988f36a014f
>>          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>          git fetch --no-tags linus master
>>          git checkout c1ed18c11bdb80eced208a61d40b1988f36a014f
>>          # save the config file to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>>> drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
>>                             le16_to_cpu(hdesc->bcdVersion));
>>                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
>>             _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>>                                   ~~~     ^~~~~~~~~~~
>>     include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
>>     #define le16_to_cpu __le16_to_cpu
>>                         ^
>>     include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
>>     #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
>>                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
>>             (__builtin_constant_p((__u16)(x)) ?     \
>>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> May I kindly point to the reply I gave to the same error last month
> when you mailed it out?
>
> https://lore.kernel.org/r/CAD=FV=WkUEkkkfGa+6QJSBvj8EgVrnGYYbd6RrC_5HdTue=mDw@mail.gmail.com/
>

Hi Doug,

Thanks for the feedback, we have added the warnings to our ignore list.

Best Regards,

Rong Chen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int'
  2021-09-28 20:15 kernel test robot
@ 2021-09-28 20:26 ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2021-09-28 20:26 UTC (permalink / raw)
  To: kernel test robot
  Cc: llvm, kbuild-all, LKML, Benjamin Tissoires, Hans de Goede

Hi,

On Tue, Sep 28, 2021 at 1:16 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Douglas,
>
> First bad commit (maybe != root cause):
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   6fd3ec5c7af58d5d6b598fba22ac387645af33f4
> commit: b33752c300232d7f95dd9a4353947d0c9e6a0e52 HID: i2c-hid: Reorganize so ACPI and OF are separate modules
> date:   8 months ago
> config: arm64-randconfig-r016-20210927 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
> 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
>         # install arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b33752c300232d7f95dd9a4353947d0c9e6a0e52
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout b33752c300232d7f95dd9a4353947d0c9e6a0e52
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
>                            le16_to_cpu(hdesc->bcdVersion));
>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
>            _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>                                  ~~~     ^~~~~~~~~~~
>    include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
>    #define le16_to_cpu __le16_to_cpu
>                        ^
>    include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
>    #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
>                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
>            (__builtin_constant_p((__u16)(x)) ?     \
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Definitely not something new introduced by my commit. Also seems like
something wrong in the compiler or in the generic Linux header files?
It sure seems like if you call le16_to_cpu() you should be able to
assume that the type is "unsigned short" and not "int".

-Doug

^ permalink raw reply	[flat|nested] 5+ messages in thread

* drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int'
@ 2021-09-28 20:15 kernel test robot
  2021-09-28 20:26 ` Doug Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-09-28 20:15 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: llvm, kbuild-all, linux-kernel, Benjamin Tissoires, Hans de Goede

[-- Attachment #1: Type: text/plain, Size: 8750 bytes --]

Hi Douglas,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6fd3ec5c7af58d5d6b598fba22ac387645af33f4
commit: b33752c300232d7f95dd9a4353947d0c9e6a0e52 HID: i2c-hid: Reorganize so ACPI and OF are separate modules
date:   8 months ago
config: arm64-randconfig-r016-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b33752c300232d7f95dd9a4353947d0c9e6a0e52
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b33752c300232d7f95dd9a4353947d0c9e6a0e52
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                           le16_to_cpu(hdesc->bcdVersion));
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err'
           _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                 ~~~     ^~~~~~~~~~~
   include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
   #define le16_to_cpu __le16_to_cpu
                       ^
   include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
           (__builtin_constant_p((__u16)(x)) ?     \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/i2c-hid/i2c-hid-core.c:992:18: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat]
                    client->name, hid->vendor, hid->product);
                                  ^~~~~~~~~~~
   drivers/hid/i2c-hid/i2c-hid-core.c:992:31: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat]
                    client->name, hid->vendor, hid->product);
                                               ^~~~~~~~~~~~
   3 warnings generated.


vim +867 drivers/hid/i2c-hid/i2c-hid-core.c

4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  836  
0fe763c570ad27 drivers/hid/i2c-hid/i2c-hid.c      Greg Kroah-Hartman 2012-12-21  837  static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  838  {
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  839  	struct i2c_client *client = ihid->client;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  840  	struct i2c_hid_desc *hdesc = &ihid->hdesc;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  841  	unsigned int dsize;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  842  	int ret;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  843  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  844  	/* i2c hid fetch using a fixed descriptor size (30 bytes) */
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  845  	if (i2c_hid_get_dmi_i2c_hid_desc_override(client->name)) {
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  846  		i2c_hid_dbg(ihid, "Using a HID descriptor override\n");
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  847  		ihid->hdesc =
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  848  			*i2c_hid_get_dmi_i2c_hid_desc_override(client->name);
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  849  	} else {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  850  		i2c_hid_dbg(ihid, "Fetching the HID descriptor\n");
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  851  		ret = i2c_hid_command(client, &hid_descr_cmd,
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  852  				      ihid->hdesc_buffer,
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  853  				      sizeof(struct i2c_hid_desc));
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  854  		if (ret) {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  855  			dev_err(&client->dev, "hid_descr_cmd failed\n");
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  856  			return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  857  		}
9ee3e06610fdb8 drivers/hid/i2c-hid/i2c-hid-core.c Julian Sax         2018-09-19  858  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  859  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  860  	/* Validate the length of HID descriptor, the 4 first bytes:
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  861  	 * bytes 0-1 -> length
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  862  	 * bytes 2-3 -> bcdVersion (has to be 1.00) */
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  863  	/* check bcdVersion == 1.0 */
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  864  	if (le16_to_cpu(hdesc->bcdVersion) != 0x0100) {
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  865  		dev_err(&client->dev,
9972dcc29cd1fc drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-12-04  866  			"unexpected HID descriptor bcdVersion (0x%04hx)\n",
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12 @867  			le16_to_cpu(hdesc->bcdVersion));
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  868  		return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  869  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  870  
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  871  	/* Descriptor length should be 30 bytes as per the specification */
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  872  	dsize = le16_to_cpu(hdesc->wHIDDescLength);
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  873  	if (dsize != sizeof(struct i2c_hid_desc)) {
f58b8487bcc898 drivers/hid/i2c-hid/i2c-hid.c      Archana Patni      2014-05-08  874  		dev_err(&client->dev, "weird size of HID descriptor (%u)\n",
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  875  			dsize);
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  876  		return -ENODEV;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  877  	}
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  878  	i2c_hid_dbg(ihid, "HID Descriptor: %*ph\n", dsize, ihid->hdesc_buffer);
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  879  	return 0;
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  880  }
4a200c3b9a4024 drivers/hid/i2c-hid/i2c-hid.c      Benjamin Tissoires 2012-11-12  881  

:::::: The code at line 867 was first introduced by commit
:::::: 4a200c3b9a40242652b5734630bdd0bcf3aca75f HID: i2c-hid: introduce HID over i2c specification implementation

:::::: TO: Benjamin Tissoires <benjamin.tissoires@gmail.com>
:::::: CC: Jiri Kosina <jkosina@suse.cz>

---
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: 33143 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-02  0:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  6:44 drivers/hid/i2c-hid/i2c-hid-core.c:867:4: warning: format specifies type 'unsigned short' but the argument has type 'int' kernel test robot
2021-11-30  0:19 ` Doug Anderson
2021-12-02  0:26   ` Rong Chen
  -- strict thread matches above, loose matches on Subject: below --
2021-09-28 20:15 kernel test robot
2021-09-28 20:26 ` Doug Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).