diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-12-10 16:01:14 +0200 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-12-17 13:13:01 +0200 |
commit | 3bc018395f106d11d8f882219bad76ca422d66df (patch) | |
tree | 66002e3ad7fb722c07e78471ced9cf3519c44084 /tools/perf/scripts/python | |
parent | 8fa1a2e1053ad780eaf48fc05e3a4a24bc809ee2 (diff) |
platform/x86/intel/tpmi/plr: Make char[] longer to silence warning
W=1 build triggers this warning:
drivers/platform/x86/intel/plr_tpmi.c:315:55: error: ‘snprintf’ output
may be truncated before the last format character
[-Werror=format-truncation=]
315 | snprintf(name, sizeof(name), "domain%d", i);
| ^
drivers/platform/x86/intel/plr_tpmi.c:315:17: note: ‘snprintf’ output
between 8 and 17 bytes into a destination of size 16
315 | snprintf(name, sizeof(name), "domain%d", i);
Inspecting the code tells that maximum i in intel_plr_probe() will fit
into u8 because it comes from:
struct intel_tpmi_pfs_entry {
...
u64 num_entries:8;
...but compiler does not know that. Saving one byte in name[] at the
expense of a warning with W=1 seems a bad trade so simply make it
name[17].
Link: https://lore.kernel.org/r/20241210140115.1375-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions