tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git j1939-individual head: 1fa5c10774a17e880f5d79f42f30e8fbf25bcb62 commit: 2cb79a80ae4382efb7225e221379be35268d9b43 [19/561] can-j1939: Import SAE J1939 config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 8.1.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 2cb79a80ae4382efb7225e221379be35268d9b43 # save the attached .config to linux build tree GCC_VERSION=8.1.0 make.cross ARCH=xtensa If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@xxxxxxxxx> Note: the mkl-can-next/j1939-individual HEAD 1fa5c10774a17e880f5d79f42f30e8fbf25bcb62 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): In file included from net/can/j1939/socket.c:23: net/can/j1939/j1939-priv.h:181:3: error: unknown type name 'write_proc_t'; did you mean 'writepage_t'? write_proc_t write); ^~~~~~~~~~~~ writepage_t net/can/j1939/socket.c: In function 'j1939sk_recvmsg': net/can/j1939/socket.c:685:8: error: implicit declaration of function 'memcpy_toiovec'; did you mean 'memcpy_toio'? [-Werror=implicit-function-declaration] ret = memcpy_toiovec(msg->msg_iov, skb->data, size); ^~~~~~~~~~~~~~ memcpy_toio net/can/j1939/socket.c:685:28: error: 'struct msghdr' has no member named 'msg_iov'; did you mean 'msg_iocb'? ret = memcpy_toiovec(msg->msg_iov, skb->data, size); ^~~~~~~ msg_iocb net/can/j1939/socket.c: In function 'j1939sk_sendmsg': net/can/j1939/socket.c:779:8: error: implicit declaration of function 'memcpy_fromiovec'; did you mean 'memcpy_fromio'? [-Werror=implicit-function-declaration] ret = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); ^~~~~~~~~~~~~~~~ memcpy_fromio net/can/j1939/socket.c:779:50: error: 'struct msghdr' has no member named 'msg_iov'; did you mean 'msg_iocb'? ret = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); ^~~~~~~ msg_iocb net/can/j1939/socket.c: At top level: >> net/can/j1939/socket.c:915:13: error: initialization of 'int (*)(struct socket *, struct sockaddr *, int)' from incompatible pointer type 'int (*)(struct socket *, struct sockaddr *, int *, int)' [-Werror=incompatible-pointer-types] .getname = j1939sk_getname, ^~~~~~~~~~~~~~~ net/can/j1939/socket.c:915:13: note: (near initialization for 'j1939_ops.getname') net/can/j1939/socket.c:922:13: error: initialization of 'int (*)(struct socket *, struct msghdr *, size_t)' {aka 'int (*)(struct socket *, struct msghdr *, unsigned int)'} from incompatible pointer type 'int (*)(struct kiocb *, struct socket *, struct msghdr *, size_t)' {aka 'int (*)(struct kiocb *, struct socket *, struct msghdr *, unsigned int)'} [-Werror=incompatible-pointer-types] .sendmsg = j1939sk_sendmsg, ^~~~~~~~~~~~~~~ net/can/j1939/socket.c:922:13: note: (near initialization for 'j1939_ops.sendmsg') net/can/j1939/socket.c:923:13: error: initialization of 'int (*)(struct socket *, struct msghdr *, size_t, int)' {aka 'int (*)(struct socket *, struct msghdr *, unsigned int, int)'} from incompatible pointer type 'int (*)(struct kiocb *, struct socket *, struct msghdr *, size_t, int)' {aka 'int (*)(struct kiocb *, struct socket *, struct msghdr *, unsigned int, int)'} [-Werror=incompatible-pointer-types] .recvmsg = j1939sk_recvmsg, ^~~~~~~~~~~~~~~ net/can/j1939/socket.c:923:13: note: (near initialization for 'j1939_ops.recvmsg') net/can/j1939/socket.c:942:19: error: initialization of 'int (*)(struct sk_buff *, struct nlmsghdr *, struct netlink_ext_ack *)' from incompatible pointer type 'int (*)(struct sk_buff *, struct nlmsghdr *, void *)' [-Werror=incompatible-pointer-types] .rtnl_new_addr = j1939rtnl_new_addr, ^~~~~~~~~~~~~~~~~~ net/can/j1939/socket.c:942:19: note: (near initialization for 'j1939_can_proto.rtnl_new_addr') net/can/j1939/socket.c:943:19: error: initialization of 'int (*)(struct sk_buff *, struct nlmsghdr *, struct netlink_ext_ack *)' from incompatible pointer type 'int (*)(struct sk_buff *, struct nlmsghdr *, void *)' [-Werror=incompatible-pointer-types] .rtnl_del_addr = j1939rtnl_del_addr, ^~~~~~~~~~~~~~~~~~ net/can/j1939/socket.c:943:19: note: (near initialization for 'j1939_can_proto.rtnl_del_addr') net/can/j1939/socket.c: In function 'j1939sk_module_init': net/can/j1939/socket.c:958:3: error: implicit declaration of function 'j1939_proc_add'; did you mean 'j1939_recv_add'? [-Werror=implicit-function-declaration] j1939_proc_add("sock", j1939sk_proc_show, NULL); ^~~~~~~~~~~~~~ j1939_recv_add cc1: some warnings being treated as errors vim +915 net/can/j1939/socket.c 723 724 static int j1939sk_sendmsg(struct kiocb *iocb, struct socket *sock, 725 struct msghdr *msg, size_t size) 726 { 727 struct sock *sk = sock->sk; 728 struct j1939_sock *jsk = j1939_sk(sk); 729 struct j1939_sk_buff_cb *skb_cb; 730 struct sk_buff *skb; 731 struct net_device *dev; 732 struct j1939_ecu *ecu; 733 int ifindex; 734 int ret; 735 736 if (!(jsk->state | JSK_BOUND)) 737 return -ENOTCONN; 738 739 if (msg->msg_name && (msg->msg_namelen < 740 required_size(can_addr.j1939, struct sockaddr_can))) 741 return -EINVAL; 742 743 ifindex = jsk->sk.sk_bound_dev_if; 744 if (msg->msg_name) { 745 struct sockaddr_can *addr = msg->msg_name; 746 if (msg->msg_namelen < required_size(can_addr.j1939, *addr)) 747 return -EFAULT; 748 if (addr->can_family != AF_CAN) 749 return -EINVAL; 750 if (ifindex && addr->can_ifindex && 751 (ifindex != addr->can_ifindex)) 752 return -ENONET; 753 if (!ifindex) 754 /* take destination intf when intf not yet set */ 755 ifindex = addr->can_ifindex; 756 } 757 758 if (!ifindex) 759 return -EDESTADDRREQ; 760 if (j1939_no_address(&jsk->sk)) { 761 lock_sock(&jsk->sk); 762 ecu = j1939_ecu_find_segment_default_tx( 763 jsk->sk.sk_bound_dev_if, 764 &jsk->addr.src, &jsk->addr.sa); 765 release_sock(&jsk->sk); 766 if (IS_ERR(ecu)) 767 return PTR_ERR(ecu); 768 } 769 770 dev = dev_get_by_index(&init_net, ifindex); 771 if (!dev) 772 return -ENXIO; 773 774 skb = sock_alloc_send_skb(sk, size, 775 msg->msg_flags & MSG_DONTWAIT, &ret); 776 if (!skb) 777 goto put_dev; 778 > 779 ret = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); 780 if (ret < 0) 781 goto free_skb; 782 skb->dev = dev; 783 skb->sk = sk; 784 785 BUILD_BUG_ON(sizeof(skb->cb) < sizeof(*skb_cb)); 786 787 skb_cb = (void *) skb->cb; 788 memset(skb_cb, 0, sizeof(*skb_cb)); 789 skb_cb->msg_flags = msg->msg_flags; 790 skb_cb->ifindex = ifindex; 791 skb_cb->src.name = jsk->addr.src; 792 skb_cb->dst.name = jsk->addr.dst; 793 skb_cb->pgn = jsk->addr.pgn; 794 skb_cb->priority = j1939_prio(jsk->sk.sk_priority); 795 skb_cb->src.addr = jsk->addr.sa; 796 skb_cb->dst.addr = jsk->addr.da; 797 798 if (msg->msg_name) { 799 struct sockaddr_can *addr = msg->msg_name; 800 if (addr->can_addr.j1939.name) { 801 ecu = j1939_ecu_find_by_name(addr->can_addr.j1939.name, 802 ifindex); 803 if (!ecu) 804 return -EADDRNOTAVAIL; 805 skb_cb->dst.name = ecu->name; 806 skb_cb->dst.addr = ecu->sa; 807 put_j1939_ecu(ecu); 808 } else { 809 skb_cb->dst.name = 0; 810 skb_cb->dst.addr = addr->can_addr.j1939.addr; 811 } 812 if (pgn_is_valid(addr->can_addr.j1939.pgn)) 813 skb_cb->pgn = addr->can_addr.j1939.pgn; 814 } 815 816 if (skb_cb->msg_flags & J1939_MSG_SYNC) { 817 if (skb_cb->msg_flags & MSG_DONTWAIT) { 818 ret = j1939_sock_pending_add_first(&jsk->sk); 819 if (ret > 0) 820 ret = -EAGAIN; 821 } else { 822 ret = wait_event_interruptible(jsk->waitq, 823 j1939_sock_pending_add_first(&jsk->sk)); 824 } 825 if (ret < 0) 826 goto free_skb; 827 } else { 828 j1939_sock_pending_add(&jsk->sk); 829 } 830 831 ret = j1939_send(skb, j1939_level_sky); 832 if (ret < 0) 833 goto decrement_pending; 834 835 dev_put(dev); 836 return size; 837 838 decrement_pending: 839 j1939_sock_pending_del(&jsk->sk); 840 free_skb: 841 kfree_skb(skb); 842 put_dev: 843 dev_put(dev); 844 return ret; 845 } 846 847 /* PROC */ 848 static int j1939sk_proc_show(struct seq_file *sqf, void *v) 849 { 850 struct j1939_sock *jsk; 851 struct net_device *netdev; 852 853 seq_printf(sqf, "iface\tflags\tlocal\tremote\tpgn\tprio\tpending\n"); 854 mutex_lock(&s.lock); 855 list_for_each_entry(jsk, &s.socks, list) { 856 lock_sock(&jsk->sk); 857 netdev = NULL; 858 if (jsk->sk.sk_bound_dev_if) 859 netdev = dev_get_by_index(&init_net, 860 jsk->sk.sk_bound_dev_if); 861 seq_printf(sqf, "%s\t", netdev ? netdev->name : "-"); 862 if (netdev) 863 dev_put(netdev); 864 seq_printf(sqf, "%c%c%c%c\t", 865 (jsk->state & JSK_BOUND) ? 'b' : '-', 866 (jsk->state & JSK_CONNECTED) ? 'c' : '-', 867 (jsk->state & PROMISC) ? 'P' : '-', 868 (jsk->state & RECV_OWN) ? 'o' : '-'); 869 if (jsk->addr.src) 870 seq_printf(sqf, "%016llx", (long long)jsk->addr.src); 871 else if (j1939_address_is_unicast(jsk->addr.sa)) 872 seq_printf(sqf, "%02x", jsk->addr.sa); 873 else 874 seq_printf(sqf, "-"); 875 seq_printf(sqf, "\t"); 876 if (jsk->addr.dst) 877 seq_printf(sqf, "%016llx", (long long)jsk->addr.dst); 878 else if (j1939_address_is_unicast(jsk->addr.da)) 879 seq_printf(sqf, "%02x", jsk->addr.da); 880 else 881 seq_printf(sqf, "-"); 882 seq_printf(sqf, "\t%05x", jsk->addr.pgn); 883 seq_printf(sqf, "\t%u", j1939_prio(jsk->sk.sk_priority)); 884 seq_printf(sqf, "\t%u", jsk->skb_pending); 885 release_sock(&jsk->sk); 886 seq_printf(sqf, "\n"); 887 } 888 mutex_unlock(&s.lock); 889 return 0; 890 } 891 892 void j1939sk_netdev_event(int ifindex, int error_code) 893 { 894 struct j1939_sock *jsk; 895 896 mutex_lock(&s.lock); 897 list_for_each_entry(jsk, &s.socks, list) { 898 if (jsk->sk.sk_bound_dev_if != ifindex) 899 continue; 900 jsk->sk.sk_err = error_code; 901 if (!sock_flag(&jsk->sk, SOCK_DEAD)) 902 jsk->sk.sk_error_report(&jsk->sk); 903 /* do not remove filters here */ 904 } 905 mutex_unlock(&s.lock); 906 } 907 908 static const struct proto_ops j1939_ops = { 909 .family = PF_CAN, 910 .release = j1939sk_release, 911 .bind = j1939sk_bind, 912 .connect = j1939sk_connect, 913 .socketpair = sock_no_socketpair, 914 .accept = sock_no_accept, > 915 .getname = j1939sk_getname, 916 .poll = datagram_poll, 917 .ioctl = can_ioctl, 918 .listen = sock_no_listen, 919 .shutdown = sock_no_shutdown, 920 .setsockopt = j1939sk_setsockopt, 921 .getsockopt = j1939sk_getsockopt, 922 .sendmsg = j1939sk_sendmsg, 923 .recvmsg = j1939sk_recvmsg, 924 .mmap = sock_no_mmap, 925 .sendpage = sock_no_sendpage, 926 }; 927 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip