tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git j1939-individual head: 320c16c728d8cee622305b98d438e0b67bd949e2 commit: 0891f994b5fa243fc262cc3e82d61875918e4e27 [92/460] can-j1939: deal with timestamps equally to can_raw config: arm64-allyesconfig (attached as .config) compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 0891f994b5fa243fc262cc3e82d61875918e4e27 # save the attached .config to linux build tree GCC_VERSION=7.2.0 make.cross ARCH=arm64 Note: the mkl-can-next/j1939-individual HEAD 320c16c728d8cee622305b98d438e0b67bd949e2 builds fine. It only hurts bisectibility. All error/warnings (new ones prefixed by >>): In file included from net/can/j1939/socket.c:24:0: net/can/j1939/j1939-priv.h: In function 'dev_j1939_priv': net/can/j1939/j1939-priv.h:271:34: error: dereferencing pointer to incomplete type 'struct dev_rcv_lists' priv = can_ml_priv ? can_ml_priv->j1939_priv : NULL; ^~ net/can/j1939/socket.c: In function 'j1939sk_sendmsg': >> net/can/j1939/socket.c:707:24: warning: passing argument 2 of 'sock_tx_timestamp' makes integer from pointer without a cast [-Wint-conversion] sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags); ^ In file included from include/linux/can/skb.h:17:0, from net/can/j1939/socket.c:22: include/net/sock.h:2346:20: note: expected '__u16 {aka short unsigned int}' but argument is of type '__u8 * {aka unsigned char *}' static inline void sock_tx_timestamp(const struct sock *sk, __u16 tsflags, ^~~~~~~~~~~~~~~~~ >> net/can/j1939/socket.c:707:2: error: too few arguments to function 'sock_tx_timestamp' sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags); ^~~~~~~~~~~~~~~~~ In file included from include/linux/can/skb.h:17:0, from net/can/j1939/socket.c:22: include/net/sock.h:2346:20: note: declared here static inline void sock_tx_timestamp(const struct sock *sk, __u16 tsflags, ^~~~~~~~~~~~~~~~~ net/can/j1939/socket.c: At top level: net/can/j1939/socket.c:789:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .getname = j1939sk_getname, ^~~~~~~~~~~~~~~ net/can/j1939/socket.c:789:13: note: (near initialization for 'j1939_ops.getname') cc1: some warnings being treated as errors vim +/sock_tx_timestamp +707 net/can/j1939/socket.c 657 658 static int j1939sk_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) 659 { 660 struct sock *sk = sock->sk; 661 struct j1939_sock *jsk = j1939_sk(sk); 662 struct sockaddr_can *addr = msg->msg_name; 663 struct j1939_sk_buff_cb *skcb; 664 struct sk_buff *skb; 665 struct net_device *dev; 666 int ifindex; 667 int ret; 668 669 /* various socket state tests */ 670 if (!(jsk->state & JSK_BOUND)) 671 return -EBADFD; 672 673 ifindex = jsk->ifindex_started; 674 if (!ifindex) 675 return -EBADFD; 676 677 if (jsk->addr.sa == J1939_NO_ADDR && !jsk->addr.src) 678 /* no address assigned yet */ 679 return -EBADFD; 680 681 /* deal with provided address info */ 682 if (msg->msg_name) { 683 if (msg->msg_namelen < J1939_MIN_NAMELEN) 684 return -EINVAL; 685 if (addr->can_family != AF_CAN) 686 return -EINVAL; 687 if (addr->can_ifindex && (ifindex != addr->can_ifindex)) 688 return -EBADFD; 689 } 690 691 dev = dev_get_by_index(&init_net, ifindex); 692 if (!dev) 693 return -ENXIO; 694 695 skb = sock_alloc_send_skb(sk, size + sizeof(struct can_frame) - sizeof(((struct can_frame*)NULL)->data) + sizeof(struct can_skb_priv), 696 msg->msg_flags & MSG_DONTWAIT, &ret); 697 if (!skb) 698 goto put_dev; 699 700 can_skb_reserve(skb); 701 can_skb_prv(skb)->ifindex = dev->ifindex; 702 skb_reserve(skb, offsetof(struct can_frame, data)); 703 704 ret = memcpy_from_msg(skb_put(skb, size), msg, size); 705 if (ret < 0) 706 goto free_skb; > 707 sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags); 708 709 skb->dev = dev; 710 711 skcb = (void *)skb->cb; 712 memset(skcb, 0, sizeof(*skcb)); 713 skcb->msg_flags = msg->msg_flags; 714 skcb->srcname = jsk->addr.src; 715 skcb->dstname = jsk->addr.dst; 716 skcb->pgn = jsk->addr.pgn; 717 skcb->priority = j1939_prio(jsk->sk.sk_priority); 718 skcb->srcaddr = jsk->addr.sa; 719 skcb->dstaddr = jsk->addr.da; 720 721 if (msg->msg_name) { 722 struct sockaddr_can *addr = msg->msg_name; 723 724 if (addr->can_addr.j1939.name || 725 (addr->can_addr.j1939.addr != J1939_NO_ADDR)) { 726 skcb->dstname = addr->can_addr.j1939.name; 727 skcb->dstaddr = addr->can_addr.j1939.addr; 728 } 729 if (pgn_is_valid(addr->can_addr.j1939.pgn)) 730 skcb->pgn = addr->can_addr.j1939.pgn; 731 } 732 if (!pgn_is_valid(skcb->pgn)) { 733 ret = -EINVAL; 734 goto free_skb; 735 } 736 737 if (skcb->msg_flags & J1939_MSG_SYNC) { 738 if (skcb->msg_flags & MSG_DONTWAIT) { 739 ret = j1939_sock_pending_add_first(&jsk->sk); 740 if (ret > 0) 741 ret = -EAGAIN; 742 } else { 743 ret = wait_event_interruptible(jsk->waitq, 744 j1939_sock_pending_add_first(&jsk->sk)); 745 } 746 if (ret < 0) 747 goto free_skb; 748 } else { 749 j1939_sock_pending_add(&jsk->sk); 750 } 751 752 ret = j1939_send(skb); 753 if (ret < 0) 754 j1939_sock_pending_del(&jsk->sk); 755 756 dev_put(dev); 757 return (ret < 0) ? ret : size; 758 759 free_skb: 760 kfree_skb(skb); 761 put_dev: 762 dev_put(dev); 763 return ret; 764 } 765 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip