Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coresight: perf: Use %px for printing pointers

Use "%px" to print a pointer, which is better than casting the pointer
to unsigned long and printing it with the "%lx" specifier.

Note, the printing format will be updated as 64-bit value:

# cat /sys/devices/cs_etm/sinks/trbe0
0x000000003744496a

This commit dismisses the following smatch warnings:

coresight-etm-perf.c:854 etm_perf_sink_name_show() warn: argument 4 to %lx specifier is cast from pointer
coresight-etm-perf.c:946 etm_perf_cscfg_event_show() warn: argument 4 to %lx specifier is cast from pointer

Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250611-arm_cs_fix_smatch_warning_v1-v1-2-02a66c69b604@arm.com

authored by

Leo Yan and committed by
Suzuki K Poulose
fd4ed47e 3252ee43

+2 -2
+2 -2
drivers/hwtracing/coresight/coresight-etm-perf.c
··· 851 851 struct dev_ext_attribute *ea; 852 852 853 853 ea = container_of(dattr, struct dev_ext_attribute, attr); 854 - return scnprintf(buf, PAGE_SIZE, "0x%lx\n", (unsigned long)(ea->var)); 854 + return scnprintf(buf, PAGE_SIZE, "0x%px\n", ea->var); 855 855 } 856 856 857 857 static struct dev_ext_attribute * ··· 943 943 struct dev_ext_attribute *ea; 944 944 945 945 ea = container_of(dattr, struct dev_ext_attribute, attr); 946 - return scnprintf(buf, PAGE_SIZE, "configid=0x%lx\n", (unsigned long)(ea->var)); 946 + return scnprintf(buf, PAGE_SIZE, "configid=0x%px\n", ea->var); 947 947 } 948 948 949 949 int etm_perf_add_symlink_cscfg(struct device *dev, struct cscfg_config_desc *config_desc)