All of lore.kernel.org
 help / color / mirror / Atom feed
* [ti:ti-linux-5.4.y 8677/13413] net/core/sock.c:2306:14: sparse: sparse: incompatible types for 'case' statement
@ 2021-03-07 10:12 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-07 10:12 UTC (permalink / raw)
  To: kbuild-all

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

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head:   87c0425824b4169e4d697c4f6219243249a8c08b
commit: a4aead6fc0566e064448dc8363333b78f7bb1545 [8677/13413] net: socket: accept redundant network info in control message
config: sparc64-randconfig-s032-20210307 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-245-gacc5c298-dirty
        git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-linux-5.4.y
        git checkout a4aead6fc0566e064448dc8363333b78f7bb1545
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64 

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


"sparse warnings: (new ones prefixed by >>)"
   net/core/sock.c:2306:14: sparse: sparse: undefined identifier 'SCM_REDUNDANT'
>> net/core/sock.c:2306:14: sparse: sparse: incompatible types for 'case' statement
   net/core/sock.c:3051:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *from @@     got struct __kernel_old_timeval [noderef] <asn:1> * @@
   net/core/sock.c:3051:46: sparse:     expected void const *from
   net/core/sock.c:3051:46: sparse:     got struct __kernel_old_timeval [noderef] <asn:1> *
   net/core/sock.c:3102:35: sparse: sparse: undefined identifier 'SCM_REDUNDANT'
   net/core/sock.c:1910:9: sparse: sparse: context imbalance in 'sk_clone_lock' - wrong count at exit
   net/core/sock.c:1914:6: sparse: sparse: context imbalance in 'sk_free_unlock_clone' - unexpected unlock
   net/core/sock.c:2306:14: sparse: sparse: Expected constant expression in case statement

vim +/case +2306 net/core/sock.c

  2269	
  2270	int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
  2271			     struct sockcm_cookie *sockc)
  2272	{
  2273		struct skb_redundant_info *cred;
  2274		u32 tsflags;
  2275	
  2276		switch (cmsg->cmsg_type) {
  2277		case SO_MARK:
  2278			if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
  2279				return -EPERM;
  2280			if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
  2281				return -EINVAL;
  2282			sockc->mark = *(u32 *)CMSG_DATA(cmsg);
  2283			break;
  2284		case SO_TIMESTAMPING_OLD:
  2285			if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
  2286				return -EINVAL;
  2287	
  2288			tsflags = *(u32 *)CMSG_DATA(cmsg);
  2289			if (tsflags & ~SOF_TIMESTAMPING_TX_RECORD_MASK)
  2290				return -EINVAL;
  2291	
  2292			sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK;
  2293			sockc->tsflags |= tsflags;
  2294			break;
  2295		case SCM_TXTIME:
  2296			if (!sock_flag(sk, SOCK_TXTIME))
  2297				return -EINVAL;
  2298			if (cmsg->cmsg_len != CMSG_LEN(sizeof(u64)))
  2299				return -EINVAL;
  2300			sockc->transmit_time = get_unaligned((u64 *)CMSG_DATA(cmsg));
  2301			break;
  2302		/* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */
  2303		case SCM_RIGHTS:
  2304		case SCM_CREDENTIALS:
  2305			break;
> 2306		case SCM_REDUNDANT:
  2307			if (cmsg->cmsg_len !=
  2308			    CMSG_LEN(sizeof(struct skb_redundant_info)))
  2309				return -EINVAL;
  2310	
  2311			cred = (struct skb_redundant_info *)CMSG_DATA(cmsg);
  2312			memcpy(&sockc->redinfo, cred,
  2313			       sizeof(struct skb_redundant_info));
  2314			break;
  2315		default:
  2316			return -EINVAL;
  2317		}
  2318		return 0;
  2319	}
  2320	EXPORT_SYMBOL(__sock_cmsg_send);
  2321	

---
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: 25711 bytes --]

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

only message in thread, other threads:[~2021-03-07 10:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-07 10:12 [ti:ti-linux-5.4.y 8677/13413] net/core/sock.c:2306:14: sparse: sparse: incompatible types for 'case' statement 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.