Skip to content

Commit a35c6e1

Browse files
rikardfalkeborngregkh
authored andcommitted
slimbus: qcom-ngd-ctrl: Constify static structs
qcom_slim_qmi_msg_handlers[] and qcom_slim_ngd_qmi_svc_event_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: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20201127102451.17114-6-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 50df984 commit a35c6e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/slimbus/qcom-ngd-ctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static int qcom_slim_qmi_send_power_request(struct qcom_slim_ngd_ctrl *ctrl,
434434
return 0;
435435
}
436436

437-
static struct qmi_msg_handler qcom_slim_qmi_msg_handlers[] = {
437+
static const struct qmi_msg_handler qcom_slim_qmi_msg_handlers[] = {
438438
{
439439
.type = QMI_RESPONSE,
440440
.msg_id = SLIMBUS_QMI_POWER_RESP_V01,
@@ -1309,7 +1309,7 @@ static void qcom_slim_ngd_qmi_del_server(struct qmi_handle *hdl,
13091309
qmi->svc_info.sq_port = 0;
13101310
}
13111311

1312-
static struct qmi_ops qcom_slim_ngd_qmi_svc_event_ops = {
1312+
static const struct qmi_ops qcom_slim_ngd_qmi_svc_event_ops = {
13131313
.new_server = qcom_slim_ngd_qmi_new_server,
13141314
.del_server = qcom_slim_ngd_qmi_del_server,
13151315
};

0 commit comments

Comments
 (0)