Skip to contentSkip to conversation

powerpc/pseries: Factor HVSI header struct in packet definitions

PATCH New Benjamin Herrenschmidt 1 participant 1 message Jun 17, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/5 powerpc/pseries: Factor HVSI header struct in packet definitions

Embed the struct hvsi_header in the various packet definitions rather than open coding it multiple times. Will help provide stronger type checking.

---
 arch/powerpc/include/asm/hvsi.h |   16 ++-------
 drivers/tty/hvc/hvsi.c          |   66 +++++++++++++++++++-------------------
 2 files changed, 37 insertions(+), 45 deletions(-)
arch/powerpc/include/asm/hvsi.h +4 -12
index f13125a..ab2ddd7 100644
@@ -29,16 +29,12 @@ struct hvsi_header {
 } __attribute__((packed));
 
 struct hvsi_data {
-	uint8_t  type;
-	uint8_t  len;
-	uint16_t seqno;
+	struct hvsi_header hdr;
 	uint8_t  data[HVSI_MAX_OUTGOING_DATA];
 } __attribute__((packed));
 
 struct hvsi_control {
-	uint8_t  type;
-	uint8_t  len;
-	uint16_t seqno;
+	struct hvsi_header hdr;
 	uint16_t verb;
 	/* optional depending on verb: */
 	uint32_t word;
@@ -46,16 +42,12 @@ struct hvsi_control {
 } __attribute__((packed));
 
 struct hvsi_query {
-	uint8_t  type;
-	uint8_t  len;
-	uint16_t seqno;
+	struct hvsi_header hdr;
 	uint16_t verb;
 } __attribute__((packed));
 
 struct hvsi_query_response {
-	uint8_t  type;
-	uint8_t  len;
-	uint16_t seqno;
+	struct hvsi_header hdr;
 	uint16_t verb;
 	uint16_t query_seqno;
 	union {
drivers/tty/hvc/hvsi.c +33 -33

122 lines not on this page · raw message