[bluetooth-next:master 5/14] net/bluetooth/mgmt.c:3932:9: sparse: sparse: cast to restricted __le32

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
head:   46605a271114f1243c807a55c607271c81e662d2
commit: 4c54bf2b093bb2ae95e756342646d868e8101cb4 [5/14] Bluetooth: Add get/set device flags mgmt op
config: c6x-randconfig-s032-20200618 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-rc1-10-gc17b1b06-dirty
        git checkout 4c54bf2b093bb2ae95e756342646d868e8101cb4
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=c6x CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   net/bluetooth/mgmt.c:3605:29: sparse: sparse: restricted __le16 degrades to integer
>> net/bluetooth/mgmt.c:3932:9: sparse: sparse: cast to restricted __le32

vim +3932 net/bluetooth/mgmt.c

  3921	
  3922	static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
  3923				    u16 len)
  3924	{
  3925		struct mgmt_cp_set_device_flags *cp = data;
  3926		struct bdaddr_list_with_flags *br_params;
  3927		struct hci_conn_params *params;
  3928		u8 status = MGMT_STATUS_INVALID_PARAMS;
  3929		u32 supported_flags = SUPPORTED_DEVICE_FLAGS();
  3930		u32 current_flags = __le32_to_cpu(cp->current_flags);
  3931	
> 3932		bt_dev_dbg(hdev, "Set device flags %pMR (type 0x%x) = 0x%x",
  3933			   &cp->addr.bdaddr, cp->addr.type,
  3934			   __le32_to_cpu(current_flags));
  3935	
  3936		if ((supported_flags | current_flags) != supported_flags) {
  3937			bt_dev_warn(hdev, "Bad flag given (0x%x) vs supported (0x%0x)",
  3938				    current_flags, supported_flags);
  3939			goto done;
  3940		}
  3941	
  3942		if (cp->addr.type == BDADDR_BREDR) {
  3943			br_params = hci_bdaddr_list_lookup_with_flags(&hdev->whitelist,
  3944								      &cp->addr.bdaddr,
  3945								      cp->addr.type);
  3946	
  3947			if (br_params) {
  3948				br_params->current_flags = current_flags;
  3949				status = MGMT_STATUS_SUCCESS;
  3950			} else {
  3951				bt_dev_warn(hdev, "No such BR/EDR device %pMR (0x%x)",
  3952					    &cp->addr.bdaddr, cp->addr.type);
  3953			}
  3954		} else {
  3955			params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr,
  3956							le_addr_type(cp->addr.type));
  3957			if (params) {
  3958				params->current_flags = current_flags;
  3959				status = MGMT_STATUS_SUCCESS;
  3960			} else {
  3961				bt_dev_warn(hdev, "No such LE device %pMR (0x%x)",
  3962					    &cp->addr.bdaddr,
  3963					    le_addr_type(cp->addr.type));
  3964			}
  3965		}
  3966	
  3967	done:
  3968		if (status == MGMT_STATUS_SUCCESS)
  3969			device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type,
  3970					     supported_flags, current_flags);
  3971	
  3972		return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_FLAGS, status,
  3973					 &cp->addr, sizeof(cp->addr));
  3974	}
  3975	

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

Attachment: .config.gz
Description: application/gzip


[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