Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752257AbdIMKC3 (ORCPT ); Wed, 13 Sep 2017 06:02:29 -0400 Received: from canardo.mork.no ([148.122.252.1]:45095 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbdIMKCZ (ORCPT ); Wed, 13 Sep 2017 06:02:25 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Allen Pais Cc: linux-kernel@vger.kernel.org, souvik.k.chakravarty@intel.com, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array. Organization: m References: <1505292855-27476-1-git-send-email-allen.lkml@gmail.com> Date: Wed, 13 Sep 2017 12:02:11 +0200 In-Reply-To: <1505292855-27476-1-git-send-email-allen.lkml@gmail.com> (Allen Pais's message of "Wed, 13 Sep 2017 14:24:15 +0530") Message-ID: <874ls6kjbw.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8DA2bOe017248 Content-Length: 877 Lines: 27 Allen Pais writes: > Signed-off-by: Allen Pais > --- > 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