mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Hoan Tran <hoan@os.amperecomputing.com>,
	Andy Shevchenko <andy@kernel.org>,
	Yang Shen <shenyang39@huawei.com>,
	Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>,
	Mika Westerberg <westeri@kernel.org>,
	Israel Cepeda <israel.a.cepeda.lopez@intel.com>,
	Hans de Goede <hansg@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 11/20] gpio: Use named initializers for acpi_device_id array
Date: Tue, 14 Jul 2026 11:28:51 +0300	[thread overview]
Message-ID: <alXzQ1lmiucQLMyh@ashevche-desk.local> (raw)
In-Reply-To: <b0d21017a30fa40dd737695140a08397c07dae88.1784013063.git.u.kleine-koenig@baylibre.com>

On Tue, Jul 14, 2026 at 09:24:12AM +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
> acpi_device_id that replaces .driver_data by an anonymous union.
> 
> This patch doesn't modify the compiled arrays, only their representation
> in source form benefits.

...

> +++ b/drivers/gpio/gpio-dwapb.c

>  static const struct acpi_device_id dwapb_acpi_match[] = {
> -	{"HISI0181", GPIO_REG_OFFSET_V1},
> -	{"APMC0D07", GPIO_REG_OFFSET_V1},
> -	{"APMC0D81", GPIO_REG_OFFSET_V2},
> -	{"FUJI200A", GPIO_REG_OFFSET_V1},
> -	{"LECA0001", GPIO_REG_OFFSET_V1},
> +	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
> +	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
> +	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
> +	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
> +	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },

While at it, sort them alphabetically by ID.
Please, check all your patches for the same opportunity.

	{ .id = "APMC0D07", .driver_data = GPIO_REG_OFFSET_V1 },
	{ .id = "APMC0D81", .driver_data = GPIO_REG_OFFSET_V2 },
	{ .id = "FUJI200A", .driver_data = GPIO_REG_OFFSET_V1 },
	{ .id = "HISI0181", .driver_data = GPIO_REG_OFFSET_V1 },
	{ .id = "LECA0001", .driver_data = GPIO_REG_OFFSET_V1 },

>  	{ }
>  };

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-07-14  8:29 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  7:24 [PATCH v1 00/20] gpio: Improvements around device-id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 01/20] gpio: Drop unused assignment of acpi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 02/20] gpio: max7301: Drop unused assignment of spi_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 03/20] gpio: mmio: Drop unused assignment of platform_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 04/20] gpio: ljca: Drop unused assignment of auxiliary_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-14  8:12   ` Sakari Ailus
2026-07-14  7:24 ` [PATCH v1 05/20] gpio: Add missing ACPI module annotations Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 06/20] gpio: sodaville: Add missing pci " Uwe Kleine-König (The Capable Hub)
2026-07-14  8:22   ` Andy Shevchenko
2026-07-14  7:24 ` [PATCH v1 07/20] gpio: Add missing OF " Uwe Kleine-König (The Capable Hub)
2026-07-14 13:55   ` Daniel Palmer
2026-07-24  7:24   ` Linus Walleij
2026-07-24 15:32   ` Frank Li
2026-07-14  7:24 ` [PATCH v1 08/20] gpio: pxa: Add missing platform " Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 09/20] gpio: Add missing dmi " Uwe Kleine-König (The Capable Hub)
2026-07-14  8:23   ` Andy Shevchenko
2026-07-14  8:36     ` Andy Shevchenko
2026-07-14  7:24 ` [PATCH v1 10/20] gpio: pl061: Use empty initializer for amba_id terminator Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 11/20] gpio: Use named initializers for acpi_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-14  8:28   ` Andy Shevchenko [this message]
2026-07-14  7:24 ` [PATCH v1 12/20] gpio: Use named initializers for spi_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 13/20] gpio: virtio: Use a named initializer for virtio_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-14  8:10   ` Viresh Kumar
2026-07-14  7:24 ` [PATCH v1 14/20] gpio: pcf857x: Use named initializers for of_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 15/20] gpio: Unify style of acpi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  8:26   ` Andy Shevchenko
2026-07-14  7:24 ` [PATCH v1 16/20] gpio: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 17/20] gpio: max77620: Unify style of platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 18/20] gpio: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  7:24 ` [PATCH v1 19/20] gpio: Unify style of pci_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  8:25   ` Andy Shevchenko
2026-07-14  7:24 ` [PATCH v1 20/20] gpio: Unify style of various *_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-14  8:10   ` Viresh Kumar
2026-07-14  8:12   ` Sakari Ailus
2026-07-14  8:37   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alXzQ1lmiucQLMyh@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=alan.borzeszkowski@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=brgl@kernel.org \
    --cc=hansg@kernel.org \
    --cc=hoan@os.amperecomputing.com \
    --cc=israel.a.cepeda.lopez@intel.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shenyang39@huawei.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=westeri@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®