Skip to contentSkip to conversation

soc: qcom: cmd-db: Properly endian swap the slv_id for debugfs

PATCH In review Stephen Boyd 2 participants 2 messages Apr 17, 2020

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

PATCH 1/1 soc: qcom: cmd-db: Properly endian swap the slv_id for debugfs

Read the slv_id properly by making sure the 16-bit number is endian swapped from little endian to CPU native before we read it to figure out what to print for the human readable name. Otherwise we may just show that all the elements in the cmd-db are "Unknown" which isn't right.

---
 drivers/soc/qcom/cmd-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/cmd-db.c +1 -1
index 4f8b739c6485..fc5610603b17 100644
@@ -254,7 +254,7 @@ static int cmd_db_debugfs_dump(struct seq_file *seq, void *p)
 		if (!rsc->slv_id)
 			break;
 
-		switch (rsc->slv_id) {
+		switch (le16_to_cpu(rsc->slv_id)) {
 		case CMD_DB_HW_ARC:
 			name = "ARC";
 			break;

base-commit: d6815c5c43d4f9d18e557d27fd27ae8d9cfd450c
prerequisite-patch-id: fc235b174200bb1b24876628a89a841d1c2e4aad
prerequisite-patch-id: df579afb4eaea4200733d9dffb1d75eef8d8360b

Signature · 1 line
Sent by a computer, using git, on the internet
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Stephen Boyd

Read the slv_id properly by making sure the 16-bit number is endian swapped from little endian to CPU native before we read it to figure out what to print for the human readable name. Otherwise we may just show that all the elements in the cmd-db are "Unknown" which isn't right.

Quoted 22 lines
---
 drivers/soc/qcom/cmd-db.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

base-commit: d6815c5c43d4f9d18e557d27fd27ae8d9cfd450c
prerequisite-patch-id: fc235b174200bb1b24876628a89a841d1c2e4aad
prerequisite-patch-id: df579afb4eaea4200733d9dffb1d75eef8d8360b

drivers/soc/qcom/cmd-db.c +1 -1
index 4f8b739c6485..fc5610603b17 100644
@@ -254,7 +254,7 @@ static int cmd_db_debugfs_dump(struct seq_file *seq, void *p)
 		if (!rsc->slv_id)
 			break;
 
-		switch (rsc->slv_id) {
+		switch (le16_to_cpu(rsc->slv_id)) {
 		case CMD_DB_HW_ARC:
 			name = "ARC";
 			break;