All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: move memcpy_to[from]_msg() from skbuff.h to socket.h
@ 2017-10-14  2:26 yuan linyu
  2017-10-16  8:49 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: yuan linyu @ 2017-10-14  2:26 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, yuan linyu

From: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

these two functions used by skb and other places,
move to socket.h where struct msghdr defined.

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
---
 include/linux/skbuff.h | 10 ----------
 include/linux/socket.h | 12 +++++++++++-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 03634ec2..90868d1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3294,16 +3294,6 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
 struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
 			     gfp_t gfp);
 
-static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
-{
-	return copy_from_iter_full(data, len, &msg->msg_iter) ? 0 : -EFAULT;
-}
-
-static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len)
-{
-	return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
-}
-
 struct skb_checksum_ops {
 	__wsum (*update)(const void *mem, int len, __wsum wsum);
 	__wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len);
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 8ad963c..c414f1f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -53,7 +53,17 @@ struct msghdr {
 	unsigned int	msg_flags;	/* flags on received message */
 	struct kiocb	*msg_iocb;	/* ptr to iocb for async requests */
 };
- 
+
+static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
+{
+	return copy_from_iter_full(data, len, &msg->msg_iter) ? 0 : -EFAULT;
+}
+
+static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len)
+{
+	return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
+}
+
 struct user_msghdr {
 	void		__user *msg_name;	/* ptr to socket address structure */
 	int		msg_namelen;		/* size of socket address structure */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next 1/2] net: move memcpy_to[from]_msg() from skbuff.h to socket.h
  2017-10-14  2:26 [PATCH net-next 1/2] net: move memcpy_to[from]_msg() from skbuff.h to socket.h yuan linyu
@ 2017-10-16  8:49 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2017-10-16  8:49 UTC (permalink / raw)
  To: yuan linyu; +Cc: kbuild-all, netdev, David S . Miller, yuan linyu

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

Hi yuan,

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/yuan-linyu/net-add-skb_memcpy_to-from-_msg/20171016-154618
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        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
        make.cross ARCH=xtensa 

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

   In file included from include/uapi/linux/if.h:24:0,
                    from include/linux/inetdevice.h:7,
                    from net//ipv4/netfilter/ipt_MASQUERADE.c:13:
   include/linux/socket.h: In function 'memcpy_from_msg':
>> include/linux/socket.h:59:63: error: 'EFAULT' undeclared (first use in this function)
     return copy_from_iter_full(data, len, &msg->msg_iter) ? 0 : -EFAULT;
                                                                  ^
   include/linux/socket.h:59:63: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/socket.h: In function 'memcpy_to_msg':
   include/linux/socket.h:64:63: error: 'EFAULT' undeclared (first use in this function)
     return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
                                                                  ^
--
   In file included from include/uapi/linux/nfc.h:25:0,
                    from net/nfc/rawsock.c:25:
   include/linux/socket.h: In function 'memcpy_from_msg':
>> include/linux/socket.h:59:63: error: 'EFAULT' undeclared (first use in this function)
     return copy_from_iter_full(data, len, &msg->msg_iter) ? 0 : -EFAULT;
                                                                  ^
   include/linux/socket.h:59:63: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/socket.h: In function 'memcpy_to_msg':
   include/linux/socket.h:64:63: error: 'EFAULT' undeclared (first use in this function)
     return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
                                                                  ^
   In file included from include/uapi/linux/nfc.h:25:0,
                    from net/nfc/rawsock.c:25:
   include/linux/socket.h: In function 'memcpy_from_msg':
>> include/linux/socket.h:60:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +/EFAULT +59 include/linux/socket.h

    56	
    57	static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
    58	{
  > 59		return copy_from_iter_full(data, len, &msg->msg_iter) ? 0 : -EFAULT;
  > 60	}
    61	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-16  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14  2:26 [PATCH net-next 1/2] net: move memcpy_to[from]_msg() from skbuff.h to socket.h yuan linyu
2017-10-16  8:49 ` kbuild 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.