Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	oss-drivers@corigine.com,
	"Niklas Söderlund" <niklas.soderlund@corigine.com>,
	"Louis Peens" <louis.peens@corigine.com>,
	"Simon Horman" <simon.horman@corigine.com>
Subject: [PATCH 2/2] samples/bpf: xdpsock: Remove forward declaration of ip_fast_csum()
Date: Fri,  6 Aug 2021 14:28:55 +0200	[thread overview]
Message-ID: <20210806122855.26115-3-simon.horman@corigine.com> (raw)
In-Reply-To: <20210806122855.26115-1-simon.horman@corigine.com>

From: Niklas Söderlund <niklas.soderlund@corigine.com>

There is a forward declaration of ip_fast_csum() just before its
implementation, remove the unneeded forward declaration.

While at it mark the implementation as static inline.

Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 samples/bpf/xdpsock_user.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
index 7c56a7a784e1..49d7a6ad7e39 100644
--- a/samples/bpf/xdpsock_user.c
+++ b/samples/bpf/xdpsock_user.c
@@ -651,15 +651,13 @@ static unsigned int do_csum(const unsigned char *buff, int len)
 	return result;
 }
 
-__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
-
 /*
  *	This is a version of ip_compute_csum() optimized for IP headers,
  *	which always checksum on 4 octet boundaries.
  *	This function code has been taken from
  *	Linux kernel lib/checksum.c
  */
-__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
+static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
 {
 	return (__sum16)~do_csum(iph, ihl * 4);
 }
-- 
2.20.1


  parent reply	other threads:[~2021-08-06 12:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 12:28 [PATCH 0/2] samples/bpf: xdpsock: Minor enhancements Simon Horman
2021-08-06 12:28 ` [PATCH 1/2] samples/bpf: xdpsock: Make the sample more useful outside the tree Simon Horman
2021-08-06 12:28 ` Simon Horman [this message]
2021-08-07  0:00 ` [PATCH 0/2] samples/bpf: xdpsock: Minor enhancements patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210806122855.26115-3-simon.horman@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=louis.peens@corigine.com \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --subject='Re: [PATCH 2/2] samples/bpf: xdpsock: Remove forward declaration of ip_fast_csum()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).