Skip to content

Commit 0af104d

Browse files
rikardfalkebornandersson
authored andcommitted
soc: qcom: pdr: Constify static qmi structs
Their only usage is to pass their address 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> Link: https://lore.kernel.org/r/20201122232818.32072-1-rikard.falkeborn@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent a161ffe commit 0af104d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/soc/qcom/pdr_interface.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void pdr_locator_del_server(struct qmi_handle *qmi,
110110
pdr->locator_addr.sq_port = 0;
111111
}
112112

113-
static struct qmi_ops pdr_locator_ops = {
113+
static const struct qmi_ops pdr_locator_ops = {
114114
.new_server = pdr_locator_new_server,
115115
.del_server = pdr_locator_del_server,
116116
};
@@ -238,7 +238,7 @@ static void pdr_notifier_del_server(struct qmi_handle *qmi,
238238
mutex_unlock(&pdr->list_lock);
239239
}
240240

241-
static struct qmi_ops pdr_notifier_ops = {
241+
static const struct qmi_ops pdr_notifier_ops = {
242242
.new_server = pdr_notifier_new_server,
243243
.del_server = pdr_notifier_del_server,
244244
};
@@ -343,7 +343,7 @@ static void pdr_indication_cb(struct qmi_handle *qmi,
343343
queue_work(pdr->indack_wq, &pdr->indack_work);
344344
}
345345

346-
static struct qmi_msg_handler qmi_indication_handler[] = {
346+
static const struct qmi_msg_handler qmi_indication_handler[] = {
347347
{
348348
.type = QMI_INDICATION,
349349
.msg_id = SERVREG_STATE_UPDATED_IND_ID,

0 commit comments

Comments
 (0)