Message ID | 20250220112643.3813295-15-cezary.rojewski@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: codecs: Update device_id tables for Realtek drivers | expand |
On Thu, Feb 20, 2025 at 12:26:33PM +0100, Cezary Rojewski wrote: > There shall be no comma after the terminator entry and initializing > fields with 0 for statically defined structs is redundant. ... > static const struct acpi_device_id rt5660_acpi_match[] = { > - { "10EC5660", 0 }, > - { "10EC3277", 0 }, > - { }, > + { "10EC5660" }, > + { "10EC3277" }, > + {} > }; While at it, can you sort them alphabetically? Also, a side note: perhaps at some point you are going to remove those ugly ifdeffery around them along with unuseful ACPI_PTR() / of_match_ptr() calls. With that in some cases we can get rid of unneeded of.h and/or acpi.h inclusions (the ID table definitions come from mod_devicetable.h).
On 2025-02-20 3:13 PM, Andy Shevchenko wrote: > On Thu, Feb 20, 2025 at 12:26:33PM +0100, Cezary Rojewski wrote: >> There shall be no comma after the terminator entry and initializing >> fields with 0 for statically defined structs is redundant. > > ... > >> static const struct acpi_device_id rt5660_acpi_match[] = { >> - { "10EC5660", 0 }, >> - { "10EC3277", 0 }, >> - { }, >> + { "10EC5660" }, >> + { "10EC3277" }, >> + {} >> }; > > While at it, can you sort them alphabetically? Ack. > Also, a side note: perhaps at some point you are going to remove those ugly > ifdeffery around them along with unuseful ACPI_PTR() / of_match_ptr() calls. > With that in some cases we can get rid of unneeded of.h and/or acpi.h inclusions > (the ID table definitions come from mod_devicetable.h). I do not see a reason not to. We'll do so in a separate series to not mix the subjects though. This will probably also scale beyond 'just' rt*. Czarek
diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 3ac41d2c279b..fe8c27297599 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c @@ -1232,16 +1232,16 @@ MODULE_DEVICE_TABLE(i2c, rt5660_i2c_id); #ifdef CONFIG_OF static const struct of_device_id rt5660_of_match[] = { { .compatible = "realtek,rt5660", }, - {}, + {} }; MODULE_DEVICE_TABLE(of, rt5660_of_match); #endif #ifdef CONFIG_ACPI static const struct acpi_device_id rt5660_acpi_match[] = { - { "10EC5660", 0 }, - { "10EC3277", 0 }, - { }, + { "10EC5660" }, + { "10EC3277" }, + {} }; MODULE_DEVICE_TABLE(acpi, rt5660_acpi_match); #endif
There shall be no comma after the terminator entry and initializing fields with 0 for statically defined structs is redundant. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> --- sound/soc/codecs/rt5660.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)