Skip to contentSkip to conversation

soc: qcom: cmd-db: Use %*pEhp specifier to add some sanity

PATCH Applied Andy Shevchenko 4 participants 5 messages Oct 2 – Nov 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: qcom: cmd-db: Use %*pEhp specifier to add some sanity

As Sashiko pointed out in [1] the %*pEp makes the whole thing like "no escape". To add some sanity to this the used specifier also includes ESCAPE_HEX.

---

Just a Link tag (no Fixes et alia) as the escaping seems to be a guard that never fired so far.

 drivers/soc/qcom/cmd-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/cmd-db.c +1 -1
index 3f1eee784387..bed14b92c194 100644
@@ -308,7 +308,7 @@ static int cmd_db_debugfs_dump(struct seq_file *seq, void *p)
 
 		ent = rsc_to_entry_header(rsc);
 		for (j = 0; j < le16_to_cpu(rsc->cnt); j++, ent++) {
-			seq_printf(seq, "0x%05x: %*pEp", le32_to_cpu(ent->addr),
+			seq_printf(seq, "0x%05x: %*pEhp", le32_to_cpu(ent->addr),
 				   (int)strnlen(ent->id, sizeof(ent->id)), ent->id);
 
 			len = le16_to_cpu(ent->len);
Signature · 1 line
2.50.1
#1 lore raw
Quoted 3 lines · Andy Shevchenko

As Sashiko pointed out in [1] the %*pEp makes the whole thing like "no escape". To add some sanity to this the used specifier also includes ESCAPE_HEX.

Any comments on this, please?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko

As Sashiko pointed out in [1] the %*pEp makes the whole thing like "no escape". To add some sanity to this the used specifier also includes ESCAPE_HEX.

---

Just a Link tag (no Fixes et alia) as the escaping seems to be a guard that never fired so far.

The names are ASCII-only, but it's worth using escapes just in case we parse CMD-DB incorrectly.

Signature · 2 lines
With best wishes
Dmitry
maintainer Applied
#4 lore raw

Re: (subset) [PATCH v1 1/1] soc: qcom: cmd-db: Use %*pEhp specifier to add some sanity

In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

As Sashiko pointed out in [1] the %*pEp makes the whole thing like "no escape". To add some sanity to this the used specifier also includes ESCAPE_HEX.

Applied, thanks!

[1/1] soc: qcom: cmd-db: Use %*pEhp specifier to add some sanity

      commit: 467173658f6c10e130025d4c358ae28a8c47a889

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>