[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190510181327.121666-1-swboyd@chromium.org>
Date: Fri, 10 May 2019 11:13:27 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Andy Gross <agross@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
Mahesh Sivasubramanian <msivasub@...eaurora.org>,
Lina Iyer <ilina@...eaurora.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Evan Green <evgreen@...omium.org>
Subject: [PATCH] soc: qcom: cmd-db: Mark more things const
Nothing that cmd db returns is ever non-const, so mark cmd_db_header and
rsc_offset const so that we don't try to modify the database
inadvertently.
Cc: Mahesh Sivasubramanian <msivasub@...eaurora.org>
Cc: Lina Iyer <ilina@...eaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Evan Green <evgreen@...omium.org>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/soc/qcom/cmd-db.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index c701b3b010f1..7d67cbb52b97 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -99,7 +99,7 @@ static bool cmd_db_magic_matches(const struct cmd_db_header *header)
return memcmp(magic, CMD_DB_MAGIC, ARRAY_SIZE(CMD_DB_MAGIC)) == 0;
}
-static struct cmd_db_header *cmd_db_header;
+static const struct cmd_db_header *cmd_db_header;
static inline const void *rsc_to_entry_header(const struct rsc_hdr *hdr)
{
@@ -108,7 +108,7 @@ static inline const void *rsc_to_entry_header(const struct rsc_hdr *hdr)
return cmd_db_header->data + offset;
}
-static inline void *
+static inline const void *
rsc_offset(const struct rsc_hdr *hdr, const struct entry_header *ent)
{
u16 offset = le16_to_cpu(hdr->data_offset);
base-commit: e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd
--
Sent by a computer through tubes
Powered by blists - more mailing lists