Re: [PATCH] Bluetooth: hci_core: Fix missing instances using HCI_MAX_AD_LENGTH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

kernel test robot noticed the following build errors:

[auto build test ERROR on linux-next/master]
[also build test ERROR on linus/master v6.5-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-hci_core-Fix-missing-instances-using-HCI_MAX_AD_LENGTH/20230821-102220
base:   linux-next/master
patch link:    https://lore.kernel.org/r/20230818212211.3207580-1-luiz.dentz%40gmail.com
patch subject: [PATCH] Bluetooth: hci_core: Fix missing instances using HCI_MAX_AD_LENGTH
config: i386-buildonly-randconfig-002-20230821 (https://download.01.org/0day-ci/archive/20230821/202308212004.EXsdDWkd-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230821/202308212004.EXsdDWkd-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308212004.EXsdDWkd-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> net/bluetooth/eir.c:36:19: error: use of undeclared identifier 'dev'; did you mean 'hdev'?
           if ((max_adv_len(dev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
                            ^~~
                            hdev
   include/net/bluetooth/hci_core.h:1854:19: note: expanded from macro 'max_adv_len'
           (ext_adv_capable(dev) ? HCI_MAX_EXT_AD_LENGTH : HCI_MAX_AD_LENGTH)
                            ^
   include/net/bluetooth/hci_core.h:1850:33: note: expanded from macro 'ext_adv_capable'
   #define ext_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))
                                   ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^
   include/linux/compiler.h:57:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^
   net/bluetooth/eir.c:30:42: note: 'hdev' declared here
   u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len)
                                            ^
>> net/bluetooth/eir.c:36:19: error: use of undeclared identifier 'dev'; did you mean 'hdev'?
           if ((max_adv_len(dev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
                            ^~~
                            hdev
   include/net/bluetooth/hci_core.h:1854:19: note: expanded from macro 'max_adv_len'
           (ext_adv_capable(dev) ? HCI_MAX_EXT_AD_LENGTH : HCI_MAX_AD_LENGTH)
                            ^
   include/net/bluetooth/hci_core.h:1850:33: note: expanded from macro 'ext_adv_capable'
   #define ext_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))
                                   ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^
   include/linux/compiler.h:57:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^
   net/bluetooth/eir.c:30:42: note: 'hdev' declared here
   u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len)
                                            ^
>> net/bluetooth/eir.c:36:19: error: use of undeclared identifier 'dev'; did you mean 'hdev'?
           if ((max_adv_len(dev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
                            ^~~
                            hdev
   include/net/bluetooth/hci_core.h:1854:19: note: expanded from macro 'max_adv_len'
           (ext_adv_capable(dev) ? HCI_MAX_EXT_AD_LENGTH : HCI_MAX_AD_LENGTH)
                            ^
   include/net/bluetooth/hci_core.h:1850:33: note: expanded from macro 'ext_adv_capable'
   #define ext_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))
                                   ^
   include/linux/compiler.h:55:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^
   include/linux/compiler.h:57:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                                        ^
   include/linux/compiler.h:68:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^
   net/bluetooth/eir.c:30:42: note: 'hdev' declared here
   u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len)
                                            ^
   3 errors generated.


vim +36 net/bluetooth/eir.c

    29	
    30	u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len)
    31	{
    32		size_t short_len;
    33		size_t complete_len;
    34	
    35		/* no space left for name (+ NULL + type + len) */
  > 36		if ((max_adv_len(dev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
    37			return ad_len;
    38	
    39		/* use complete name if present and fits */
    40		complete_len = strnlen(hdev->dev_name, sizeof(hdev->dev_name));
    41		if (complete_len && complete_len <= HCI_MAX_SHORT_NAME_LENGTH)
    42			return eir_append_name(ptr, ad_len, EIR_NAME_COMPLETE,
    43					       hdev->dev_name, complete_len + 1);
    44	
    45		/* use short name if present */
    46		short_len = strnlen(hdev->short_name, sizeof(hdev->short_name));
    47		if (short_len)
    48			return eir_append_name(ptr, ad_len, EIR_NAME_SHORT,
    49					       hdev->short_name,
    50					       short_len == HCI_MAX_SHORT_NAME_LENGTH ?
    51					       short_len : short_len + 1);
    52	
    53		/* use shortened full name if present, we already know that name
    54		 * is longer then HCI_MAX_SHORT_NAME_LENGTH
    55		 */
    56		if (complete_len)
    57			return eir_append_name(ptr, ad_len, EIR_NAME_SHORT,
    58					       hdev->dev_name,
    59					       HCI_MAX_SHORT_NAME_LENGTH);
    60	
    61		return ad_len;
    62	}
    63	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux