ath10k: Constify static qmi structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 24 Nov 2020 15:59:18 +0000 (17:59 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 2 Dec 2020 18:32:38 +0000 (20:32 +0200)
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>
Link: https://lore.kernel.org/r/20201122234031.33432-3-rikard.falkeborn@gmail.com
drivers/net/wireless/ath/ath10k/qmi.c

index ae6b1f402adfe488dd2dfbdd0515ad66a95c22b8..07e478f9a808c1944248fcc21b3fadf08a0814a2 100644 (file)
@@ -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,
 };