Skip to contentSkip to conversation

net: ipa: fix warning-reported errors

PATCH In review Alex Elder 2 participants 5 messages Jul 6, 2020 – Jul 7, 2020

Subsystems (3)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

cover net: ipa: fix warning-reported errors

Building the kernel with W=1 produces numerous warnings for the IPA code. Some of those warnings turn out to flag real problems, and this series fixes them. The first patch fixes the most important ones, but the second and third are problems I think are worth treating as bugs as well.

Note: I'll happily combine any of these if someone prefers that.

-Alex

Alex Elder (3):
net: ipa: fix QMI structure definition bugs
net: ipa: declare struct types in "ipa_gsi.h"
net: ipa: include declarations in "ipa_gsi.c"

 drivers/net/ipa/ipa_gsi.c     | 1 +
 drivers/net/ipa/ipa_gsi.h     | 2 ++
 drivers/net/ipa/ipa_qmi_msg.c | 6 +++---
 3 files changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/3 net: ipa: fix QMI structure definition bugs

Building with "W=1" did exactly what it was supposed to do, namely point out some suspicious-looking code to be verified not to contain bugs.

Some QMI message structures defined in "ipa_qmi_msg.c" contained some bad field names (duplicating the "elem_size" field instead of defining the "offset" field), almost certainly due to copy/paste errors that weren't obvious in a scan of the code. Fix these bugs.

Fixes 530f9216a953 ("soc: qcom: ipa: AP/modem communications")
---
 drivers/net/ipa/ipa_qmi_msg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ipa/ipa_qmi_msg.c +3 -3
index 03a1d0e55964..73413371e3d3 100644
@@ -119,7 +119,7 @@ struct qmi_elem_info ipa_driver_init_complete_rsp_ei[] = {
 			sizeof_field(struct ipa_driver_init_complete_rsp,
 				     rsp),
 		.tlv_type	= 0x02,
-		.elem_size	= offsetof(struct ipa_driver_init_complete_rsp,
+		.offset		= offsetof(struct ipa_driver_init_complete_rsp,
 					   rsp),
 		.ei_array	= qmi_response_type_v01_ei,
 	},
@@ -137,7 +137,7 @@ struct qmi_elem_info ipa_init_complete_ind_ei[] = {
 			sizeof_field(struct ipa_init_complete_ind,
 				     status),
 		.tlv_type	= 0x02,
-		.elem_size	= offsetof(struct ipa_init_complete_ind,
+		.offset		= offsetof(struct ipa_init_complete_ind,
 					   status),
 		.ei_array	= qmi_response_type_v01_ei,
 	},
@@ -218,7 +218,7 @@ struct qmi_elem_info ipa_init_modem_driver_req_ei[] = {
 			sizeof_field(struct ipa_init_modem_driver_req,
 				     platform_type_valid),
 		.tlv_type	= 0x10,
-		.elem_size	= offsetof(struct ipa_init_modem_driver_req,
+		.offset		= offsetof(struct ipa_init_modem_driver_req,
 					   platform_type_valid),
 	},
 	{
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 2/3 net: ipa: declare struct types in "ipa_gsi.h"

In reply to Alex Elder

Pointers to two struct types are used in "ipa_gsi.h", without those struct types being forward-declared. Add these declarations.

Fixes c3f398b141a8 ("soc: qcom: ipa: IPA interface to GSI")
---
 drivers/net/ipa/ipa_gsi.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ipa/ipa_gsi.h +2 -0
index 3cf18600c68e..0a40f3dc55fc 100644
@@ -8,7 +8,9 @@
 
 #include <linux/types.h>
 
+struct gsi;
 struct gsi_trans;
+struct ipa_gsi_endpoint_data;
 
 /**
  * ipa_gsi_trans_complete() - GSI transaction completion callback
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH 3/3 net: ipa: include declarations in "ipa_gsi.c"

In reply to Alex Elder

Include "ipa_gsi.h" in "ipa_gsi.c", so the public functions are defined before they are used in "ipa_gsi.c". This addresses some warnings that are reported with a "W=1" build.

Fixes c3f398b141a8 ("soc: qcom: ipa: IPA interface to GSI")
---
 drivers/net/ipa/ipa_gsi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ipa/ipa_gsi.c +1 -0
index dc4a5c2196ae..d323adb03383 100644
@@ -6,6 +6,7 @@
 
 #include <linux/types.h>
 
+#include "ipa_gsi.h"
 #include "gsi_trans.h"
 #include "ipa.h"
 #include "ipa_endpoint.h"
Signature · 1 line
2.25.1
maintainer
#4 lore raw
In reply to Alex Elder

From: Alex Elder <[email protected]>
Date: Mon, 6 Jul 2020 18:10:07 -0500

Quoted 7 lines

Building the kernel with W=1 produces numerous warnings for the IPA code. Some of those warnings turn out to flag real problems, and this series fixes them. The first patch fixes the most important ones, but the second and third are problems I think are worth treating as bugs as well.

Note: I'll happily combine any of these if someone prefers that.

Series applied, thank you.