drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array.
PATCH 1/1 drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array.
--- drivers/platform/x86/intel_telemetry_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_telemetry_debugfs.c +1 -1
@@ -76,7 +76,7 @@#define TELEM_IOSS_DX_D0IX_EVTS 25#define TELEM_IOSS_PG_EVTS 30 -#define TELEM_EVT_LEN (x) (sizeof(x)/sizeof((x)[0])) +#define TELEM_EVT_LEN (x) (ARRAY_SIZE(x))#define TELEM_DEBUGFS_CPU (model, data) \ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data}
Signature · 1 line
2.7.4
Hi Allen,
Quoted 21 lines
-----Original Message-----
From: [email protected] [mailto:platform-driver- [email protected]] On Behalf Of Allen Pais
Sent: Wednesday, September 13, 2017 1:33 PM
To: [email protected]
Cc: Chakravarty, Souvik K <[email protected]>; platform- [email protected]; Allen Pais <[email protected]>
Subject: [PATCH] drivers:platform/x86:UseARRAY_SIZE()for the size calculation of the array.Signed-off-by Allen Pais <[email protected]>--- drivers/platform/x86/intel_telemetry_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/intel_telemetry_debugfs.c +0
-0
drivers/platform/x86/intel_telemetry_debugfs.c line 79
Quoted 5 lines
drivers/platform/x86/intel_telemetry_debugfs.c +1
-1@@ -76,7 +76,7 @@#define TELEM_IOSS_DX_D0IX_EVTS 25#define TELEM_IOSS_PG_EVTS 30 -#define TELEM_EVT_LEN (x) (sizeof(x)/sizeof((x)[0])) +#define TELEM_EVT_LEN (x) (ARRAY_SIZE(x))
The outer parenthesis seems redundant to me.
Quoted 6 lines
drivers/platform/x86/intel_telemetry_debugfs.c +0
-1#define TELEM_DEBUGFS_CPU (model, data) \ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data} --2.7.4
BR,
Souvik
Quoted 6 lines
drivers/platform/x86/intel_telemetry_debugfs.c line 79
Quoted 4 lines
#define
TELEM_IOSS_PG_EVTS30drivers/platform/x86/intel_telemetry_debugfs.c +1
-1-#define TELEM_EVT_LEN (x) (sizeof(x)/sizeof((x)[0])) +#define TELEM_EVT_LEN (x) (ARRAY_SIZE(x))The outer parenthesis seems redundant to me.
Will send out a v2. Thanks.
- Allen