linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bluetooth-next:master 15/15] drivers/bluetooth/btmtkuart.c:671:18: sparse: warning: incorrect type in assignment (different base types)
@ 2019-03-03  1:09 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-03-03  1:09 UTC (permalink / raw)
  To: Sean Wang; +Cc: kbuild-all, linux-bluetooth, Marcel Holtmann

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
head:   22eaf6c9946ae269061d95bb9ceee02524166474
commit: 22eaf6c9946ae269061d95bb9ceee02524166474 [15/15] Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices
reproduce:
        # apt-get install sparse
        git checkout 22eaf6c9946ae269061d95bb9ceee02524166474
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

All warnings (new ones prefixed by >>):

>> drivers/bluetooth/btmtkuart.c:671:18: sparse: warning: incorrect type in assignment (different base types)
   drivers/bluetooth/btmtkuart.c:671:18: sparse:    expected unsigned int [usertype] baudrate
   drivers/bluetooth/btmtkuart.c:671:18: sparse:    got restricted __le32 [usertype]

sparse warnings: (new ones prefixed by >>)

   drivers/bluetooth/btmtkuart.c:671:18: sparse: warning: incorrect type in assignment (different base types)
>> drivers/bluetooth/btmtkuart.c:671:18: sparse:    expected unsigned int [usertype] baudrate
>> drivers/bluetooth/btmtkuart.c:671:18: sparse:    got restricted __le32 [usertype]

vim +671 drivers/bluetooth/btmtkuart.c

   659	
   660	static int btmtkuart_change_baudrate(struct hci_dev *hdev)
   661	{
   662		struct btmtkuart_dev *bdev = hci_get_drvdata(hdev);
   663		struct btmtk_hci_wmt_params wmt_params;
   664		u32 baudrate;
   665		u8 param;
   666		int err;
   667	
   668		/* Indicate the device to enter the probe state the host is
   669		 * ready to change a new baudrate.
   670		 */
 > 671		baudrate = cpu_to_le32(bdev->desired_speed);
   672		wmt_params.op = MTK_WMT_HIF;
   673		wmt_params.flag = 1;
   674		wmt_params.dlen = 4;
   675		wmt_params.data = &baudrate;
   676		wmt_params.status = NULL;
   677	
   678		err = mtk_hci_wmt_sync(hdev, &wmt_params);
   679		if (err < 0) {
   680			bt_dev_err(hdev, "Failed to device baudrate (%d)", err);
   681			return err;
   682		}
   683	
   684		err = serdev_device_set_baudrate(bdev->serdev,
   685						 bdev->desired_speed);
   686		if (err < 0) {
   687			bt_dev_err(hdev, "Failed to set up host baudrate (%d)",
   688				   err);
   689			return err;
   690		}
   691	
   692		serdev_device_set_flow_control(bdev->serdev, false);
   693	
   694		/* Send a dummy byte 0xff to activate the new baudrate */
   695		param = 0xff;
   696		err = serdev_device_write(bdev->serdev, &param, sizeof(param),
   697					  MAX_SCHEDULE_TIMEOUT);
   698		if (err < 0 || err < sizeof(param))
   699			return err;
   700	
   701		serdev_device_wait_until_sent(bdev->serdev, 0);
   702	
   703		/* Wait some time for the device changing baudrate done */
   704		usleep_range(20000, 22000);
   705	
   706		/* Test the new baudrate */
   707		wmt_params.op = MTK_WMT_TEST;
   708		wmt_params.flag = 7;
   709		wmt_params.dlen = 0;
   710		wmt_params.data = NULL;
   711		wmt_params.status = NULL;
   712	
   713		err = mtk_hci_wmt_sync(hdev, &wmt_params);
   714		if (err < 0) {
   715			bt_dev_err(hdev, "Failed to test new baudrate (%d)",
   716				   err);
   717			return err;
   718		}
   719	
   720		bdev->curr_speed = bdev->desired_speed;
   721	
   722		return 0;
   723	}
   724	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

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

only message in thread, other threads:[~2019-03-03  1:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-03  1:09 [bluetooth-next:master 15/15] drivers/bluetooth/btmtkuart.c:671:18: sparse: warning: incorrect type in assignment (different base types) kbuild test robot

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