bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org,
	bpf@vger.kernel.org
Cc: "Björn Töpel" <bjorn.topel@intel.com>,
	magnus.karlsson@intel.com, jonathan.lemon@gmail.com,
	ciara.loftus@intel.com, weqaar.a.janjua@intel.com
Subject: [PATCH bpf-next 03/12] selftests/bpf: fix style warnings
Date: Fri, 22 Jan 2021 16:47:16 +0100	[thread overview]
Message-ID: <20210122154725.22140-4-bjorn.topel@gmail.com> (raw)
In-Reply-To: <20210122154725.22140-1-bjorn.topel@gmail.com>

From: Björn Töpel <bjorn.topel@intel.com>

Silence three checkpatch style warnings.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 tools/testing/selftests/bpf/xdpxceiver.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c
index cd1dd2b7458f..77d1bda37afa 100644
--- a/tools/testing/selftests/bpf/xdpxceiver.c
+++ b/tools/testing/selftests/bpf/xdpxceiver.c
@@ -734,10 +734,10 @@ static void worker_pkt_validate(void)
 			break;
 		/*do not increment pktcounter if !(tos=0x9 and ipv4) */
 		if ((((struct iphdr *)(pkt_node_rx_q->pkt_frame +
-				       sizeof(struct ethhdr)))->version == IP_PKT_VER)
-		    && (((struct iphdr *)(pkt_node_rx_q->pkt_frame + sizeof(struct ethhdr)))->tos ==
+				       sizeof(struct ethhdr)))->version == IP_PKT_VER) &&
+		    (((struct iphdr *)(pkt_node_rx_q->pkt_frame + sizeof(struct ethhdr)))->tos ==
 			IP_PKT_TOS)) {
-			payloadseqnum = *((uint32_t *) (pkt_node_rx_q->pkt_frame + PKT_HDR_SIZE));
+			payloadseqnum = *((uint32_t *)(pkt_node_rx_q->pkt_frame + PKT_HDR_SIZE));
 			if (debug_pkt_dump && payloadseqnum != EOT) {
 				pkt_obj = (struct pkt_frame *)malloc(sizeof(struct pkt_frame));
 				pkt_obj->payload = (char *)malloc(PKT_SIZE);
@@ -767,10 +767,10 @@ static void worker_pkt_validate(void)
 		} else {
 			ksft_print_msg("Invalid frame received: ");
 			ksft_print_msg("[IP_PKT_VER: %02X], [IP_PKT_TOS: %02X]\n",
-				((struct iphdr *)(pkt_node_rx_q->pkt_frame +
-				       sizeof(struct ethhdr)))->version,
-				((struct iphdr *)(pkt_node_rx_q->pkt_frame +
-				       sizeof(struct ethhdr)))->tos);
+				       ((struct iphdr *)(pkt_node_rx_q->pkt_frame +
+							 sizeof(struct ethhdr)))->version,
+				       ((struct iphdr *)(pkt_node_rx_q->pkt_frame +
+							 sizeof(struct ethhdr)))->tos);
 			TAILQ_REMOVE(&head, pkt_node_rx_q, pkt_nodes);
 			free(pkt_node_rx_q->pkt_frame);
 			free(pkt_node_rx_q);
-- 
2.27.0


  parent reply	other threads:[~2021-01-22 15:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 15:47 [PATCH bpf-next 00/12] Various cleanups/fixes for AF_XDP selftests Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 01/12] selftests/bpf: remove a lot of ifobject casting Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 02/12] selftests/bpf: remove unused enums Björn Töpel
2021-01-22 15:47 ` Björn Töpel [this message]
2021-01-22 15:47 ` [PATCH bpf-next 04/12] selftests/bpf: remove memory leak Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 05/12] selftests/bpf: improve readability of xdpxceiver/worker_pkt_validate() Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 06/12] selftests/bpf: remove casting by introduce local variable Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 07/12] selftests/bpf: change type from void * to struct ifaceconfigobj * Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 08/12] selftests/bpf: change type from void * to struct generic_data * Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 09/12] selftests/bpf: define local variables at the beginning of a block Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 10/12] selftests/bpf: avoid heap allocation Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 11/12] selftests/bpf: consistent malloc/calloc usage Björn Töpel
2021-01-22 15:47 ` [PATCH bpf-next 12/12] selftests/bpf: avoid useless void *-casts Björn Töpel
2021-01-25 23:10 ` [PATCH bpf-next 00/12] Various cleanups/fixes for AF_XDP selftests 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=20210122154725.22140-4-bjorn.topel@gmail.com \
    --to=bjorn.topel@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=ciara.loftus@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=weqaar.a.janjua@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).