netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, willemb@google.com,
	Paul.Chavent@onera.fr, richardcochran@gmail.com
Subject: [PATCH net-next 3/5] packet: minor: convert status bits into shifting format
Date: Tue, 23 Apr 2013 12:39:30 +0200	[thread overview]
Message-ID: <1366713572-11978-4-git-send-email-dborkman@redhat.com> (raw)
In-Reply-To: <1366713572-11978-1-git-send-email-dborkman@redhat.com>

This makes it more readable and clearer what bits are still free to
use. The compiler reduces this to a constant for us anyway.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
 This is just to bring the status bits' format in line with the
 next patch.

 include/uapi/linux/if_packet.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index 8136658..4dfc234 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -86,19 +86,19 @@ struct tpacket_auxdata {
 };
 
 /* Rx ring - header status */
-#define TP_STATUS_KERNEL	0x0
-#define TP_STATUS_USER		0x1
-#define TP_STATUS_COPY		0x2
-#define TP_STATUS_LOSING	0x4
-#define TP_STATUS_CSUMNOTREADY	0x8
-#define TP_STATUS_VLAN_VALID   0x10 /* auxdata has valid tp_vlan_tci */
-#define TP_STATUS_BLK_TMO	0x20
+#define TP_STATUS_KERNEL	      0
+#define TP_STATUS_USER		(1 << 0)
+#define TP_STATUS_COPY		(1 << 1)
+#define TP_STATUS_LOSING	(1 << 2)
+#define TP_STATUS_CSUMNOTREADY	(1 << 3)
+#define TP_STATUS_VLAN_VALID	(1 << 4) /* auxdata has valid tp_vlan_tci */
+#define TP_STATUS_BLK_TMO	(1 << 5)
 
 /* Tx ring - header status */
-#define TP_STATUS_AVAILABLE	0x0
-#define TP_STATUS_SEND_REQUEST	0x1
-#define TP_STATUS_SENDING	0x2
-#define TP_STATUS_WRONG_FORMAT	0x4
+#define TP_STATUS_AVAILABLE	      0
+#define TP_STATUS_SEND_REQUEST	(1 << 0)
+#define TP_STATUS_SENDING	(1 << 1)
+#define TP_STATUS_WRONG_FORMAT	(1 << 2)
 
 /* Rx ring - feature request bits */
 #define TP_FT_REQ_FILL_RXHASH	0x1
-- 
1.7.11.7

  parent reply	other threads:[~2013-04-23 10:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 10:39 [PATCH net-next 0/5] PF_PACKET timestamping updates Daniel Borkmann
2013-04-23 10:39 ` [PATCH net-next 1/5] packet: tx timestamping on tpacket ring Daniel Borkmann
2013-04-23 10:39 ` [PATCH net-next 2/5] packet: enable hardware " Daniel Borkmann
2013-04-23 12:13   ` Willem de Bruijn
2013-04-23 10:39 ` Daniel Borkmann [this message]
2013-04-23 12:22   ` [PATCH net-next 3/5] packet: minor: convert status bits into shifting format Willem de Bruijn
2013-04-23 10:39 ` [PATCH net-next 4/5] packet: if hw/sw ts enabled in rx/tx ring, report which ts we got Daniel Borkmann
2013-04-23 12:18   ` Willem de Bruijn
2013-04-23 10:39 ` [PATCH net-next 5/5] packet: doc: update timestamping part Daniel Borkmann
2013-04-23 12:20   ` Willem de Bruijn
2013-04-23 12:33 ` [PATCH net-next 0/5] PF_PACKET timestamping updates Willem de Bruijn
2013-04-23 12:53   ` Daniel Borkmann
2013-04-23 18:13     ` Richard Cochran
2013-04-23 18:07   ` Richard Cochran
2013-04-25  5:35 ` David Miller

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=1366713572-11978-4-git-send-email-dborkman@redhat.com \
    --to=dborkman@redhat.com \
    --cc=Paul.Chavent@onera.fr \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=willemb@google.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).