Skip to contentSkip to conversation

mmc: tmio: do not print real IOMEM pointer

PATCH In review Krzysztof Kozlowski 2 participants 2 messages Nov 16, 2020 – Nov 20, 2020

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

PATCH 1/1 mmc: tmio: do not print real IOMEM pointer

Printing kernel pointers is discouraged because they might leak kernel memory layout. This fixes smatch warning:

drivers/mmc/host/tmio_mmc.c:177 tmio_mmc_probe() warn: argument 3 to %08lx specifier is cast from pointer

---
 drivers/mmc/host/tmio_mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/tmio_mmc.c +1 -2
index d2d3b8df1bbe..b55a29c53d9c 100644
@@ -174,8 +174,7 @@ static int tmio_mmc_probe(struct platform_device *pdev)
 	if (ret)
 		goto host_remove;
 
-	pr_info("%s at 0x%08lx irq %d\n", mmc_hostname(host->mmc),
-		(unsigned long)host->ctl, irq);
+	pr_info("%s at 0x%p irq %d\n", mmc_hostname(host->mmc), host->ctl, irq);
 
 	return 0;
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Krzysztof Kozlowski

Printing kernel pointers is discouraged because they might leak kernel memory layout. This fixes smatch warning:

drivers/mmc/host/tmio_mmc.c:177 tmio_mmc_probe() warn: argument 3 to %08lx specifier is cast from pointer