LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] soc: qcom: cmd-db: Mark more things const
@ 2019-05-10 18:13 Stephen Boyd
  0 siblings, 0 replies; only message in thread
From: Stephen Boyd @ 2019-05-10 18:13 UTC (permalink / raw)
  To: Andy Gross
  Cc: linux-kernel, linux-arm-msm, Mahesh Sivasubramanian, Lina Iyer,
	Bjorn Andersson, Evan Green

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@codeaurora.org>
Cc: Lina Iyer <ilina@codeaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Evan Green <evgreen@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-10 18:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 18:13 [PATCH] soc: qcom: cmd-db: Mark more things const Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).