net: Constify static qmi structs
Subsystems (4)
cover net: Constify static qmi structs
Constify a couple of static qmi_ops and qmi_msg_handler structs that are never modified.
Rikard Falkeborn (2):
soc: qcom: ipa: Constify static qmi structs
ath10k: Constify static qmi structs
drivers/net/ipa/ipa_qmi.c | 8 ++++---- drivers/net/wireless/ath/ath10k/qmi.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.29.2
PATCH 1/2 soc: qcom: ipa: Constify static qmi structs
These are only used as input arguments to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.
--- drivers/net/ipa/ipa_qmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ipa/ipa_qmi.c +4 -4
@@ -168,7 +168,7 @@ static void ipa_server_bye(struct qmi_handle *qmi, unsigned int node) ipa_qmi->indication_sent = false; } -static struct qmi_ops ipa_server_ops = { +static const struct qmi_ops ipa_server_ops = { .bye = ipa_server_bye, };
@@ -234,7 +234,7 @@ static void ipa_server_driver_init_complete(struct qmi_handle *qmi, }/* The server handles two request message types sent by the modem. */ -static struct qmi_msg_handler ipa_server_msg_handlers[] = { +static const struct qmi_msg_handler ipa_server_msg_handlers[] = { { .type =QMI_REQUEST , .msg_id =IPA_QMI_INDICATION_REGISTER ,
@@ -261,7 +261,7 @@ static void ipa_client_init_driver(struct qmi_handle *qmi, }/* The client handles one response message type sent by the modem. */ -static struct qmi_msg_handler ipa_client_msg_handlers[] = { +static const struct qmi_msg_handler ipa_client_msg_handlers[] = { { .type =QMI_RESPONSE , .msg_id =IPA_QMI_INIT_DRIVER ,
@@ -463,7 +463,7 @@ ipa_client_new_server(struct qmi_handle *qmi, struct qmi_service *svc)return 0 ; } -static struct qmi_ops ipa_client_ops = { +static const struct qmi_ops ipa_client_ops = { .new_server = ipa_client_new_server, };
Signature · 7 lines
2.29.2 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Jakub Kicinski
maintainerRe: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
Quoted 5 lines · On Mon, 23 Nov 2020 00:40:30 +0100 Rikard Falkeborn wrote:
These are only used as input arguments to
qmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
I can take this one if Alex acks it.
The other patch is probably best handled by Kalle.
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
Quoted 10 lines · Jakub Kicinski
Quoted 5 lines · On Mon, 23 Nov 2020 00:40:30 +0100 Rikard Falkeborn wrote:
These are only used as input arguments to
qmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>I can take this one if Alex acks it.
The other patch is probably best handled by Kalle.
Yes, patch 2 is in my queue.
Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
In reply to Rikard FalkebornQuoted 5 lines · Rikard Falkeborn
These are only used as input arguments to
qmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
Good idea. Thanks a lot.
Quoted 45 lines
--- drivers/net/ipa/ipa_qmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/ipa/ipa_qmi.c +4
-4@@ -168,7 +168,7 @@ static void ipa_server_bye(struct qmi_handle *qmi, unsigned int node) ipa_qmi->indication_sent = false; } -static struct qmi_ops ipa_server_ops = { +static const struct qmi_ops ipa_server_ops = { .bye = ipa_server_bye, };@@ -234,7 +234,7 @@ static void ipa_server_driver_init_complete(struct qmi_handle *qmi, }/* The server handles two request message types sent by the modem. */ -static struct qmi_msg_handler ipa_server_msg_handlers[] = { +static const struct qmi_msg_handler ipa_server_msg_handlers[] = { { .type =QMI_REQUEST , .msg_id =IPA_QMI_INDICATION_REGISTER ,@@ -261,7 +261,7 @@ static void ipa_client_init_driver(struct qmi_handle *qmi, }/* The client handles one response message type sent by the modem. */ -static struct qmi_msg_handler ipa_client_msg_handlers[] = { +static const struct qmi_msg_handler ipa_client_msg_handlers[] = { { .type =QMI_RESPONSE , .msg_id =IPA_QMI_INIT_DRIVER ,@@ -463,7 +463,7 @@ ipa_client_new_server(struct qmi_handle *qmi, struct qmi_service *svc)return 0 ; } -static struct qmi_ops ipa_client_ops = { +static const struct qmi_ops ipa_client_ops = { .new_server = ipa_client_new_server, };
Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
Quoted 8 lines · On Wed, 25 Nov 2020 15:45:05 -0600 Alex Elder wrote:
Quoted 5 lines · Rikard Falkeborn
These are only used as input arguments to
qmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>Acked-by Alex Elder <[email protected]>
Applied to net-next, thanks!
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 2/2 ath10k: Constify static qmi structs
In reply to Rikard Falkebornqmi_msg_handler[] and ath10k_qmi_ops are only used as input arguments to qmi_handle_init() which accepts const pointers to both qmi_ops and qmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.
--- drivers/net/wireless/ath/ath10k/qmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/qmi.c +2 -2
@@ -917,7 +917,7 @@ static void ath10k_qmi_msa_ready_ind(struct qmi_handle *qmi_hdl,ath10k_qmi_driver_event_post (qmi,ATH10K_QMI_EVENT_MSA_READY_IND ,NULL ); } -static struct qmi_msg_handler qmi_msg_handler[] = { +static const struct qmi_msg_handler qmi_msg_handler[] = { { .type =QMI_INDICATION , .msg_id =QMI_WLFW_FW_READY_IND_V01 ,
@@ -981,7 +981,7 @@ static void ath10k_qmi_del_server(struct qmi_handle *qmi_hdl, NULL); } -static struct qmi_ops ath10k_qmi_ops = { +static const struct qmi_ops ath10k_qmi_ops = { .new_server = ath10k_qmi_new_server, .del_server = ath10k_qmi_del_server, };
Signature · 7 lines
2.29.2 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH net-next 2/2] ath10k: Constify static qmi structs
Quoted 7 lines · Rikard Falkeborn
qmi_msg_handler[] and
ath10k_qmi_opsare only used as input arguments toqmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
ad37a46e8cb5 ath10k: Constify static qmi structs
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH net-next 2/2] ath10k: Constify static qmi structs
In reply to Rikard FalkebornQuoted 7 lines · Rikard Falkeborn
qmi_msg_handler[] and
ath10k_qmi_opsare only used as input arguments toqmi_handle_init()which accepts const pointers to bothqmi_opsandqmi_msg_handler. Make them const to allow the compiler to put them in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
ad37a46e8cb5 ath10k: Constify static qmi structs
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches