From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA8F9C021BC for ; Tue, 25 Feb 2025 14:10:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13F6710E6BD; Tue, 25 Feb 2025 14:10:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="bXvMIfYC"; dkim-atps=neutral Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D54210E6B7; Tue, 25 Feb 2025 14:10:01 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 28C3D441B4; Tue, 25 Feb 2025 14:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1740492600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uytzOtSSVbGCsPo9JFb4lZ5tAcQbIsTS1AThWYB6ruk=; b=bXvMIfYC3LugBAoKz5rha+iAQN2q+C3w7N4cDkVzq/br0cJOmjLVdzrcBYrJmxQaeF+XBY N8Mv1QIRVYhjS/6ibfT7D4qBCdJc4oSaJlKdrI1ZSuYEBagtknSaq4Y4aOI2zvNf5qf3vf F/ZX7q44HYD8zh3m/s/ZyxENiE8Sp1gl8ACCaJ69MB4FogoDNorcOl+w7zYutodshevj6D hr1m+M5yQUnnXG7gewtN6VYg1DYPNeE00cPp5kCtDQSydioQu2kpGg2RabSl3iybxAQItQ lBnTLZCesE7epFY7WrKfjm8Jyv/B4dldHgVIOqNDtHW8hVKbXt9EPhbMU0WLXQ== Date: Tue, 25 Feb 2025 15:09:57 +0100 From: Louis Chauvet To: Jim Cromie , linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com Subject: Re: [PATCH 08/63] dyndbg: drop NUM_TYPE_ARRAY Message-ID: Mail-Followup-To: Jim Cromie , linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com References: <20250125064619.8305-1-jim.cromie@gmail.com> <20250125064619.8305-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250125064619.8305-9-jim.cromie@gmail.com> X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdekudeltdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpefnohhuihhsucevhhgruhhvvghtuceolhhouhhishdrtghhrghuvhgvthessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepudeiffduffeivdejgfejheeuudekkedvjeeuffegfefghfffkeelgffgieevudejnecuffhomhgrihhnpegsohhothhlihhnrdgtohhmnecukfhppeeltddrkeelrdduieefrdduvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledtrdekledrudeifedruddvjedphhgvlhhopehlohhuihhsqdgthhgruhhvvghtqdhlrghpthhophdpmhgrihhlfhhrohhmpehlohhuihhsrdgthhgruhhvvghtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedugedprhgtphhtthhopehjihhmrdgtrhhomhhivgesghhmrghilhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehjsggrrhhonhesrghkrghmrghirdgtohhmpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnr dhorhhgpdhrtghpthhtohepuhhkrghsiigssegthhhrohhmihhumhdrohhrghdprhgtphhtthhopehinhhtvghlqdhgfhigqdhtrhihsghotheslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrghdprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheprghmugdqghhfgieslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrgh X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Le 25/01/2025 à 07:45, Jim Cromie a écrit : > ARRAY_SIZE works here, since array decl is complete. > > no functional change > > Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet > --- > include/linux/dynamic_debug.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h > index 2b0057058ecf..e458d4b838ac 100644 > --- a/include/linux/dynamic_debug.h > +++ b/include/linux/dynamic_debug.h > @@ -106,11 +106,9 @@ struct ddebug_class_map { > .mod_name = KBUILD_MODNAME, \ > .base = _base, \ > .map_type = _maptype, \ > - .length = NUM_TYPE_ARGS(char*, __VA_ARGS__), \ > + .length = ARRAY_SIZE(_var##_classnames), \ > .class_names = _var##_classnames, \ > } > -#define NUM_TYPE_ARGS(eltype, ...) \ > - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) > > /* encapsulate linker provided built-in (or module) dyndbg data */ > struct _ddebug_info { -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com