lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Sep 2017 10:17:24 +0000
From:   "Chakravarty, Souvik K" <souvik.k.chakravarty@...el.com>
To:     Bjørn Mork <bjorn@...k.no>,
        Allen Pais <allen.lkml@...il.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "platform-driver-x86@...r.kernel.org" 
        <platform-driver-x86@...r.kernel.org>
Subject: RE: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size
 calculation of the array.



> -----Original Message-----
> From: platform-driver-x86-owner@...r.kernel.org [mailto:platform-driver-
> x86-owner@...r.kernel.org] On Behalf Of Bjørn Mork
> Sent: Wednesday, September 13, 2017 3:32 PM
> To: Allen Pais <allen.lkml@...il.com>
> Cc: linux-kernel@...r.kernel.org; Chakravarty, Souvik K
> <souvik.k.chakravarty@...el.com>; platform-driver-x86@...r.kernel.org
> Subject: Re: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size
> calculation of the array.
> 
> Allen Pais <allen.lkml@...il.com> writes:
> 
> > Signed-off-by: Allen Pais <allen.lkml@...il.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?
I was about to say this too, although I should have probably said this in the first spin itself.

> 
> 
> 
> Bjørn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ