* [PATCH net 0/3] net: ipa: fix warning-reported errors
@ 2020-07-06 23:10 Alex Elder
2020-07-06 23:10 ` [PATCH net 1/3] net: ipa: fix QMI structure definition bugs Alex Elder
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Alex Elder @ 2020-07-06 23:10 UTC (permalink / raw)
To: davem, kuba
Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev,
linux-kernel
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(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH net 1/3] net: ipa: fix QMI structure definition bugs 2020-07-06 23:10 [PATCH net 0/3] net: ipa: fix warning-reported errors Alex Elder @ 2020-07-06 23:10 ` Alex Elder 2020-07-06 23:10 ` [PATCH net 2/3] net: ipa: declare struct types in "ipa_gsi.h" Alex Elder ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Alex Elder @ 2020-07-06 23:10 UTC (permalink / raw) To: davem, kuba Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel 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") Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/net/ipa/ipa_qmi_msg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ipa/ipa_qmi_msg.c b/drivers/net/ipa/ipa_qmi_msg.c index 03a1d0e55964..73413371e3d3 100644 --- a/drivers/net/ipa/ipa_qmi_msg.c +++ b/drivers/net/ipa/ipa_qmi_msg.c @@ -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), }, { -- 2.25.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 2/3] net: ipa: declare struct types in "ipa_gsi.h" 2020-07-06 23:10 [PATCH net 0/3] net: ipa: fix warning-reported errors Alex Elder 2020-07-06 23:10 ` [PATCH net 1/3] net: ipa: fix QMI structure definition bugs Alex Elder @ 2020-07-06 23:10 ` Alex Elder 2020-07-06 23:10 ` [PATCH net 3/3] net: ipa: include declarations in "ipa_gsi.c" Alex Elder 2020-07-07 19:43 ` [PATCH net 0/3] net: ipa: fix warning-reported errors David Miller 3 siblings, 0 replies; 5+ messages in thread From: Alex Elder @ 2020-07-06 23:10 UTC (permalink / raw) To: davem, kuba Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel 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") Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/net/ipa/ipa_gsi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ipa/ipa_gsi.h b/drivers/net/ipa/ipa_gsi.h index 3cf18600c68e..0a40f3dc55fc 100644 --- a/drivers/net/ipa/ipa_gsi.h +++ b/drivers/net/ipa/ipa_gsi.h @@ -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 -- 2.25.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net 3/3] net: ipa: include declarations in "ipa_gsi.c" 2020-07-06 23:10 [PATCH net 0/3] net: ipa: fix warning-reported errors Alex Elder 2020-07-06 23:10 ` [PATCH net 1/3] net: ipa: fix QMI structure definition bugs Alex Elder 2020-07-06 23:10 ` [PATCH net 2/3] net: ipa: declare struct types in "ipa_gsi.h" Alex Elder @ 2020-07-06 23:10 ` Alex Elder 2020-07-07 19:43 ` [PATCH net 0/3] net: ipa: fix warning-reported errors David Miller 3 siblings, 0 replies; 5+ messages in thread From: Alex Elder @ 2020-07-06 23:10 UTC (permalink / raw) To: davem, kuba Cc: evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel 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") Signed-off-by: Alex Elder <elder@linaro.org> --- drivers/net/ipa/ipa_gsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ipa/ipa_gsi.c b/drivers/net/ipa/ipa_gsi.c index dc4a5c2196ae..d323adb03383 100644 --- a/drivers/net/ipa/ipa_gsi.c +++ b/drivers/net/ipa/ipa_gsi.c @@ -6,6 +6,7 @@ #include <linux/types.h> +#include "ipa_gsi.h" #include "gsi_trans.h" #include "ipa.h" #include "ipa_endpoint.h" -- 2.25.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net 0/3] net: ipa: fix warning-reported errors 2020-07-06 23:10 [PATCH net 0/3] net: ipa: fix warning-reported errors Alex Elder ` (2 preceding siblings ...) 2020-07-06 23:10 ` [PATCH net 3/3] net: ipa: include declarations in "ipa_gsi.c" Alex Elder @ 2020-07-07 19:43 ` David Miller 3 siblings, 0 replies; 5+ messages in thread From: David Miller @ 2020-07-07 19:43 UTC (permalink / raw) To: elder Cc: kuba, evgreen, subashab, cpratapa, bjorn.andersson, netdev, linux-kernel From: Alex Elder <elder@linaro.org> Date: Mon, 6 Jul 2020 18:10:07 -0500 > 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-07 19:43 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-07-06 23:10 [PATCH net 0/3] net: ipa: fix warning-reported errors Alex Elder 2020-07-06 23:10 ` [PATCH net 1/3] net: ipa: fix QMI structure definition bugs Alex Elder 2020-07-06 23:10 ` [PATCH net 2/3] net: ipa: declare struct types in "ipa_gsi.h" Alex Elder 2020-07-06 23:10 ` [PATCH net 3/3] net: ipa: include declarations in "ipa_gsi.c" Alex Elder 2020-07-07 19:43 ` [PATCH net 0/3] net: ipa: fix warning-reported errors David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).