Skip to contentSkip to conversation

cxl/region: fix format string for resource_size_t

PATCH Applied Arnd Bergmann 4 participants 5 messages Dec 4, 2025 – Jan 6 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/region: fix format string for resource_size_t

From: Arnd Bergmann <[email protected]>

The size of this type is architecture specific, and the recommended way to print it portably is through the custom %pap format string.

Fixes d6602e25819d ("cxl/region: Add support to indicate region has extended linear cache")
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/region.c +1 -1
index ae899f68551f..fc36a5413d3f 100644
@@ -759,7 +759,7 @@ static ssize_t extended_linear_cache_size_show(struct device *dev,
 	ACQUIRE(rwsem_read_intr, rwsem)(&cxl_rwsem.region);
 	if ((rc = ACQUIRE_ERR(rwsem_read_intr, &rwsem)))
 		return rc;
-	return sysfs_emit(buf, "%#llx\n", p->cache_size);
+	return sysfs_emit(buf, "%pap\n", &p->cache_size);
 }
 static DEVICE_ATTR_RO(extended_linear_cache_size);
 
Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The size of this type is architecture specific, and the recommended way to print it portably is through the custom %pap format string.

Fixes d6602e25819d ("cxl/region: Add support to indicate region has extended linear cache")
Quoted 16 lines
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/region.c +1 -1
index ae899f68551f..fc36a5413d3f 100644
@@ -759,7 +759,7 @@ static ssize_t extended_linear_cache_size_show(struct device *dev,
 	ACQUIRE(rwsem_read_intr, rwsem)(&cxl_rwsem.region);
 	if ((rc = ACQUIRE_ERR(rwsem_read_intr, &rwsem)))
 		return rc;
-	return sysfs_emit(buf, "%#llx\n", p->cache_size);
+	return sysfs_emit(buf, "%pap\n", &p->cache_size);
 }
 static DEVICE_ATTR_RO(extended_linear_cache_size);
 
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The size of this type is architecture specific, and the recommended way to print it portably is through the custom %pap format string.

Fixes d6602e25819d ("cxl/region: Add support to indicate region has extended linear cache")
maintainer Applied
#4 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The size of this type is architecture specific, and the recommended way to print it portably is through the custom %pap format string.

Fixes d6602e25819d ("cxl/region: Add support to indicate region has extended linear cache")

Applied to cxl/fixes
88c72bab77aaf389beccf762e112828253ca0564

DJ

Quoted 17 lines
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/region.c +1 -1
index ae899f68551f..fc36a5413d3f 100644
@@ -759,7 +759,7 @@ static ssize_t extended_linear_cache_size_show(struct device *dev,
 	ACQUIRE(rwsem_read_intr, rwsem)(&cxl_rwsem.region);
 	if ((rc = ACQUIRE_ERR(rwsem_read_intr, &rwsem)))
 		return rc;
-	return sysfs_emit(buf, "%#llx\n", p->cache_size);
+	return sysfs_emit(buf, "%pap\n", &p->cache_size);
 }
 static DEVICE_ATTR_RO(extended_linear_cache_size);