net: ipa: fix warning-reported errors
Subsystems (3)
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
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.
--- drivers/net/ipa/ipa_qmi_msg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ipa/ipa_qmi_msg.c +3 -3
@@ -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
PATCH 2/3 net: ipa: declare struct types in "ipa_gsi.h"
In reply to Alex ElderPointers to two struct types are used in "ipa_gsi.h", without those struct types being forward-declared. Add these declarations.
--- drivers/net/ipa/ipa_gsi.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ipa/ipa_gsi.h +2 -0
@@ -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
PATCH 3/3 net: ipa: include declarations in "ipa_gsi.c"
In reply to Alex ElderInclude "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.
--- drivers/net/ipa/ipa_gsi.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ipa/ipa_gsi.c +1 -0
@@ -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
David Miller
maintainerFrom: 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.