lkml.org 
[lkml]   [2017]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array.
Date
Allen Pais <allen.lkml@gmail.com> writes:

> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
> ---
> drivers/platform/x86/intel_telemetry_debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
> index d4fc42b..6b63b3d 100644
> --- a/drivers/platform/x86/intel_telemetry_debugfs.c
> +++ b/drivers/platform/x86/intel_telemetry_debugfs.c
> @@ -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}

What's the point? Why not simply replace all instances of TELEM_EVT_LEN
with ARRAY_SIZE?



Bjørn

\
 
 \ /
  Last update: 2017-09-13 12:03    [W:0.351 / U:1.372 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site