summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-04-06 14:37:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 14:27:35 +0200
commit7ba5800b0df6cc8a65b3db83fd7a2cb4426c2890 (patch)
treee65d1917e0c76eb1b19c9ac2bdb2999fa0259fb3
parent2f90a43f8eed777dd1fa1977b9e62294c1ce2558 (diff)
downloadop-kernel-dev-7ba5800b0df6cc8a65b3db83fd7a2cb4426c2890.zip
op-kernel-dev-7ba5800b0df6cc8a65b3db83fd7a2cb4426c2890.tar.gz
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: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/eap_packet.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/ks7010/eap_packet.h b/drivers/staging/ks7010/eap_packet.h
index 3a5fade..d918742 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -6,8 +6,6 @@
#include <linux/bitops.h>
#include <uapi/linux/if_ether.h>
-#define ETHER_HDR_SIZE 20
-
struct ether_hdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
@@ -19,6 +17,8 @@ struct ether_hdr {
/* followed by length octets of data */
} __packed;
+#define ETHER_HDR_SIZE sizeof(struct ether_hdr)
+
struct ieee802_1x_hdr {
unsigned char version;
unsigned char type;
OpenPOWER on IntegriCloud