提交 7ba5800b 编写于 作者: S Sergio Paracuellos 提交者: Greg Kroah-Hartman

staging: ks7010: change ETHER_HDR_SIZE definition to use the size of struct ether_hdr

This commit changes ETHER_HDR_SIZE definition which is a hardcoded
number using the size of the structure ether_hdr which is the one
for what this definition has been created. This improves readability
and makes clear the intention of this definition along the code.
Signed-off-by: NSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2f90a43f
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <uapi/linux/if_ether.h> #include <uapi/linux/if_ether.h>
#define ETHER_HDR_SIZE 20
struct ether_hdr { struct ether_hdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */
...@@ -19,6 +17,8 @@ struct ether_hdr { ...@@ -19,6 +17,8 @@ struct ether_hdr {
/* followed by length octets of data */ /* followed by length octets of data */
} __packed; } __packed;
#define ETHER_HDR_SIZE sizeof(struct ether_hdr)
struct ieee802_1x_hdr { struct ieee802_1x_hdr {
unsigned char version; unsigned char version;
unsigned char type; unsigned char type;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册