Skip to content

Commit dc32bff

Browse files
dhowellsbrauner
authored andcommitted
iov_iter, net: Fold in csum_and_memcpy()
Fold csum_and_memcpy() in to its callers. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] cc: Alexander Viro <[email protected]> cc: Jens Axboe <[email protected]> cc: Christoph Hellwig <[email protected]> cc: Christian Brauner <[email protected]> cc: Matthew Wilcox <[email protected]> cc: Linus Torvalds <[email protected]> cc: David Laight <[email protected]> cc: "David S. Miller" <[email protected]> cc: Eric Dumazet <[email protected]> cc: Jakub Kicinski <[email protected]> cc: Paolo Abeni <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 6d0d419 commit dc32bff

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

include/linux/skbuff.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,13 +3679,6 @@ static inline int __must_check skb_put_padto(struct sk_buff *skb, unsigned int l
36793679
return __skb_put_padto(skb, len, true);
36803680
}
36813681

3682-
static inline __wsum csum_and_memcpy(void *to, const void *from, size_t len,
3683-
__wsum sum, size_t off)
3684-
{
3685-
__wsum next = csum_partial_copy_nocheck(from, to, len);
3686-
return csum_block_add(sum, next, off);
3687-
}
3688-
36893682
struct csum_state {
36903683
__wsum csum;
36913684
size_t off;

net/core/datagram.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,9 @@ size_t memcpy_to_iter_csum(void *iter_to, size_t progress,
732732
size_t len, void *from, void *priv2)
733733
{
734734
__wsum *csum = priv2;
735+
__wsum next = csum_partial_copy_nocheck(from, iter_to, len);
735736

736-
*csum = csum_and_memcpy(iter_to, from + progress, len, *csum, progress);
737+
*csum = csum_block_add(*csum, next, progress);
737738
return 0;
738739
}
739740

net/core/skbuff.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6938,8 +6938,9 @@ size_t memcpy_from_iter_csum(void *iter_from, size_t progress,
69386938
size_t len, void *to, void *priv2)
69396939
{
69406940
__wsum *csum = priv2;
6941+
__wsum next = csum_partial_copy_nocheck(iter_from, to + progress, len);
69416942

6942-
*csum = csum_and_memcpy(to + progress, iter_from, len, *csum, progress);
6943+
*csum = csum_block_add(*csum, next, progress);
69436944
return 0;
69446945
}
69456946

0 commit comments

Comments
 (0)