aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/tso.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-06-17 20:53:24 -0700
committerDavid S. Miller <davem@davemloft.net>2020-06-18 20:46:23 -0700
commit504b912150983a8b2499bbf9e4501336677404c9 (patch)
treeec4c56d92f18b6654a715e6e25f279f2999cf1ef /net/core/tso.c
parentnet: tso: shrink struct tso_t (diff)
downloadlinux-dev-504b912150983a8b2499bbf9e4501336677404c9.tar.xz
linux-dev-504b912150983a8b2499bbf9e4501336677404c9.zip
net: tso: constify tso_count_descs() and friends
skb argument of tso_count_descs(), tso_build_hdr() and tso_build_data() can be const. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/tso.c')
-rw-r--r--net/core/tso.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/tso.c b/net/core/tso.c
index d4d5c077ad72..56487e3bb26d 100644
--- a/net/core/tso.c
+++ b/net/core/tso.c
@@ -6,14 +6,14 @@
#include <asm/unaligned.h>
/* Calculate expected number of TX descriptors */
-int tso_count_descs(struct sk_buff *skb)
+int tso_count_descs(const struct sk_buff *skb)
{
/* The Marvell Way */
return skb_shinfo(skb)->gso_segs * 2 + skb_shinfo(skb)->nr_frags;
}
EXPORT_SYMBOL(tso_count_descs);
-void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso,
+void tso_build_hdr(const struct sk_buff *skb, char *hdr, struct tso_t *tso,
int size, bool is_last)
{
struct tcphdr *tcph;
@@ -44,7 +44,7 @@ void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso,
}
EXPORT_SYMBOL(tso_build_hdr);
-void tso_build_data(struct sk_buff *skb, struct tso_t *tso, int size)
+void tso_build_data(const struct sk_buff *skb, struct tso_t *tso, int size)
{
tso->tcp_seq += size;
tso->size -= size;