[PATCH v6 2/3] soundwire: qcom: constify static struct qcom_swrm_data global variables
Srinivasa Rao Mandadapu
quic_srivasam at quicinc.com
Wed Mar 2 13:43:01 CET 2022
The qcom_swrm_data structures is only required for setting soundwire params,
so make the qcom_swrm_data structure const to allow the compiler
to put it in read-only memory and avoid unintentional modifications.
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam at quicinc.com>
Co-developed-by: Venkata Prasad Potturu <quic_potturu at quicinc.com>
Signed-off-by: Venkata Prasad Potturu <quic_potturu at quicinc.com>
---
drivers/soundwire/qcom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index fc41210..2d955ca 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -166,12 +166,12 @@ struct qcom_swrm_data {
u32 default_rows;
};
-static struct qcom_swrm_data swrm_v1_3_data = {
+static const struct qcom_swrm_data swrm_v1_3_data = {
.default_rows = 48,
.default_cols = 16,
};
-static struct qcom_swrm_data swrm_v1_5_data = {
+static const struct qcom_swrm_data swrm_v1_5_data = {
.default_rows = 50,
.default_cols = 16,
};
--
2.7.4
More information about the Alsa-devel
mailing list