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