Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752293AbdIMKRk (ORCPT ); Wed, 13 Sep 2017 06:17:40 -0400 Received: from mga05.intel.com ([192.55.52.43]:28189 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbdIMKRj (ORCPT ); Wed, 13 Sep 2017 06:17:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,387,1500966000"; d="scan'208";a="128304225" From: "Chakravarty, Souvik K" To: =?utf-8?B?QmrDuHJuIE1vcms=?= , Allen Pais CC: "linux-kernel@vger.kernel.org" , "platform-driver-x86@vger.kernel.org" Subject: RE: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array. Thread-Topic: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size calculation of the array. Thread-Index: AQHTLG3zWZYeNw8460WPvN+pUukANKKylgl/gAADoPA= Date: Wed, 13 Sep 2017 10:17:24 +0000 Message-ID: <5F7315E704FA0841B5DFCE90329B2BB4661DAD1D@BGSMSX102.gar.corp.intel.com> References: <1505292855-27476-1-git-send-email-allen.lkml@gmail.com> <874ls6kjbw.fsf@miraculix.mork.no> In-Reply-To: <874ls6kjbw.fsf@miraculix.mork.no> 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="utf-8" MIME-Version: 1.0 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 base64 to 8bit by nfs id v8DAHj2Q017467 Content-Length: 1515 Lines: 43 > -----Original Message----- > From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver- > x86-owner@vger.kernel.org] On Behalf Of Bjørn Mork > Sent: Wednesday, September 13, 2017 3:32 PM > To: Allen Pais > Cc: linux-kernel@vger.kernel.org; Chakravarty, Souvik K > ; platform-driver-x86@vger.kernel.org > Subject: Re: [PATCH v2] drivers:platform/x86:Use ARRAY_SIZE() for the size > calculation of the array. > > 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? I was about to say this too, although I should have probably said this in the first spin itself. > > > > Bjørn