]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
packet: minor: convert status bits into shifting format
authorDaniel Borkmann <dborkman@redhat.com>
Tue, 23 Apr 2013 00:39:30 +0000 (00:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Apr 2013 05:22:22 +0000 (01:22 -0400)
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>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/if_packet.h

index 8136658ea477021a373e963287816af0bc6474e7..4dfc234d80e5c97d29bbe3a45cf21b5a7abf9e64 100644 (file)
@@ -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