Re: [PATCH v5] sco:Add support for BT_PKT_STATUS CMSG data

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

 



Hi Alain,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20200611]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alain-Michaud/sco-Add-support-for-BT_PKT_STATUS-CMSG-data/20200611-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All error/warnings (new ones prefixed by >>, old ones prefixed by <<):

net/bluetooth/sco.c: In function 'sco_skb_put_cmsg':
net/bluetooth/sco.c:456:36: error: passing argument 2 of 'test_bit' from incompatible pointer type [-Werror=incompatible-pointer-types]
456 |  if (test_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask))
|                                    ^~~~~~~~~~~~~~~~~~~~~~
|                                    |
|                                    __u8 * {aka unsigned char *}
In file included from arch/arm/include/asm/bitops.h:123,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/bluetooth/sco.c:27:
include/asm-generic/bitops/non-atomic.h:104:66: note: expected 'const volatile long unsigned int *' but argument is of type '__u8 *' {aka 'unsigned char *'}
104 | static inline int test_bit(int nr, const volatile unsigned long *addr)
|                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/bluetooth/sco.c:27:
net/bluetooth/sco.c: In function 'sco_sock_setsockopt':
>> net/bluetooth/sco.c:868:33: error: passing argument 2 of '_set_bit' from incompatible pointer type [-Werror=incompatible-pointer-types]
868 |    set_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
|                                 ^~~~~~~~~~~~~~~~~~~~~~
|                                 |
|                                 __u8 * {aka unsigned char *}
arch/arm/include/asm/bitops.h:183:45: note: in definition of macro 'ATOMIC_BITOP'
183 | #define ATOMIC_BITOP(name,nr,p)  _##name(nr,p)
|                                             ^
>> net/bluetooth/sco.c:868:4: note: in expansion of macro 'set_bit'
868 |    set_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
|    ^~~~~~~
arch/arm/include/asm/bitops.h:153:55: note: expected 'volatile long unsigned int *' but argument is of type '__u8 *' {aka 'unsigned char *'}
153 | extern void _set_bit(int nr, volatile unsigned long * p);
|                              ~~~~~~~~~~~~~~~~~~~~~~~~~^
>> net/bluetooth/sco.c:870:35: error: passing argument 2 of '_clear_bit' from incompatible pointer type [-Werror=incompatible-pointer-types]
870 |    clear_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
|                                   ^~~~~~~~~~~~~~~~~~~~~~
|                                   |
|                                   __u8 * {aka unsigned char *}
arch/arm/include/asm/bitops.h:183:45: note: in definition of macro 'ATOMIC_BITOP'
183 | #define ATOMIC_BITOP(name,nr,p)  _##name(nr,p)
|                                             ^
>> net/bluetooth/sco.c:870:4: note: in expansion of macro 'clear_bit'
870 |    clear_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
|    ^~~~~~~~~
arch/arm/include/asm/bitops.h:154:57: note: expected 'volatile long unsigned int *' but argument is of type '__u8 *' {aka 'unsigned char *'}
154 | extern void _clear_bit(int nr, volatile unsigned long * p);
|                                ~~~~~~~~~~~~~~~~~~~~~~~~~^
net/bluetooth/sco.c: In function 'sco_sock_getsockopt':
net/bluetooth/sco.c:999:11: error: passing argument 2 of 'test_bit' from incompatible pointer type [-Werror=incompatible-pointer-types]
999 |           &(sco_pi(sk)->cmsg_mask));
|           ^~~~~~~~~~~~~~~~~~~~~~~~
|           |
|           __u8 * {aka unsigned char *}
In file included from arch/arm/include/asm/bitops.h:123,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from net/bluetooth/sco.c:27:
include/asm-generic/bitops/non-atomic.h:104:66: note: expected 'const volatile long unsigned int *' but argument is of type '__u8 *' {aka 'unsigned char *'}
104 | static inline int test_bit(int nr, const volatile unsigned long *addr)
|                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors

vim +/_set_bit +868 net/bluetooth/sco.c

   804	
   805	static int sco_sock_setsockopt(struct socket *sock, int level, int optname,
   806				       char __user *optval, unsigned int optlen)
   807	{
   808		struct sock *sk = sock->sk;
   809		int len, err = 0;
   810		struct bt_voice voice;
   811		u32 opt;
   812	
   813		BT_DBG("sk %p", sk);
   814	
   815		lock_sock(sk);
   816	
   817		switch (optname) {
   818	
   819		case BT_DEFER_SETUP:
   820			if (sk->sk_state != BT_BOUND && sk->sk_state != BT_LISTEN) {
   821				err = -EINVAL;
   822				break;
   823			}
   824	
   825			if (get_user(opt, (u32 __user *) optval)) {
   826				err = -EFAULT;
   827				break;
   828			}
   829	
   830			if (opt)
   831				set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
   832			else
   833				clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
   834			break;
   835	
   836		case BT_VOICE:
   837			if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND &&
   838			    sk->sk_state != BT_CONNECT2) {
   839				err = -EINVAL;
   840				break;
   841			}
   842	
   843			voice.setting = sco_pi(sk)->setting;
   844	
   845			len = min_t(unsigned int, sizeof(voice), optlen);
   846			if (copy_from_user((char *)&voice, optval, len)) {
   847				err = -EFAULT;
   848				break;
   849			}
   850	
   851			/* Explicitly check for these values */
   852			if (voice.setting != BT_VOICE_TRANSPARENT &&
   853			    voice.setting != BT_VOICE_CVSD_16BIT) {
   854				err = -EINVAL;
   855				break;
   856			}
   857	
   858			sco_pi(sk)->setting = voice.setting;
   859			break;
   860	
   861		case BT_PKT_STATUS:
   862			if (get_user(opt, (u32 __user *)optval)) {
   863				err = -EFAULT;
   864				break;
   865			}
   866	
   867			if (opt)
 > 868				set_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
   869			else
 > 870				clear_bit(SCO_CMSG_PKT_STATUS, &sco_pi(sk)->cmsg_mask);
   871			break;
   872	
   873		default:
   874			err = -ENOPROTOOPT;
   875			break;
   876		}
   877	
   878		release_sock(sk);
   879		return err;
   880	}
   881	

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