All of lore.kernel.org
 help / color / mirror / Atom feed
* [chrome-os:chromeos-4.4 18/20] net/bluetooth/hci_request.c:594:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int'
@ 2020-07-30 12:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-30 12:39 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head:   431b3004b0e2d8a283a0e02a358b27d8fcd5be9b
commit: 85dc2543e66508a442470993f33346452dbe72af [18/20] FROMLIST: Bluetooth: adding configurable eir_max_name_len
config: x86_64-randconfig-a013-20200730 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6700f4b9fe6321ef704efa4890af5bc351a124f0)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 85dc2543e66508a442470993f33346452dbe72af
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>):

   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                               ^~~~~~~~~
   include/linux/compiler.h:182:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:51:
   include/linux/netdevice.h:3325:37: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
           if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
                                  ~~~~~~~~~~~ ^   ~~~~~~~~~~~~~~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:58:
   include/linux/memcontrol.h:302:2: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
           this_cpu_add(memcg->stat->events[idx], nr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:526:33: note: expanded from macro 'this_cpu_add'
   #define this_cpu_add(pcp, val)          __pcpu_size_call(this_cpu_add_, pcp, val)
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:397:11: note: expanded from macro '__pcpu_size_call'
                   case 8: stem##8(variable, __VA_ARGS__);break;           \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   <scratch space>:13:1: note: expanded from here
   this_cpu_add_8
   ^
   arch/x86/include/asm/percpu.h:478:35: note: expanded from macro 'this_cpu_add_8'
   #define this_cpu_add_8(pcp, val)                percpu_add_op((pcp), val)
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/percpu.h:130:31: note: expanded from macro 'percpu_add_op'
                                 ((val) == 1 || (val) == -1)) ?            \
                                                 ~~~  ^  ~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:63:
   In file included from include/linux/filter.h:16:
   In file included from include/net/sch_generic.h:12:
   In file included from include/net/rtnetlink.h:5:
   include/net/netlink.h:345:18: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
                   nlh->nlmsg_len <= remaining);
                   ~~~~~~~~~~~~~~ ^  ~~~~~~~~~
   include/net/netlink.h:380:21: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
           if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
               ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
   include/net/netlink.h:413:21: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
           if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
               ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:63:
   In file included from include/linux/filter.h:16:
   In file included from include/net/sch_generic.h:12:
   include/net/rtnetlink.h:20:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
           if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
               ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:63:
   In file included from include/linux/filter.h:16:
   include/net/sch_generic.h:267:33: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
           BUILD_BUG_ON(sizeof(qcb->data) < sz);
                        ~~~~~~~~~~~~~~~~~ ^ ~~
   include/linux/build_bug.h:71:19: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
                            ^~~~~~~~~
   include/linux/build_bug.h:47:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                                            ^~~~
   include/linux/compiler.h:509:22: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                               ^~~~~~~~~
   include/linux/compiler.h:497:23: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
                                ^~~~~~~~~
   include/linux/compiler.h:489:19: note: expanded from macro '__compiletime_assert'
                   bool __cond = !(condition);                             \
                                   ^~~~~~~~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   In file included from include/net/sock.h:63:
   include/linux/filter.h:517:16: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
                   if (first->k == SKF_AD_OFF + SKF_AD_ALU_XOR_X)
                       ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/bluetooth/hci_request.c:24:
   In file included from include/net/bluetooth/bluetooth.h:29:
   include/net/sock.h:1878:54: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                   if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
   include/net/sock.h:1882:46: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                   if (copy_from_iter_nocache(to, copy, from) != copy)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
   include/net/sock.h:1884:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
           } else if (copy_from_iter(to, copy, from) != copy)
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
   net/bluetooth/hci_request.c:505:34: warning: comparison of integers of different signs: 'unsigned long' and 'ptrdiff_t' (aka 'long') [-Wsign-compare]
                   if ((ptr - data) + sizeof(u16) > len) {
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
   net/bluetooth/hci_request.c:538:34: warning: comparison of integers of different signs: 'unsigned long' and 'ptrdiff_t' (aka 'long') [-Wsign-compare]
                   if ((ptr - data) + sizeof(u32) > len) {
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
>> net/bluetooth/hci_request.c:594:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                   if (name_len > min_t(u16, (HCI_MAX_EIR_LENGTH - 2),
                       ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 warnings generated.

vim +594 net/bluetooth/hci_request.c

   583	
   584	static void create_eir(struct hci_dev *hdev, u8 *data)
   585	{
   586		u8 *ptr = data;
   587		u8 size_remaining = HCI_MAX_EIR_LENGTH;
   588		size_t name_len;
   589	
   590		name_len = strlen(hdev->dev_name);
   591	
   592		if (name_len > 0) {
   593			/* EIR Data type */
 > 594			if (name_len > min_t(u16, (HCI_MAX_EIR_LENGTH - 2),
   595					     hdev->eir_max_name_len)) {
   596				name_len = min_t(u16, (HCI_MAX_EIR_LENGTH - 2),
   597						 hdev->eir_max_name_len);
   598				ptr[1] = EIR_NAME_SHORT;
   599			} else {
   600				ptr[1] = EIR_NAME_COMPLETE;
   601			}
   602	
   603			/* EIR Data length */
   604			ptr[0] = name_len + 1;
   605	
   606			memcpy(ptr + 2, hdev->dev_name, name_len);
   607	
   608			ptr += (name_len + 2);
   609			size_remaining -= (name_len + 2);
   610		}
   611	
   612		if (hdev->inq_tx_power != HCI_TX_POWER_INVALID &&
   613		    size_remaining >= 3) {
   614			ptr[0] = 2;
   615			ptr[1] = EIR_TX_POWER;
   616			ptr[2] = (u8) hdev->inq_tx_power;
   617	
   618			ptr += 3;
   619			size_remaining -= 3;
   620		}
   621	
   622		if (hdev->devid_source > 0 &&
   623		    size_remaining >= 10) {
   624			ptr[0] = 9;
   625			ptr[1] = EIR_DEVICE_ID;
   626	
   627			put_unaligned_le16(hdev->devid_source, ptr + 2);
   628			put_unaligned_le16(hdev->devid_vendor, ptr + 4);
   629			put_unaligned_le16(hdev->devid_product, ptr + 6);
   630			put_unaligned_le16(hdev->devid_version, ptr + 8);
   631	
   632			ptr += 10;
   633			size_remaining -= 10;
   634		}
   635	
   636		ptr = create_uuid16_list(hdev, ptr, size_remaining);
   637		size_remaining = HCI_MAX_EIR_LENGTH - (ptr - data);
   638	
   639		ptr = create_uuid32_list(hdev, ptr, size_remaining);
   640		size_remaining = HCI_MAX_EIR_LENGTH - (ptr - data);
   641	
   642		ptr = create_uuid128_list(hdev, ptr, size_remaining);
   643	}
   644	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26017 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-30 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 12:39 [chrome-os:chromeos-4.4 18/20] net/bluetooth/hci_request.c:594:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' kernel test robot

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.