Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdIMImy convert rfc822-to-8bit (ORCPT ); Wed, 13 Sep 2017 04:42:54 -0400 Received: from mga07.intel.com ([134.134.136.100]:64659 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbdIMImv (ORCPT ); Wed, 13 Sep 2017 04:42:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,386,1500966000"; d="scan'208";a="899784626" From: "Chakravarty, Souvik K" To: Allen Pais , "linux-kernel@vger.kernel.org" CC: "platform-driver-x86@vger.kernel.org" Subject: RE: [PATCH] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array. Thread-Topic: [PATCH] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array. Thread-Index: AQHTLGbMvHfLA8uCwEqc6mkHvCQq36KyeXTw Date: Wed, 13 Sep 2017 08:42:47 +0000 Message-ID: <5F7315E704FA0841B5DFCE90329B2BB4661DAC5A@BGSMSX102.gar.corp.intel.com> References: <1505289772-26045-1-git-send-email-allen.lkml@gmail.com> In-Reply-To: <1505289772-26045-1-git-send-email-allen.lkml@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1295 Lines: 39 Hi Allen, > -----Original Message----- > From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver- > x86-owner@vger.kernel.org] On Behalf Of Allen Pais > Sent: Wednesday, September 13, 2017 1:33 PM > To: linux-kernel@vger.kernel.org > Cc: Chakravarty, Souvik K ; platform- > driver-x86@vger.kernel.org; Allen Pais > Subject: [PATCH] drivers:platform/x86:Use ARRAY_SIZE() for the size > calculation of the array. > > 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..3ccc7ac 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)) The outer parenthesis seems redundant to me. > > #define TELEM_DEBUGFS_CPU(model, data) \ > { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned > long)&data} > -- > 2.7.4 BR, Souvik