ath10k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: Constify static qmi structs
@ 2020-11-22 23:40 Rikard Falkeborn
  2020-11-22 23:40 ` [PATCH net-next 1/2] soc: qcom: ipa: " Rikard Falkeborn
  2020-11-22 23:40 ` [PATCH net-next 2/2] ath10k: " Rikard Falkeborn
  0 siblings, 2 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-11-22 23:40 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	Rikard Falkeborn, Kalle Valo

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(-)

-- 
2.29.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
  2020-11-22 23:40 [PATCH net-next 0/2] net: Constify static qmi structs Rikard Falkeborn
@ 2020-11-22 23:40 ` Rikard Falkeborn
  2020-11-24 22:47   ` Jakub Kicinski
  2020-11-25 21:45   ` Alex Elder
  2020-11-22 23:40 ` [PATCH net-next 2/2] ath10k: " Rikard Falkeborn
  1 sibling, 2 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-11-22 23:40 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	Rikard Falkeborn, Kalle Valo

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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/net/ipa/ipa_qmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c
index 5090f0f923ad..d2c3f273c233 100644
--- a/drivers/net/ipa/ipa_qmi.c
+++ b/drivers/net/ipa/ipa_qmi.c
@@ -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,
 };
 
-- 
2.29.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 2/2] ath10k: Constify static qmi structs
  2020-11-22 23:40 [PATCH net-next 0/2] net: Constify static qmi structs Rikard Falkeborn
  2020-11-22 23:40 ` [PATCH net-next 1/2] soc: qcom: ipa: " Rikard Falkeborn
@ 2020-11-22 23:40 ` Rikard Falkeborn
  2020-12-02 18:32   ` Kalle Valo
  1 sibling, 1 reply; 8+ messages in thread
From: Rikard Falkeborn @ 2020-11-22 23:40 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	Rikard Falkeborn, Kalle Valo

qmi_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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/net/wireless/ath/ath10k/qmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c
index ae6b1f402adf..07e478f9a808 100644
--- a/drivers/net/wireless/ath/ath10k/qmi.c
+++ b/drivers/net/wireless/ath/ath10k/qmi.c
@@ -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,
 };
-- 
2.29.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
  2020-11-22 23:40 ` [PATCH net-next 1/2] soc: qcom: ipa: " Rikard Falkeborn
@ 2020-11-24 22:47   ` Jakub Kicinski
  2020-11-25  5:59     ` Kalle Valo
  2020-11-25 21:45   ` Alex Elder
  1 sibling, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2020-11-24 22:47 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	David S. Miller, Kalle Valo

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 both qmi_ops and qmi_msg_handler. Make them
> const to allow the compiler to put them in read-only memory.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

I can take this one if Alex acks it.

The other patch is probably best handled by Kalle.

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
  2020-11-24 22:47   ` Jakub Kicinski
@ 2020-11-25  5:59     ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2020-11-25  5:59 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	Rikard Falkeborn, David S. Miller

Jakub Kicinski <kuba@kernel.org> writes:

> 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 both qmi_ops and qmi_msg_handler. Make them
>> const to allow the compiler to put them in read-only memory.
>> 
>> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
>
> 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.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
  2020-11-22 23:40 ` [PATCH net-next 1/2] soc: qcom: ipa: " Rikard Falkeborn
  2020-11-24 22:47   ` Jakub Kicinski
@ 2020-11-25 21:45   ` Alex Elder
  2020-11-25 22:49     ` Jakub Kicinski
  1 sibling, 1 reply; 8+ messages in thread
From: Alex Elder @ 2020-11-25 21:45 UTC (permalink / raw)
  To: Rikard Falkeborn, David S. Miller, Jakub Kicinski
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k, Kalle Valo

On 11/22/20 5:40 PM, Rikard Falkeborn wrote:
> 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.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Good idea.  Thanks a lot.

Acked-by: Alex Elder <elder@linaro.org>

> ---
>   drivers/net/ipa/ipa_qmi.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c
> index 5090f0f923ad..d2c3f273c233 100644
> --- a/drivers/net/ipa/ipa_qmi.c
> +++ b/drivers/net/ipa/ipa_qmi.c
> @@ -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,
>   };
>   
> 


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 1/2] soc: qcom: ipa: Constify static qmi structs
  2020-11-25 21:45   ` Alex Elder
@ 2020-11-25 22:49     ` Jakub Kicinski
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2020-11-25 22:49 UTC (permalink / raw)
  To: Alex Elder
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel,
	Rikard Falkeborn, ath10k, David S. Miller, Kalle Valo

On Wed, 25 Nov 2020 15:45:05 -0600 Alex Elder wrote:
> On 11/22/20 5:40 PM, Rikard Falkeborn wrote:
> > 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.
> > 
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>  
> 
> Acked-by: Alex Elder <elder@linaro.org>

Applied to net-next, thanks!

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 2/2] ath10k: Constify static qmi structs
  2020-11-22 23:40 ` [PATCH net-next 2/2] ath10k: " Rikard Falkeborn
@ 2020-12-02 18:32   ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2020-12-02 18:32 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Alex Elder, netdev, linux-wireless, linux-kernel, ath10k,
	Jakub Kicinski, David S. Miller

Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:

> qmi_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.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

ad37a46e8cb5 ath10k: Constify static qmi structs

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201122234031.33432-3-rikard.falkeborn@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-02 18:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-22 23:40 [PATCH net-next 0/2] net: Constify static qmi structs Rikard Falkeborn
2020-11-22 23:40 ` [PATCH net-next 1/2] soc: qcom: ipa: " Rikard Falkeborn
2020-11-24 22:47   ` Jakub Kicinski
2020-11-25  5:59     ` Kalle Valo
2020-11-25 21:45   ` Alex Elder
2020-11-25 22:49     ` Jakub Kicinski
2020-11-22 23:40 ` [PATCH net-next 2/2] ath10k: " Rikard Falkeborn
2020-12-02 18:32   ` Kalle Valo

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).