From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC5F8481226 for ; Tue, 19 May 2026 10:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779185226; cv=none; b=W0ta+4AUS4Keip43yew/vAAwWR+gQcSG4UMOZZtaW52rq6uAATVZlXh7GU2ycC3eft/lSVxflqyB1lMQsrMXEJxOyu8Yf09CxeriQN4oKebWnJbCOgGffD/tcyU3Eaa16wnjPqGXRWYFxjcPAWpLnv2r4JIO0B28I8dT7/pYKG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779185226; c=relaxed/simple; bh=L5Slw9bkugmP424w3w1mHtahMW7LPmAk115Dd26N87s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vuezte0Fj05CyYxRSaLAxWmRAE9D7NOrNtddldVbVDBCeHiqCAjJItXRZRRw6Bz8MS1b+f7KJqeoYjwNMbRERchOZrpcKDgx7o+xK4faV61Eq/kBudeACnJHdBDmaPDm0ttsNcUHmAJKkWpGBwKYX1oFr6DnM2kc8KavFhxGBCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=i8vcf2PV; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i8vcf2PV" Received: from killaraus.ideasonboard.com (unknown [IPv6:2a01:cb1d:8f2:800:42d6:38fa:3bdf:70df]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CF889296; Tue, 19 May 2026 12:06:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1779185209; bh=L5Slw9bkugmP424w3w1mHtahMW7LPmAk115Dd26N87s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i8vcf2PVYU0o28ZfJUaiUQPQ+mVn2Cn1EspcxVFTzDddWl6CN+fN0gpWseLQPC5TQ sCqJhQIuNV1sa7GDbwNEmgM4Wwx5rCV//PWl0C+E433U06Vr0XTEDX9qmEfzVVlbXB KWY++GWhR7x6HLG2D4hMnGiLYsx6fzfLedJQl4vs= Date: Tue, 19 May 2026 12:07:00 +0200 From: Laurent Pinchart To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig_=28The_Capable_Hub=29?= Cc: Liam Girdwood , Mark Brown , Michael Hennerich , Support Opensource , Ivaylo Ivanov , Claudiu Beznea , Andrei Simion , Saravanan Sekar , Matthias Brugger , AngeloGioacchino Del Regno , Woodrow Douglass , Jagan Teki , Icenowy Zheng , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v2 2/2] regulator: Use named initializers for arrays of i2c_device_data Message-ID: <20260519100700.GC45952@killaraus.ideasonboard.com> References: <9a8bfc7286221873ef02eeba0727eeaeb9e504e8.1779184320.git.u.kleine-koenig@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9a8bfc7286221873ef02eeba0727eeaeb9e504e8.1779184320.git.u.kleine-koenig@baylibre.com> On Tue, May 19, 2026 at 11:57:51AM +0200, Uwe Kleine-König (The Capable Hub) wrote: > While being less compact, using named initializers allows to more easily > see which members of the structs are assigned which value without having > to lookup the declaration of the struct. And it's also more robust > against changes to the struct definition. > > The mentioned robustness is relevant for a planned change to struct > i2c_device_id that replaces .driver_data by an anonymous union. > > While touching all these arrays, unify usage of whitespace and commas. > > This patch doesn't modify the compiled arrays, only their representation > in source form benefits. The former was confirmed with x86 and arm64 > builds. > > Signed-off-by: Uwe Kleine-König (The Capable Hub) > --- > drivers/regulator/88pg86x.c | 4 +-- > drivers/regulator/ad5398.c | 4 +-- > drivers/regulator/da9121-regulator.c | 20 +++++++-------- > drivers/regulator/da9210-regulator.c | 4 +-- > drivers/regulator/da9211-regulator.c | 18 +++++++------- > drivers/regulator/fan53880.c | 4 +-- > drivers/regulator/isl9305.c | 4 +-- > drivers/regulator/lp3971.c | 2 +- > drivers/regulator/lp3972.c | 2 +- > drivers/regulator/lp872x.c | 34 +++++++++++++------------- > drivers/regulator/lp8755.c | 4 +-- > drivers/regulator/ltc3589.c | 6 ++--- > drivers/regulator/ltc3676.c | 2 +- > drivers/regulator/max1586.c | 2 +- > drivers/regulator/max20086-regulator.c | 8 +++--- > drivers/regulator/max20411-regulator.c | 2 +- > drivers/regulator/max77503-regulator.c | 2 +- > drivers/regulator/max77675-regulator.c | 2 +- > drivers/regulator/max77826-regulator.c | 2 +- > drivers/regulator/max77838-regulator.c | 2 +- > drivers/regulator/max77857-regulator.c | 8 +++--- > drivers/regulator/max8649.c | 2 +- > drivers/regulator/max8893.c | 2 +- > drivers/regulator/max8952.c | 2 +- > drivers/regulator/mcp16502.c | 2 +- > drivers/regulator/mp5416.c | 6 ++--- > drivers/regulator/mp8859.c | 4 +-- > drivers/regulator/mp886x.c | 6 ++--- > drivers/regulator/mpq7920.c | 4 +-- > drivers/regulator/mt6311-regulator.c | 4 +-- > drivers/regulator/pf530x-regulator.c | 6 ++--- > drivers/regulator/pf8x00-regulator.c | 8 +++--- > drivers/regulator/pv88060-regulator.c | 4 +-- > drivers/regulator/pv88080-regulator.c | 8 +++--- > drivers/regulator/pv88090-regulator.c | 4 +-- > drivers/regulator/slg51000-regulator.c | 4 +-- > drivers/regulator/sy8106a-regulator.c | 2 +- > drivers/regulator/sy8824x.c | 8 +++--- > drivers/regulator/sy8827n.c | 4 +-- > drivers/regulator/tps6286x-regulator.c | 10 ++++---- > drivers/regulator/tps6287x-regulator.c | 10 ++++---- > 41 files changed, 118 insertions(+), 118 deletions(-) [snip] > diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c > index 942f37082cb1..779df653338a 100644 > --- a/drivers/regulator/lp872x.c > +++ b/drivers/regulator/lp872x.c > @@ -796,24 +796,24 @@ static const struct regmap_config lp872x_regmap_config = { > #define LP872X_VALID_OPMODE (REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL) > > static struct of_regulator_match lp8720_matches[] = { This is unrelated to the commit message that only mentions i2c_device_id. With this chunk dropped, Reviewed-by: Laurent Pinchart > - { .name = "ldo1", .driver_data = (void *)LP8720_ID_LDO1, }, > - { .name = "ldo2", .driver_data = (void *)LP8720_ID_LDO2, }, > - { .name = "ldo3", .driver_data = (void *)LP8720_ID_LDO3, }, > - { .name = "ldo4", .driver_data = (void *)LP8720_ID_LDO4, }, > - { .name = "ldo5", .driver_data = (void *)LP8720_ID_LDO5, }, > - { .name = "buck", .driver_data = (void *)LP8720_ID_BUCK, }, > + { .name = "ldo1", .driver_data = (void *)LP8720_ID_LDO1 }, > + { .name = "ldo2", .driver_data = (void *)LP8720_ID_LDO2 }, > + { .name = "ldo3", .driver_data = (void *)LP8720_ID_LDO3 }, > + { .name = "ldo4", .driver_data = (void *)LP8720_ID_LDO4 }, > + { .name = "ldo5", .driver_data = (void *)LP8720_ID_LDO5 }, > + { .name = "buck", .driver_data = (void *)LP8720_ID_BUCK }, > }; > > static struct of_regulator_match lp8725_matches[] = { > - { .name = "ldo1", .driver_data = (void *)LP8725_ID_LDO1, }, > - { .name = "ldo2", .driver_data = (void *)LP8725_ID_LDO2, }, > - { .name = "ldo3", .driver_data = (void *)LP8725_ID_LDO3, }, > - { .name = "ldo4", .driver_data = (void *)LP8725_ID_LDO4, }, > - { .name = "ldo5", .driver_data = (void *)LP8725_ID_LDO5, }, > - { .name = "lilo1", .driver_data = (void *)LP8725_ID_LILO1, }, > - { .name = "lilo2", .driver_data = (void *)LP8725_ID_LILO2, }, > - { .name = "buck1", .driver_data = (void *)LP8725_ID_BUCK1, }, > - { .name = "buck2", .driver_data = (void *)LP8725_ID_BUCK2, }, > + { .name = "ldo1", .driver_data = (void *)LP8725_ID_LDO1 }, > + { .name = "ldo2", .driver_data = (void *)LP8725_ID_LDO2 }, > + { .name = "ldo3", .driver_data = (void *)LP8725_ID_LDO3 }, > + { .name = "ldo4", .driver_data = (void *)LP8725_ID_LDO4 }, > + { .name = "ldo5", .driver_data = (void *)LP8725_ID_LDO5 }, > + { .name = "lilo1", .driver_data = (void *)LP8725_ID_LILO1 }, > + { .name = "lilo2", .driver_data = (void *)LP8725_ID_LILO2 }, > + { .name = "buck1", .driver_data = (void *)LP8725_ID_BUCK1 }, > + { .name = "buck2", .driver_data = (void *)LP8725_ID_BUCK2 }, > }; > > static struct lp872x_platform_data > @@ -935,8 +935,8 @@ static const struct of_device_id lp872x_dt_ids[] __maybe_unused = { > MODULE_DEVICE_TABLE(of, lp872x_dt_ids); > > static const struct i2c_device_id lp872x_ids[] = { > - {"lp8720", LP8720}, > - {"lp8725", LP8725}, > + { .name = "lp8720", .driver_data = LP8720 }, > + { .name = "lp8725", .driver_data = LP8725 }, > { } > }; > MODULE_DEVICE_TABLE(i2c, lp872x_ids); [snip] -- Regards, Laurent Pinchart