[PATCH i-g-t 24/25] Remove union elsewhere too then

Petri Latvala petri.latvala at intel.com
Fri Mar 12 08:47:57 UTC 2021


---
 lib/runnercomms.c                   |  4 ++--
 lib/tests/igt_runnercomms_packets.c | 22 +++++++++++-----------
 runner/decoder.c                    |  2 +-
 runner/executor.c                   |  2 +-
 runner/resultgen.c                  | 20 ++++++++++----------
 5 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/lib/runnercomms.c b/lib/runnercomms.c
index c9de3034..5588b63c 100644
--- a/lib/runnercomms.c
+++ b/lib/runnercomms.c
@@ -141,9 +141,9 @@ static void read_cstring(const char **dststr, const char **p, uint32_t *size)
  * data validation errors, the #type of the returned value will be
  * #PACKETTYPE_INVALID.
  */
-union runnerpacket_read_helper read_runnerpacket(const struct runnerpacket *packet)
+runnerpacket_read_helper read_runnerpacket(const struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper ret = {};
+	runnerpacket_read_helper ret = {};
 	uint32_t sizeleft;
 	const char *p;
 
diff --git a/lib/tests/igt_runnercomms_packets.c b/lib/tests/igt_runnercomms_packets.c
index 79b9bb20..78440f4d 100644
--- a/lib/tests/igt_runnercomms_packets.c
+++ b/lib/tests/igt_runnercomms_packets.c
@@ -50,7 +50,7 @@ static struct runnerpacket *create_log(void)
 
 static void validate_log(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -78,7 +78,7 @@ static struct runnerpacket *create_exec(void)
 
 static void validate_exec(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 	char cmpstr[256];
 
 	helper = read_runnerpacket(packet);
@@ -97,7 +97,7 @@ static struct runnerpacket *create_exit(void)
 
 static void validate_exit(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -115,7 +115,7 @@ static struct runnerpacket *create_subtest_start(void)
 
 static void validate_subtest_start(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -132,7 +132,7 @@ static struct runnerpacket *create_subtest_result(void)
 
 static void validate_subtest_result(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -152,7 +152,7 @@ static struct runnerpacket *create_dynamic_subtest_start(void)
 
 static void validate_dynamic_subtest_start(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -169,7 +169,7 @@ static struct runnerpacket *create_dynamic_subtest_result(void)
 
 static void validate_dynamic_subtest_result(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -189,7 +189,7 @@ static struct runnerpacket *create_versionstring(void)
 
 static void validate_versionstring(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -206,7 +206,7 @@ static struct runnerpacket *create_result_override(void)
 
 static void validate_result_override(struct runnerpacket *packet)
 {
-	union runnerpacket_read_helper helper;
+	runnerpacket_read_helper helper;
 
 	helper = read_runnerpacket(packet);
 
@@ -247,7 +247,7 @@ igt_main
 
 	igt_subtest("packet-too-short") {
 		struct runnerpacket *packet;
-		union runnerpacket_read_helper helper;
+		runnerpacket_read_helper helper;
 
 		packet = runnerpacket_log(1, "Hello");
 		igt_assert(packet != NULL);
@@ -263,7 +263,7 @@ igt_main
 	igt_subtest("nul-termination-missing") {
 		/* Parsing should reject the packet when nul-termination is missing */
 		struct runnerpacket *packet;
-		union runnerpacket_read_helper helper;
+		runnerpacket_read_helper helper;
 
 		uint8_t num = 1;
 		const char *text = "This is text";
diff --git a/runner/decoder.c b/runner/decoder.c
index d328d49f..2f68d31f 100644
--- a/runner/decoder.c
+++ b/runner/decoder.c
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
 
 	while (p != NULL && p != bufend) {
 		const struct runnerpacket *packet;
-		union runnerpacket_read_helper helper;
+		runnerpacket_read_helper helper;
 
 		if (bufend - p >= sizeof(uint32_t)) {
 			uint32_t canary;
diff --git a/runner/executor.c b/runner/executor.c
index 88bb796f..0e81d429 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1021,7 +1021,7 @@ static int monitor_output(pid_t child,
 				socket_comms_used = true;
 
 			if (settings->log_level >= LOG_LEVEL_VERBOSE) {
-				union runnerpacket_read_helper helper = {};
+				runnerpacket_read_helper helper = {};
 				const char *time;
 
 				if (packet->type == PACKETTYPE_SUBTEST_START ||
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 705b2749..57148ce2 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -1379,7 +1379,7 @@ static void comms_add_new_dynamic_subtest(struct comms_context *context,
 }
 
 static void comms_handle_log(struct comms_context *context,
-			     union runnerpacket_read_helper helper)
+			     runnerpacket_read_helper helper)
 {
 	char **textbuf;
 	size_t *textlen;
@@ -1398,7 +1398,7 @@ static void comms_handle_log(struct comms_context *context,
 }
 
 static void comms_handle_exec(struct comms_context *context,
-			      union runnerpacket_read_helper helper)
+			      runnerpacket_read_helper helper)
 {
 	switch (context->state) {
 	case STATE_INITIAL:
@@ -1441,7 +1441,7 @@ static void comms_handle_exec(struct comms_context *context,
 }
 
 static void comms_handle_exit(struct comms_context *context,
-			      union runnerpacket_read_helper helper)
+			      runnerpacket_read_helper helper)
 {
 	char piglit_name[256];
 
@@ -1488,7 +1488,7 @@ static void comms_handle_exit(struct comms_context *context,
 }
 
 static void comms_handle_subtest_start(struct comms_context *context,
-				       union runnerpacket_read_helper helper)
+				       runnerpacket_read_helper helper)
 {
 	char errmsg[512];
 
@@ -1544,7 +1544,7 @@ static void comms_handle_subtest_start(struct comms_context *context,
 }
 
 static void comms_handle_subtest_result(struct comms_context *context,
-					union runnerpacket_read_helper helper)
+					runnerpacket_read_helper helper)
 {
 	char errmsg[512];
 
@@ -1614,7 +1614,7 @@ static void comms_handle_subtest_result(struct comms_context *context,
 }
 
 static void comms_handle_dynamic_subtest_start(struct comms_context *context,
-						union runnerpacket_read_helper helper)
+						runnerpacket_read_helper helper)
 {
 	char errmsg[512];
 
@@ -1672,7 +1672,7 @@ static void comms_handle_dynamic_subtest_start(struct comms_context *context,
 }
 
 static void comms_handle_dynamic_subtest_result(struct comms_context *context,
-						union runnerpacket_read_helper helper)
+						runnerpacket_read_helper helper)
 {
 	char errmsg[512];
 
@@ -1751,7 +1751,7 @@ static void comms_handle_dynamic_subtest_result(struct comms_context *context,
 }
 
 static void comms_handle_versionstring(struct comms_context *context,
-				       union runnerpacket_read_helper helper)
+				       runnerpacket_read_helper helper)
 {
 	if (context->state == STATE_ERROR)
 		return;
@@ -1761,7 +1761,7 @@ static void comms_handle_versionstring(struct comms_context *context,
 }
 
 static void comms_handle_result_override(struct comms_context *context,
-					 union runnerpacket_read_helper helper)
+					 runnerpacket_read_helper helper)
 {
 	if (context->state == STATE_ERROR)
 		return;
@@ -1815,7 +1815,7 @@ static int fill_from_comms(int fd,
 
 	while (p != NULL && p != bufend) {
 		const struct runnerpacket *packet;
-		union runnerpacket_read_helper helper;
+		runnerpacket_read_helper helper;
 
 		if (bufend - p >= sizeof(uint32_t)) {
 			uint32_t canary;
-- 
2.29.2



More information about the Intel-gfx-trybot mailing list