ACPI: Use named initializers for acpi_device_id arrays
Subsystems (8)
cover ACPI: Use named initializers for acpi_device_id arrays
From: Uwe Kleine-König <[email protected]>
Hello,
this series is about preparing drivers/acpi for a change to struct acpi_device_id. The idea is to replace .driver_data by an anonymous union, see
https://lore.kernel.org/all/[email protected]/
for more details. (The linked example is about platform_device_id, I intend to apply it acpi_device_id and several others, too.)
Before this union can be added, all initializers must use named initializers (C99 calls them designated initializers), which IMHO is a nice cleanup that can stand for itself as it makes the code easier to read.
Pawel sent a similar series earlier, find it at
https://lore.kernel.org/all/[email protected]/.
Compared to that the patch splitting is done differently and the base here is newer.
I checked for the other *_device_id and for these there is nothing to do below drivers/acpi because the few instances already use named initializers.
The last patch in this series is just some cosmetic to align the coding style. If you consider it churn, just drop it.
It would be great to get this series in soon, as keeping it up to date for a later resend is an annoying effort. Thanks for your cooperation.
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unify acpi_device_id list terminators
ACPI: Drop unused .driver_data initializers in acpi_device_id arrays
ACPI: Use named initializers for acpi_device_id arrays
ACPI: Unify *_device_id list terminators
drivers/acpi/ac.c | 6 +- drivers/acpi/acpi_apd.c | 46 +-- drivers/acpi/acpi_memhotplug.c | 4 +- drivers/acpi/acpi_pad.c | 4 +- drivers/acpi/acpi_platform.c | 12 +- drivers/acpi/acpi_pnp.c | 514 ++++++++++++------------ drivers/acpi/acpi_processor.c | 6 +- drivers/acpi/acpi_tad.c | 4 +- drivers/acpi/acpi_video.c | 4 +- drivers/acpi/apei/ghes-nvidia.c | 2 +- drivers/acpi/arm64/amba.c | 6 +- drivers/acpi/battery.c | 8 +- drivers/acpi/bus.c | 2 +- drivers/acpi/button.c | 14 +- drivers/acpi/container.c | 8 +- drivers/acpi/dptf/dptf_pch_fivr.c | 14 +- drivers/acpi/dptf/dptf_power.c | 38 +- drivers/acpi/ec.c | 8 +- drivers/acpi/evged.c | 4 +- drivers/acpi/fan_core.c | 2 +- drivers/acpi/hed.c | 4 +- drivers/acpi/mipi-disco-img.c | 2 +- drivers/acpi/nfit/core.c | 4 +- drivers/acpi/osi.c | 2 +- drivers/acpi/pci_link.c | 4 +- drivers/acpi/pci_root.c | 4 +- drivers/acpi/pci_slot.c | 2 +- drivers/acpi/pfr_telemetry.c | 4 +- drivers/acpi/pfr_update.c | 4 +- drivers/acpi/pmic/intel_pmic_bxtwc.c | 2 +- drivers/acpi/pmic/intel_pmic_chtdc_ti.c | 2 +- drivers/acpi/pmic/intel_pmic_chtwc.c | 2 +- drivers/acpi/power.c | 2 +- drivers/acpi/processor_driver.c | 6 +- drivers/acpi/processor_idle.c | 2 +- drivers/acpi/sbs.c | 4 +- drivers/acpi/sbshc.c | 6 +- drivers/acpi/scan.c | 48 +-- drivers/acpi/sleep.c | 2 +- drivers/acpi/thermal.c | 6 +- drivers/acpi/tiny-power-button.c | 6 +- drivers/acpi/video_detect.c | 2 +- drivers/acpi/x86/blacklist.c | 2 +- drivers/acpi/x86/cmos_rtc.c | 2 +- drivers/acpi/x86/lpss.c | 58 +-- drivers/acpi/x86/s2idle.c | 14 +- drivers/acpi/x86/utils.c | 22 +- include/linux/acpi.h | 8 +- 48 files changed, 466 insertions(+), 466 deletions(-)
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
Signature · 1 line
2.56.0.rc1
PATCH 1/4 ACPI: Unify acpi_device_id list terminators
Consistenly use an empty initializer with no trailing , for the list terminator. This doesn't introduce any changes to the compiled result of the modified drivers. Note that the first member of struct acpi_device_id is a char[] and not a pointer, so an explicit "" is eqivalent to the default initialisation.
--- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_memhotplug.c | 2 +- drivers/acpi/acpi_pad.c | 2 +- drivers/acpi/acpi_pnp.c | 2 +- drivers/acpi/acpi_tad.c | 2 +- drivers/acpi/arm64/amba.c | 2 +- drivers/acpi/battery.c | 2 +- drivers/acpi/button.c | 2 +- drivers/acpi/container.c | 2 +- drivers/acpi/dptf/dptf_pch_fivr.c | 2 +- drivers/acpi/dptf/dptf_power.c | 2 +- drivers/acpi/ec.c | 2 +- drivers/acpi/evged.c | 2 +- drivers/acpi/fan_core.c | 2 +- drivers/acpi/hed.c | 2 +- drivers/acpi/nfit/core.c | 2 +- drivers/acpi/pci_link.c | 2 +- drivers/acpi/pci_root.c | 2 +- drivers/acpi/pfr_telemetry.c | 2 +- drivers/acpi/pfr_update.c | 2 +- drivers/acpi/processor_driver.c | 2 +- drivers/acpi/sbs.c | 2 +- drivers/acpi/sbshc.c | 2 +- drivers/acpi/scan.c | 8 ++++---- drivers/acpi/thermal.c | 2 +- drivers/acpi/tiny-power-button.c | 2 +- drivers/acpi/x86/s2idle.c | 4 ++-- drivers/acpi/x86/utils.c | 4 ++-- include/linux/acpi.h | 2 +- 29 files changed, 34 insertions(+), 34 deletions(-)
drivers/acpi/ac.c +1 -1
@@ -33,7 +33,7 @@ MODULE_LICENSE("GPL");static const struct acpi_device_id ac_device_ids[] = { {"ACPI0003" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, ac_device_ids);
drivers/acpi/acpi_memhotplug.c +1 -1
@@ -22,7 +22,7 @@static const struct acpi_device_id memory_device_ids[] = { {ACPI_MEMORY_DEVICE_HID ,0 }, - {"" ,0 }, + { } };#ifdef CONFIG_ACPI_HOTPLUG_MEMORY
drivers/acpi/acpi_pad.c +1 -1
@@ -439,7 +439,7 @@ static void acpi_pad_remove(struct platform_device *pdev)static const struct acpi_device_id pad_device_ids[] = { {"ACPI000C" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, pad_device_ids);
drivers/acpi/acpi_pnp.c +1 -1
@@ -301,7 +301,7 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {/* snd-opl3sa2-pnpbios */ {"YMH0021"}, {"NMX2210"}, /* Gateway Solo 2500 */ - {""}, + { } };static bool matching_id (const char *idstr,const char *list_id)
drivers/acpi/acpi_tad.c +1 -1
@@ -896,7 +896,7 @@ static int acpi_tad_probe(struct platform_device *pdev)static const struct acpi_device_id acpi_tad_ids[] = { {"ACPI000E" ,0 }, - {} + { } };static struct platform_driver acpi_tad_driver = {
drivers/acpi/arm64/amba.c +1 -1
@@ -22,7 +22,7 @@static const struct acpi_device_id amba_id_list[] = { {"ARMH0061" ,0 },/* PL061 GPIO Device */ {"ARMH0330" ,0 },/* ARM DMA Controller DMA-330 */ - {"" ,0 }, + { } };static void amba_register_dummy_clk (void )
drivers/acpi/battery.c +1 -1
@@ -68,7 +68,7 @@ static const struct acpi_device_id battery_device_ids[] = {/* Microsoft Surface Go 3 */ {"MSHW0146", 0}, - {"", 0}, + { } };MODULE_DEVICE_TABLE (acpi, battery_device_ids);
drivers/acpi/button.c +1 -1
@@ -65,7 +65,7 @@ static const struct acpi_device_id button_device_ids[] = { {ACPI_BUTTON_HID_SLEEPF, ACPI_BUTTON_TYPE_SLEEP}, {ACPI_BUTTON_HID_POWER, ACPI_BUTTON_TYPE_POWER}, {ACPI_BUTTON_HID_POWERF, ACPI_BUTTON_TYPE_POWER}, - {"", 0}, + { } };MODULE_DEVICE_TABLE (acpi, button_device_ids);
drivers/acpi/container.c +1 -1
@@ -18,7 +18,7 @@ static const struct acpi_device_id container_device_ids[] = { {"ACPI0004", 0}, {"PNP0A05", 0}, {"PNP0A06", 0}, - {"", 0}, + { } };#ifdef CONFIG_ACPI_CONTAINER
drivers/acpi/dptf/dptf_pch_fivr.c +1 -1
@@ -153,7 +153,7 @@ static const struct acpi_device_id pch_fivr_device_ids[] = { {"INTC106B", 0}, {"INTC10A3", 0}, {"INTC10D7", 0}, - {"", 0}, + { } };MODULE_DEVICE_TABLE (acpi, pch_fivr_device_ids);
drivers/acpi/dptf/dptf_power.c +1 -1
@@ -242,7 +242,7 @@ static const struct acpi_device_id int3407_device_ids[] = { {"INTC1101", 0}, {"INTC10F7", 0}, {"INTC10F8", 0}, - {"", 0}, + { } };MODULE_DEVICE_TABLE (acpi, int3407_device_ids);
drivers/acpi/ec.c +1 -1
@@ -1808,7 +1808,7 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context)static const struct acpi_device_id ec_device_ids[] = { {"PNP0C09" ,0 }, {ACPI_ECDT_HID ,0 }, - {"" ,0 }, + { } };/*
drivers/acpi/evged.c +1 -1
@@ -180,7 +180,7 @@ static void ged_remove(struct platform_device *pdev)static const struct acpi_device_id ged_acpi_ids[] = { {"ACPI0013" }, - {}, + { } };static struct platform_driver ged_driver = {
drivers/acpi/fan_core.c +1 -1
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(min_trip_distance, "Minimum distance between fan speed trip poistatic const struct acpi_device_id fan_device_ids[] = {ACPI_FAN_DEVICE_IDS , - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, fan_device_ids);
drivers/acpi/hed.c +1 -1
@@ -18,7 +18,7 @@static const struct acpi_device_id acpi_hed_ids[] = { {"PNP0C33" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, acpi_hed_ids);
drivers/acpi/nfit/core.c +1 -1
@@ -3514,7 +3514,7 @@ EXPORT_SYMBOL_GPL(__acpi_nfit_notify);static const struct acpi_device_id acpi_nfit_ids[] = { {"ACPI0012" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, acpi_nfit_ids);
drivers/acpi/pci_link.c +1 -1
@@ -37,7 +37,7 @@ static void acpi_pci_link_remove(struct acpi_device *device);static const struct acpi_device_id link_device_ids[] = { {"PNP0C0F" ,0 }, - {"" ,0 }, + { } };static struct acpi_scan_handler pci_link_handler = {
drivers/acpi/pci_root.c +1 -1
@@ -42,7 +42,7 @@ static int acpi_pci_root_scan_dependent(struct acpi_device *adev)static const struct acpi_device_id root_device_ids[] = { {"PNP0A03" ,0 }, - {"" ,0 }, + { } };static struct acpi_scan_handler pci_root_handler = {
drivers/acpi/pfr_telemetry.c +1 -1
@@ -416,7 +416,7 @@ static int acpi_pfrt_log_probe(struct platform_device *pdev)static const struct acpi_device_id acpi_pfrt_log_ids[] = { {"INTC1081" }, - {} + { } };MODULE_DEVICE_TABLE (acpi, acpi_pfrt_log_ids);
drivers/acpi/pfr_update.c +1 -1
@@ -595,7 +595,7 @@ static int acpi_pfru_probe(struct platform_device *pdev)static const struct acpi_device_id acpi_pfru_ids[] = { {"INTC1080" }, - {} + { } };MODULE_DEVICE_TABLE (acpi, acpi_pfru_ids);
drivers/acpi/processor_driver.c +1 -1
@@ -38,7 +38,7 @@ static int acpi_processor_stop(struct device *dev);static const struct acpi_device_id processor_device_ids[] = { {ACPI_PROCESSOR_OBJECT_HID ,0 }, {ACPI_PROCESSOR_DEVICE_HID ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, processor_device_ids);
drivers/acpi/sbs.c +1 -1
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(cache_time, "cache time in milliseconds");static const struct acpi_device_id sbs_device_ids[] = { {"ACPI0002" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, sbs_device_ids);
drivers/acpi/sbshc.c +1 -1
@@ -35,7 +35,7 @@ static void acpi_smbus_hc_remove(struct platform_device *pdev);static const struct acpi_device_id sbs_device_ids[] = { {"ACPI0001" ,0 }, {"ACPI0005" ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, sbs_device_ids);
drivers/acpi/scan.c +4 -4
@@ -1077,7 +1077,7 @@ static bool acpi_wakeup_gpe_init(struct acpi_device *device)static const struct acpi_device_id button_device_ids[] = { {"PNP0C0D" ,0 },/* Lid */ {"PNP0C0E" ,0 },/* Sleep button */ - {"" ,0 }, + { } };struct acpi_device_wakeup *wakeup = &device->wakeup;const struct acpi_device_id *match;
@@ -1801,7 +1801,7 @@ static bool acpi_is_indirect_io_slave(struct acpi_device *device)struct acpi_device *parent =acpi_dev_parent (device);static const struct acpi_device_id indirect_io_hosts[] = { {"HISI0191" ,0 }, - {} + { } };return parent && !acpi_match_device_ids (parent, indirect_io_hosts);
@@ -1848,7 +1848,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)*/ {"BCM4752", }, {"LNV4752", }, - {} + { } };if (acpi_is_indirect_io_slave (device))
@@ -2356,7 +2356,7 @@ static void acpi_default_enumeration(struct acpi_device *device)static const struct acpi_device_id generic_device_ids[] = { {ACPI_DT_NAMESPACE_HID , }, - {"" , }, + { } }; static int acpi_generic_device_attach(struct acpi_device *adev,
drivers/acpi/thermal.c +1 -1
@@ -926,7 +926,7 @@ static const struct dev_pm_ops acpi_thermal_pm_ops = {static const struct acpi_device_id thermal_device_ids[] = { {ACPI_THERMAL_HID ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, thermal_device_ids);
drivers/acpi/tiny-power-button.c +1 -1
@@ -16,7 +16,7 @@ MODULE_PARM_DESC(power_signal, "Power button sends this signal to init");static const struct acpi_device_id tiny_power_button_device_ids[] = { {ACPI_BUTTON_HID_POWER ,0 }, {ACPI_BUTTON_HID_POWERF ,0 }, - {"" ,0 }, + { } };MODULE_DEVICE_TABLE (acpi, tiny_power_button_device_ids);
drivers/acpi/x86/s2idle.c +2 -2
@@ -123,7 +123,7 @@ MODULE_PARM_DESC(check_lps0_constraints, "Check LPS0 device constraints");static const struct acpi_device_id lps0_device_ids[] = { {"PNP0D80" , }, - {"" , }, + { } };/* Microsoft platform agnostic UUID */
@@ -524,7 +524,7 @@ static const struct acpi_device_id amd_hid_ids[] = { {"AMD0005", (kernel_ulong_t)&amd_picasso, }, {"AMDI0005", (kernel_ulong_t)&amd_picasso, }, {"AMDI0006", (kernel_ulong_t)&amd_cezanne, }, - {} + { } }; static int lps0_device_attach(struct acpi_device *adev,
drivers/acpi/x86/utils.c +2 -2
@@ -47,7 +47,7 @@ struct override_status_id { }; #define ENTRY(status, hid, uid, path, cpu_vfm, dmi...) { \ - { { hid, }, {} }, \ + { { hid, }, { } }, \ { X86_MATCH_VFM(cpu_vfm, NULL), {} }, \ { { .matches = dmi }, {} }, \ uid, \
@@ -470,7 +470,7 @@ static const struct acpi_device_id i2c_acpi_known_good_ids[] = { { "INT33FD", 0 }, /* Intel Crystal Cove PMIC */ { "INT34D3", 0 }, /* Intel Whiskey Cove PMIC */ { "NPCE69A", 0 }, /* Asus Transformer keyboard dock */ - {} + { } };bool acpi_quirk_skip_i2c_client_enumeration (struct acpi_device *adev)
include/linux/acpi.h +1 -1
@@ -831,7 +831,7 @@ int acpi_mrrm_max_mem_region(void); { "PNP0B00", }, \ { "PNP0B01", }, \ { "PNP0B02", }, \ - { "", } + { } extern bool cmos_rtc_platform_device_present;
Signature · 1 line
2.56.0.rc1
PATCH 2/4 ACPI: Drop unused .driver_data initializers in acpi_device_id arrays
In reply to Uwe Kleine-König (The Capable Hub)From: Uwe Kleine-König (The Capable Hub) <[email protected]>
Many drivers explicitly initialize the .driver_data member in their acpi_device_id arrays without actually using that value. Drop these assignments and while touching these lines use named initializers for .id and use consistent spacing.
--- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_memhotplug.c | 2 +- drivers/acpi/acpi_pad.c | 2 +- drivers/acpi/acpi_tad.c | 2 +- drivers/acpi/arm64/amba.c | 4 ++-- drivers/acpi/battery.c | 4 ++-- drivers/acpi/container.c | 6 +++--- drivers/acpi/dptf/dptf_pch_fivr.c | 12 +++++------ drivers/acpi/dptf/dptf_power.c | 36 +++++++++++++++---------------- drivers/acpi/ec.c | 4 ++-- drivers/acpi/hed.c | 2 +- drivers/acpi/nfit/core.c | 2 +- drivers/acpi/pci_link.c | 2 +- drivers/acpi/pci_root.c | 2 +- drivers/acpi/processor_driver.c | 4 ++-- drivers/acpi/sbs.c | 2 +- drivers/acpi/sbshc.c | 4 ++-- drivers/acpi/scan.c | 6 +++--- drivers/acpi/thermal.c | 2 +- drivers/acpi/tiny-power-button.c | 4 ++-- drivers/acpi/x86/utils.c | 14 ++++++------ 21 files changed, 59 insertions(+), 59 deletions(-)
drivers/acpi/ac.c +1 -1
@@ -32,7 +32,7 @@ MODULE_DESCRIPTION("ACPI AC Adapter Driver");MODULE_LICENSE ("GPL" );static const struct acpi_device_id ac_device_ids[] = { - {"ACPI0003" ,0 }, + { .id ="ACPI0003" }, { } };MODULE_DEVICE_TABLE (acpi, ac_device_ids);
drivers/acpi/acpi_memhotplug.c +1 -1
@@ -21,7 +21,7 @@#define ACPI_MEMORY_DEVICE_HID "PNP0C80"static const struct acpi_device_id memory_device_ids[] = { - {ACPI_MEMORY_DEVICE_HID ,0 }, + { .id =ACPI_MEMORY_DEVICE_HID }, { } };
drivers/acpi/acpi_pad.c +1 -1
@@ -438,7 +438,7 @@ static void acpi_pad_remove(struct platform_device *pdev) }static const struct acpi_device_id pad_device_ids[] = { - {"ACPI000C" ,0 }, + { .id ="ACPI000C" }, { } };MODULE_DEVICE_TABLE (acpi, pad_device_ids);
drivers/acpi/acpi_tad.c +1 -1
@@ -895,7 +895,7 @@ static int acpi_tad_probe(struct platform_device *pdev) }static const struct acpi_device_id acpi_tad_ids[] = { - {"ACPI000E" ,0 }, + { .id ="ACPI000E" }, { } };
drivers/acpi/arm64/amba.c +2 -2
@@ -20,8 +20,8 @@#include "init.h" static const struct acpi_device_id amba_id_list[] = { - {"ARMH0061" ,0 },/* PL061 GPIO Device */ - {"ARMH0330" ,0 },/* ARM DMA Controller DMA-330 */ + { .id ="ARMH0061" },/* PL061 GPIO Device */ + { .id ="ARMH0330" },/* ARM DMA Controller DMA-330 */ { } };
drivers/acpi/battery.c +2 -2
@@ -63,10 +63,10 @@ module_param(cache_time, uint, 0644);MODULE_PARM_DESC (cache_time,"cache time in milliseconds" );static const struct acpi_device_id battery_device_ids[] = { - {"PNP0C0A" ,0 }, + { .id ="PNP0C0A" },/* Microsoft Surface Go 3 */ - {"MSHW0146" ,0 }, + { .id ="MSHW0146" }, { } };
drivers/acpi/container.c +3 -3
@@ -15,9 +15,9 @@#include "internal.h" static const struct acpi_device_id container_device_ids[] = { - {"ACPI0004" ,0 }, - {"PNP0A05" ,0 }, - {"PNP0A06" ,0 }, + { .id ="ACPI0004" }, + { .id ="PNP0A05" }, + { .id ="PNP0A06" }, { } };
drivers/acpi/dptf/dptf_pch_fivr.c +6 -6
@@ -147,12 +147,12 @@ static void pch_fivr_remove(struct platform_device *pdev) }static const struct acpi_device_id pch_fivr_device_ids[] = { - {"INTC1045" ,0 }, - {"INTC1049" ,0 }, - {"INTC1064" ,0 }, - {"INTC106B" ,0 }, - {"INTC10A3" ,0 }, - {"INTC10D7" ,0 }, + { .id ="INTC1045" }, + { .id ="INTC1049" }, + { .id ="INTC1064" }, + { .id ="INTC106B" }, + { .id ="INTC10A3" }, + { .id ="INTC10D7" }, { } };MODULE_DEVICE_TABLE (acpi, pch_fivr_device_ids);
drivers/acpi/dptf/dptf_power.c +18 -18
@@ -224,24 +224,24 @@ static void dptf_power_remove(struct platform_device *pdev) }static const struct acpi_device_id int3407_device_ids[] = { - {"INT3407" ,0 }, - {"INT3532" ,0 }, - {"INTC1047" ,0 }, - {"INTC1050" ,0 }, - {"INTC1060" ,0 }, - {"INTC1061" ,0 }, - {"INTC1065" ,0 }, - {"INTC1066" ,0 }, - {"INTC106C" ,0 }, - {"INTC106D" ,0 }, - {"INTC10A4" ,0 }, - {"INTC10A5" ,0 }, - {"INTC10D8" ,0 }, - {"INTC10D9" ,0 }, - {"INTC1100" ,0 }, - {"INTC1101" ,0 }, - {"INTC10F7" ,0 }, - {"INTC10F8" ,0 }, + { .id ="INT3407" }, + { .id ="INT3532" }, + { .id ="INTC1047" }, + { .id ="INTC1050" }, + { .id ="INTC1060" }, + { .id ="INTC1061" }, + { .id ="INTC1065" }, + { .id ="INTC1066" }, + { .id ="INTC106C" }, + { .id ="INTC106D" }, + { .id ="INTC10A4" }, + { .id ="INTC10A5" }, + { .id ="INTC10D8" }, + { .id ="INTC10D9" }, + { .id ="INTC1100" }, + { .id ="INTC1101" }, + { .id ="INTC10F7" }, + { .id ="INTC10F8" }, { } };MODULE_DEVICE_TABLE (acpi, int3407_device_ids);
drivers/acpi/ec.c +2 -2
@@ -1806,8 +1806,8 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context) }static const struct acpi_device_id ec_device_ids[] = { - {"PNP0C09" ,0 }, - {ACPI_ECDT_HID ,0 }, + { .id ="PNP0C09" }, + { .id =ACPI_ECDT_HID }, { } };
drivers/acpi/hed.c +1 -1
@@ -17,7 +17,7 @@#include <acpi/hed.h> static const struct acpi_device_id acpi_hed_ids[] = { - {"PNP0C33" ,0 }, + { .id ="PNP0C33" }, { } };MODULE_DEVICE_TABLE (acpi, acpi_hed_ids);
drivers/acpi/nfit/core.c +1 -1
@@ -3513,7 +3513,7 @@ void __acpi_nfit_notify(struct device *dev, acpi_handle handle, u32 event)EXPORT_SYMBOL_GPL (__acpi_nfit_notify);static const struct acpi_device_id acpi_nfit_ids[] = { - {"ACPI0012" ,0 }, + { .id ="ACPI0012" }, { } };MODULE_DEVICE_TABLE (acpi, acpi_nfit_ids);
drivers/acpi/pci_link.c +1 -1
@@ -36,7 +36,7 @@ static int acpi_pci_link_add(struct acpi_device *device,static void acpi_pci_link_remove (struct acpi_device *device);static const struct acpi_device_id link_device_ids[] = { - {"PNP0C0F" ,0 }, + { .id ="PNP0C0F" }, { } };
drivers/acpi/pci_root.c +1 -1
@@ -41,7 +41,7 @@ static int acpi_pci_root_scan_dependent(struct acpi_device *adev) | OSC_PCI_MSI_SUPPORT) static const struct acpi_device_id root_device_ids[] = { - {"PNP0A03" ,0 }, + { .id ="PNP0A03" }, { } };
drivers/acpi/processor_driver.c +2 -2
@@ -36,8 +36,8 @@ MODULE_LICENSE("GPL");static int acpi_processor_stop (struct device *dev);static const struct acpi_device_id processor_device_ids[] = { - {ACPI_PROCESSOR_OBJECT_HID ,0 }, - {ACPI_PROCESSOR_DEVICE_HID ,0 }, + { .id =ACPI_PROCESSOR_OBJECT_HID }, + { .id =ACPI_PROCESSOR_DEVICE_HID }, { } };MODULE_DEVICE_TABLE (acpi, processor_device_ids);
drivers/acpi/sbs.c +1 -1
@@ -45,7 +45,7 @@ MODULE_PARM_DESC(cache_time, "cache time in milliseconds");#define ACPI_SBS_BLOCK_MAX 32static const struct acpi_device_id sbs_device_ids[] = { - {"ACPI0002" ,0 }, + { .id ="ACPI0002" }, { } };MODULE_DEVICE_TABLE (acpi, sbs_device_ids);
drivers/acpi/sbshc.c +2 -2
@@ -33,8 +33,8 @@ static int acpi_smbus_hc_probe(struct platform_device *pdev);static void acpi_smbus_hc_remove (struct platform_device *pdev);static const struct acpi_device_id sbs_device_ids[] = { - {"ACPI0001" ,0 }, - {"ACPI0005" ,0 }, + { .id ="ACPI0001" }, + { .id ="ACPI0005" }, { } };
drivers/acpi/scan.c +3 -3
@@ -1075,8 +1075,8 @@ static int acpi_bus_extract_wakeup_device_power_package(struct acpi_device *dev)static bool acpi_wakeup_gpe_init (struct acpi_device *device) {static const struct acpi_device_id button_device_ids[] = { - {"PNP0C0D" ,0 },/* Lid */ - {"PNP0C0E" ,0 },/* Sleep button */ + { .id ="PNP0C0D" },/* Lid */ + { .id ="PNP0C0E" },/* Sleep button */ { } };struct acpi_device_wakeup *wakeup = &device->wakeup;
@@ -1800,7 +1800,7 @@ static bool acpi_is_indirect_io_slave(struct acpi_device *device) {struct acpi_device *parent =acpi_dev_parent (device);static const struct acpi_device_id indirect_io_hosts[] = { - {"HISI0191" ,0 }, + { .id ="HISI0191" }, { } };
drivers/acpi/thermal.c +1 -1
@@ -925,7 +925,7 @@ static const struct dev_pm_ops acpi_thermal_pm_ops = {#endif /* CONFIG_PM_SLEEP */ static const struct acpi_device_id thermal_device_ids[] = { - {ACPI_THERMAL_HID ,0 }, + { .id =ACPI_THERMAL_HID }, { } };MODULE_DEVICE_TABLE (acpi, thermal_device_ids);
drivers/acpi/tiny-power-button.c +2 -2
@@ -14,8 +14,8 @@ module_param(power_signal, int, 0644);MODULE_PARM_DESC (power_signal,"Power button sends this signal to init" );static const struct acpi_device_id tiny_power_button_device_ids[] = { - {ACPI_BUTTON_HID_POWER ,0 }, - {ACPI_BUTTON_HID_POWERF ,0 }, + { .id =ACPI_BUTTON_HID_POWER }, + { .id =ACPI_BUTTON_HID_POWERF }, { } };MODULE_DEVICE_TABLE (acpi, tiny_power_button_device_ids);
drivers/acpi/x86/utils.c +7 -7
@@ -463,13 +463,13 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {#if IS_ENABLED (CONFIG_X86_ANDROID_TABLETS )static const struct acpi_device_id i2c_acpi_known_good_ids[] = { - {"10EC5640" ,0 },/* RealTek ALC5640 audio codec */ - {"10EC5651" ,0 },/* RealTek ALC5651 audio codec */ - {"INT33F4" ,0 },/* X-Powers AXP288 PMIC */ - {"INT33F5" ,0 },/* TI Dollar Cove PMIC */ - {"INT33FD" ,0 },/* Intel Crystal Cove PMIC */ - {"INT34D3" ,0 },/* Intel Whiskey Cove PMIC */ - {"NPCE69A" ,0 },/* Asus Transformer keyboard dock */ + { .id ="10EC5640" },/* RealTek ALC5640 audio codec */ + { .id ="10EC5651" },/* RealTek ALC5651 audio codec */ + { .id ="INT33F4" },/* X-Powers AXP288 PMIC */ + { .id ="INT33F5" },/* TI Dollar Cove PMIC */ + { .id ="INT33FD" },/* Intel Crystal Cove PMIC */ + { .id ="INT34D3" },/* Intel Whiskey Cove PMIC */ + { .id ="NPCE69A" },/* Asus Transformer keyboard dock */ { } };
Signature · 1 line
2.56.0.rc1
PATCH 3/4 ACPI: Use named initializers for acpi_device_id arrays
In reply to Uwe Kleine-König (The Capable Hub)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.
This patch doesn't modify the compiled arrays, only its representation in source form benefits.
--- drivers/acpi/acpi_apd.c | 46 +-- drivers/acpi/acpi_platform.c | 12 +- drivers/acpi/acpi_pnp.c | 512 ++++++++++++++++---------------- drivers/acpi/acpi_processor.c | 6 +- drivers/acpi/apei/ghes-nvidia.c | 2 +- drivers/acpi/button.c | 10 +- drivers/acpi/evged.c | 2 +- drivers/acpi/pfr_telemetry.c | 2 +- drivers/acpi/pfr_update.c | 2 +- drivers/acpi/scan.c | 34 +-- drivers/acpi/x86/cmos_rtc.c | 2 +- drivers/acpi/x86/lpss.c | 54 ++-- drivers/acpi/x86/s2idle.c | 10 +- drivers/acpi/x86/utils.c | 2 +- include/linux/acpi.h | 6 +- 15 files changed, 351 insertions(+), 351 deletions(-)
drivers/acpi/acpi_apd.c +23 -23
@@ -248,31 +248,31 @@ static int acpi_apd_create_device(struct acpi_device *adev,static const struct acpi_device_id acpi_apd_device_ids[] = {/* Generic apd devices */ #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE - {"AMD0010" ,APD_ADDR (cz_i2c_desc) }, - {"AMD0020" ,APD_ADDR (cz_uart_desc) }, - {"AMD0030" , }, - {"AMD0040" ,APD_ADDR (fch_misc_desc)}, - {"AMDI0010" ,APD_ADDR (wt_i2c_desc) }, - {"AMDI0015" ,APD_ADDR (wt_i3c_desc) }, - {"AMDI0019" ,APD_ADDR (wt_i2c_desc) }, - {"AMDI0020" ,APD_ADDR (cz_uart_desc) }, - {"AMDI0021" ,APD_ADDR (cz_uart_desc) }, - {"AMDI0022" ,APD_ADDR (cz_uart_desc) }, - {"HYGO0010" ,APD_ADDR (wt_i2c_desc) }, + { .id ="AMD0010" , .driver_data =APD_ADDR (cz_i2c_desc) }, + { .id ="AMD0020" , .driver_data =APD_ADDR (cz_uart_desc) }, + { .id ="AMD0030" , .driver_data = (unsigned long )NULL }, + { .id ="AMD0040" , .driver_data =APD_ADDR (fch_misc_desc)}, + { .id ="AMDI0010" , .driver_data =APD_ADDR (wt_i2c_desc) }, + { .id ="AMDI0015" , .driver_data =APD_ADDR (wt_i3c_desc) }, + { .id ="AMDI0019" , .driver_data =APD_ADDR (wt_i2c_desc) }, + { .id ="AMDI0020" , .driver_data =APD_ADDR (cz_uart_desc) }, + { .id ="AMDI0021" , .driver_data =APD_ADDR (cz_uart_desc) }, + { .id ="AMDI0022" , .driver_data =APD_ADDR (cz_uart_desc) }, + { .id ="HYGO0010" , .driver_data =APD_ADDR (wt_i2c_desc) }, #endif #ifdef CONFIG_ARM64 - {"APMC0D0F" ,APD_ADDR (xgene_i2c_desc) }, - {"BRCM900D" ,APD_ADDR (vulcan_spi_desc) }, - {"CAV900D" ,APD_ADDR (vulcan_spi_desc) }, - {"CAV9007" ,APD_ADDR (thunderx2_i2c_desc) }, - {"HISI02A1" ,APD_ADDR (hip07_i2c_desc) }, - {"HISI02A2" ,APD_ADDR (hip08_i2c_desc) }, - {"HISI02A3" ,APD_ADDR (hip08_lite_i2c_desc) }, - {"HISI0173" ,APD_ADDR (hip08_spi_desc) }, - {"HJMC3001" ,APD_ADDR (hjmc_i2c_desc) }, - {"LECA0002" ,APD_ADDR (leca_spi_desc) }, - {"LECA0003" ,APD_ADDR (leca_i2c_desc) }, - {"NXP0001" ,APD_ADDR (nxp_i2c_desc) }, + { .id ="APMC0D0F" , .driver_data =APD_ADDR (xgene_i2c_desc) }, + { .id ="BRCM900D" , .driver_data =APD_ADDR (vulcan_spi_desc) }, + { .id ="CAV900D" , .driver_data =APD_ADDR (vulcan_spi_desc) }, + { .id ="CAV9007" , .driver_data =APD_ADDR (thunderx2_i2c_desc) }, + { .id ="HISI02A1" , .driver_data =APD_ADDR (hip07_i2c_desc) }, + { .id ="HISI02A2" , .driver_data =APD_ADDR (hip08_i2c_desc) }, + { .id ="HISI02A3" , .driver_data =APD_ADDR (hip08_lite_i2c_desc) }, + { .id ="HISI0173" , .driver_data =APD_ADDR (hip08_spi_desc) }, + { .id ="HJMC3001" , .driver_data =APD_ADDR (hjmc_i2c_desc) }, + { .id ="LECA0002" , .driver_data =APD_ADDR (leca_spi_desc) }, + { .id ="LECA0003" , .driver_data =APD_ADDR (leca_i2c_desc) }, + { .id ="NXP0001" , .driver_data =APD_ADDR (nxp_i2c_desc) }, #endif { } };
drivers/acpi/acpi_platform.c +6 -6
@@ -25,12 +25,12 @@#define ACPI_ALLOW_WO_RESOURCES BIT(0)static const struct acpi_device_id forbidden_id_list[] = { - {"ACPI0009" ,0 },/* IOxAPIC */ - {"ACPI000A" ,0 },/* IOAPIC */ - {"PNP0000" ,0 },/* PIC */ - {"PNP0100" ,0 },/* Timer */ - {"PNP0200" ,0 },/* AT DMA Controller */ - {ACPI_SMBUS_MS_HID ,ACPI_ALLOW_WO_RESOURCES },/* ACPI SMBUS virtual device */ + { .id ="ACPI0009" , .driver_data =0 },/* IOxAPIC */ + { .id ="ACPI000A" , .driver_data =0 },/* IOAPIC */ + { .id ="PNP0000" , .driver_data =0 },/* PIC */ + { .id ="PNP0100" , .driver_data =0 },/* Timer */ + { .id ="PNP0200" , .driver_data =0 },/* AT DMA Controller */ + { .id =ACPI_SMBUS_MS_HID , .driver_data =ACPI_ALLOW_WO_RESOURCES },/* ACPI SMBUS virtual device */ { } };
drivers/acpi/acpi_pnp.c +256 -256
548 lines not on this page · raw message
drivers/acpi/acpi_processor.c +3 -3
@@ -631,8 +631,8 @@ void __init acpi_early_processor_control_setup(void)*/ static const struct acpi_device_id processor_device_ids[] = { - {ACPI_PROCESSOR_OBJECT_HID , }, - {ACPI_PROCESSOR_DEVICE_HID , }, + { .id =ACPI_PROCESSOR_OBJECT_HID }, + { .id =ACPI_PROCESSOR_DEVICE_HID }, { } };
@@ -655,7 +655,7 @@ static int acpi_processor_container_attach(struct acpi_device *dev, }static const struct acpi_device_id processor_container_ids[] = { - {ACPI_PROCESSOR_CONTAINER_HID , }, + { .id =ACPI_PROCESSOR_CONTAINER_HID }, { } };
drivers/acpi/apei/ghes-nvidia.c +1 -1
@@ -130,7 +130,7 @@ static int nvidia_ghes_probe(struct platform_device *pdev) }static const struct acpi_device_id nvidia_ghes_acpi_match[] = { - {"NVDA2012" }, + { .id ="NVDA2012" }, { } };MODULE_DEVICE_TABLE (acpi, nvidia_ghes_acpi_match);
drivers/acpi/button.c +5 -5
@@ -60,11 +60,11 @@ MODULE_DESCRIPTION("ACPI Button Driver");MODULE_LICENSE ("GPL" );static const struct acpi_device_id button_device_ids[] = { - {ACPI_BUTTON_HID_LID ,ACPI_BUTTON_TYPE_LID }, - {ACPI_BUTTON_HID_SLEEP ,ACPI_BUTTON_TYPE_SLEEP }, - {ACPI_BUTTON_HID_SLEEPF ,ACPI_BUTTON_TYPE_SLEEP }, - {ACPI_BUTTON_HID_POWER ,ACPI_BUTTON_TYPE_POWER }, - {ACPI_BUTTON_HID_POWERF ,ACPI_BUTTON_TYPE_POWER }, + { .id =ACPI_BUTTON_HID_LID , .driver_data =ACPI_BUTTON_TYPE_LID }, + { .id =ACPI_BUTTON_HID_SLEEP , .driver_data =ACPI_BUTTON_TYPE_SLEEP }, + { .id =ACPI_BUTTON_HID_SLEEPF , .driver_data =ACPI_BUTTON_TYPE_SLEEP }, + { .id =ACPI_BUTTON_HID_POWER , .driver_data =ACPI_BUTTON_TYPE_POWER }, + { .id =ACPI_BUTTON_HID_POWERF , .driver_data =ACPI_BUTTON_TYPE_POWER }, { } };MODULE_DEVICE_TABLE (acpi, button_device_ids);
drivers/acpi/evged.c +1 -1
@@ -179,7 +179,7 @@ static void ged_remove(struct platform_device *pdev) }static const struct acpi_device_id ged_acpi_ids[] = { - {"ACPI0013" }, + { .id ="ACPI0013" }, { } };
drivers/acpi/pfr_telemetry.c +1 -1
@@ -415,7 +415,7 @@ static int acpi_pfrt_log_probe(struct platform_device *pdev) }static const struct acpi_device_id acpi_pfrt_log_ids[] = { - {"INTC1081" }, + { .id ="INTC1081" }, { } };MODULE_DEVICE_TABLE (acpi, acpi_pfrt_log_ids);
drivers/acpi/pfr_update.c +1 -1
@@ -594,7 +594,7 @@ static int acpi_pfru_probe(struct platform_device *pdev) }static const struct acpi_device_id acpi_pfru_ids[] = { - {"INTC1080" }, + { .id ="INTC1080" }, { } };MODULE_DEVICE_TABLE (acpi, acpi_pfru_ids);
drivers/acpi/scan.c +17 -17
@@ -1821,33 +1821,33 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)* by the drivers/platform/x86/serial-multi-instantiate.c driver, which * knows which client device id to use for each resource. */ - {"AWDZ8399", }, - {"BSG1160", }, - {"BSG2150", }, - {"CSC3551", }, - {"CSC3554", }, - {"CSC3556", }, - {"CSC3557", }, - {"INT33FE", }, - {"INT3515", }, - {"TXNW2781", }, + { .id = "AWDZ8399" }, + { .id = "BSG1160" }, + { .id = "BSG2150" }, + { .id = "CSC3551" }, + { .id = "CSC3554" }, + { .id = "CSC3556" }, + { .id = "CSC3557" }, + { .id = "INT33FE" }, + { .id = "INT3515" }, + { .id = "TXNW2781" }, /* Non-conforming _HID for Cirrus Logic already released */ - {"CLSA0100", }, - {"CLSA0101", }, - {"CLSA0102", }, + { .id = "CLSA0100" }, + { .id = "CLSA0101" }, + { .id = "CLSA0102" }, /* * Some ACPI devs contain SerialBus resources even though they are not * attached to a serial bus at all. */ - {"MSHW0028", }, + { .id = "MSHW0028" }, /* * HIDs of device with an UartSerialBusV2 resource for which userspace * expects a regular tty cdev to be created (instead of the in kernel * serdev) and which have a kernel driver which expects a platform_dev * such as the rfkill-gpio driver. */ - {"BCM4752", }, - {"LNV4752", }, + { .id = "BCM4752" }, + { .id = "LNV4752" }, { } };
@@ -2355,7 +2355,7 @@ static void acpi_default_enumeration(struct acpi_device *device) }static const struct acpi_device_id generic_device_ids[] = { - {ACPI_DT_NAMESPACE_HID , }, + { .id =ACPI_DT_NAMESPACE_HID }, { } };
drivers/acpi/x86/cmos_rtc.c +1 -1
@@ -18,7 +18,7 @@#include "../internal.h" static const struct acpi_device_id acpi_cmos_rtc_ids[] = { - {"ACPI000E" ,1 },/* ACPI Time and Alarm Device (TAD) */ + { .id ="ACPI000E" , .driver_data =1 },/* ACPI Time and Alarm Device (TAD) */ ACPI_CMOS_RTC_IDS };
drivers/acpi/x86/lpss.c +27 -27
68 lines not on this page · raw message
drivers/acpi/x86/s2idle.c +5 -5
@@ -122,7 +122,7 @@ module_param(check_lps0_constraints, bool, 0644);MODULE_PARM_DESC (check_lps0_constraints,"Check LPS0 device constraints" );static const struct acpi_device_id lps0_device_ids[] = { - {"PNP0D80" , }, + { .id ="PNP0D80" }, { } };
@@ -520,10 +520,10 @@ static const struct amd_lps0_hid_device_data amd_cezanne = { };static const struct acpi_device_id amd_hid_ids[] = { - {"AMD0004" , (kernel_ulong_t)&amd_picasso, }, - {"AMD0005" , (kernel_ulong_t)&amd_picasso, }, - {"AMDI0005" , (kernel_ulong_t)&amd_picasso, }, - {"AMDI0006" , (kernel_ulong_t)&amd_cezanne, }, + { .id ="AMD0004" , .driver_data = (kernel_ulong_t)&amd_picasso }, + { .id ="AMD0005" , .driver_data = (kernel_ulong_t)&amd_picasso }, + { .id ="AMDI0005" , .driver_data = (kernel_ulong_t)&amd_picasso }, + { .id ="AMDI0006" , .driver_data = (kernel_ulong_t)&amd_cezanne }, { } };
drivers/acpi/x86/utils.c +1 -1
@@ -47,7 +47,7 @@ struct override_status_id { }; #define ENTRY(status, hid, uid, path, cpu_vfm, dmi...) { \ - { { hid, }, { } }, \ + { { .id = hid }, { } }, \ { X86_MATCH_VFM(cpu_vfm, NULL), {} }, \ { { .matches = dmi }, {} }, \ uid, \
include/linux/acpi.h +3 -3
@@ -828,9 +828,9 @@ int acpi_mrrm_max_mem_region(void);#endif #define ACPI_CMOS_RTC_IDS \ - { "PNP0B00", }, \ - { "PNP0B01", }, \ - { "PNP0B02", }, \ + { .id = "PNP0B00" }, \ + { .id = "PNP0B01" }, \ + { .id = "PNP0B02" }, \ { }extern bool cmos_rtc_platform_device_present;
Signature · 1 line
2.56.0.rc1
PATCH 4/4 ACPI: Unify *_device_id list terminators
In reply to Uwe Kleine-König (The Capable Hub)Consistenly use a single space and no trailing , for the list terminator. This doesn't introduce any changes to the compiled result of the modified drivers and just aligns these to the common style of the other device_id arrays.
--- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_video.c | 4 ++-- drivers/acpi/battery.c | 2 +- drivers/acpi/bus.c | 2 +- drivers/acpi/button.c | 2 +- drivers/acpi/ec.c | 2 +- drivers/acpi/mipi-disco-img.c | 2 +- drivers/acpi/osi.c | 2 +- drivers/acpi/pci_slot.c | 2 +- drivers/acpi/pmic/intel_pmic_bxtwc.c | 2 +- drivers/acpi/pmic/intel_pmic_chtdc_ti.c | 2 +- drivers/acpi/pmic/intel_pmic_chtwc.c | 2 +- drivers/acpi/power.c | 2 +- drivers/acpi/processor_idle.c | 2 +- drivers/acpi/sleep.c | 2 +- drivers/acpi/thermal.c | 2 +- drivers/acpi/video_detect.c | 2 +- drivers/acpi/x86/blacklist.c | 2 +- drivers/acpi/x86/lpss.c | 4 ++-- drivers/acpi/x86/utils.c | 4 ++-- 20 files changed, 23 insertions(+), 23 deletions(-)
drivers/acpi/ac.c +1 -1
@@ -187,7 +187,7 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "32597CG"), }, }, - {}, + { } };static int acpi_ac_probe (struct platform_device *pdev)
drivers/acpi/acpi_video.c +2 -2
@@ -92,7 +92,7 @@ enum acpi_video_level_idx {static const struct auxiliary_device_id video_bus_auxiliary_id_table[] = { { .name ="acpi.video_bus" }, - {}, + { } };MODULE_DEVICE_TABLE (auxiliary, video_bus_auxiliary_id_table);
@@ -518,7 +518,7 @@ static const struct dmi_system_id video_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "EasyNote MZ35"), }, }, - {} + { } }; static unsigned long long
drivers/acpi/battery.c +1 -1
@@ -1387,7 +1387,7 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"), }, }, - {}, + { } };static void acpi_battery_wakeup_cleanup (void *data)
drivers/acpi/bus.c +1 -1
@@ -66,7 +66,7 @@ static const struct dmi_system_id dsdt_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"), }, }, - {} + { } };#endif
drivers/acpi/button.c +1 -1
@@ -167,7 +167,7 @@ static const struct dmi_system_id dmi_lid_quirks[] = { }, .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, }, - {} + { } };static int acpi_button_probe (struct platform_device *pdev);
drivers/acpi/ec.c +1 -1
@@ -2017,7 +2017,7 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), }, }, - {} + { } };void __init acpi_ec_ecdt_probe (void )
drivers/acpi/mipi-disco-img.c +1 -1
@@ -736,7 +736,7 @@ static const struct x86_cpu_id dell_broken_mipi_disco_cpu_gens[] = {X86_MATCH_VFM (INTEL_RAPTORLAKE ,NULL ),X86_MATCH_VFM (INTEL_RAPTORLAKE_P ,NULL ), X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL), - {} + { } };static const char *strnext (const char *s1,const char *s2)
drivers/acpi/osi.c +1 -1
@@ -473,7 +473,7 @@ static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "1015PX"), }, }, - {} + { } };static __init void acpi_osi_dmi_blacklisted (void )
drivers/acpi/pci_slot.c +1 -1
@@ -178,7 +178,7 @@ static const struct dmi_system_id acpi_pci_slot_dmi_table[] __initconst = { DMI_MATCH(DMI_BIOS_VERSION, "PRIMEQUEST"), }, }, - {} + { } };void __init acpi_pci_slot_init (void )
drivers/acpi/pmic/intel_pmic_bxtwc.c +1 -1
@@ -395,7 +395,7 @@ static int intel_bxtwc_pmic_opregion_probe(struct platform_device *pdev)static const struct platform_device_id bxt_wc_opregion_id_table[] = { { .name ="bxt_wcove_region" }, - {}, + { } };static struct platform_driver intel_bxtwc_pmic_opregion_driver = {
drivers/acpi/pmic/intel_pmic_chtdc_ti.c +1 -1
@@ -127,7 +127,7 @@ static int chtdc_ti_pmic_opregion_probe(struct platform_device *pdev)static const struct platform_device_id chtdc_ti_pmic_opregion_id_table[] = { { .name ="chtdc_ti_region" }, - {}, + { } };static struct platform_driver chtdc_ti_pmic_opregion_driver = {
drivers/acpi/pmic/intel_pmic_chtwc.c +1 -1
@@ -275,7 +275,7 @@ static int intel_cht_wc_pmic_opregion_probe(struct platform_device *pdev)static const struct platform_device_id cht_wc_opregion_id_table[] = { { .name ="cht_wcove_region" }, - {}, + { } };static struct platform_driver intel_cht_wc_pmic_opregion_driver = {
drivers/acpi/power.c +1 -1
@@ -1093,7 +1093,7 @@ static const struct dmi_system_id dmi_hp_elitebook_gp12pxp_quirk[] = { DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 855 G7 Notebook PC"), }, }, - {} + { } }; static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
drivers/acpi/processor_idle.c +1 -1
@@ -105,7 +105,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")}, (void *)1}, - {}, + { } };
drivers/acpi/sleep.c +1 -1
@@ -407,7 +407,7 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { DMI_MATCH(DMI_PRODUCT_NAME, "20GGA00L00"), }, }, - {}, + { } };static bool ignore_blacklist;
drivers/acpi/thermal.c +1 -1
@@ -1014,7 +1014,7 @@ static const struct dmi_system_id thermal_dmi_table[] __initconst = { DMI_MATCH(DMI_BOARD_NAME, "7ZX"), }, }, - {} + { } };static int __init acpi_thermal_init (void )
drivers/acpi/video_detect.c +1 -1
@@ -986,7 +986,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"), }, }, - { }, + { } };static bool google_cros_ec_present (void )
drivers/acpi/x86/blacklist.c +1 -1
@@ -134,7 +134,7 @@ static const struct dmi_system_id acpi_rev_dmi_table[] __initconst = { }, },#endif - {} + { } };#endif /* CONFIG_DMI */
drivers/acpi/x86/lpss.c +2 -2
@@ -340,7 +340,7 @@ static const struct lpss_device_desc bsw_spi_dev_desc = {static const struct x86_cpu_id lpss_cpu_ids[] = {X86_MATCH_VFM (INTEL_ATOM_SILVERMONT ,NULL ),X86_MATCH_VFM (INTEL_ATOM_AIRMONT ,NULL ), - {} + { } };#else
@@ -493,7 +493,7 @@ static const struct dmi_system_id i2c1_dep_missing_dmi_ids[] = { DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"), }, }, - {} + { } };/*
drivers/acpi/x86/utils.c +2 -2
@@ -49,7 +49,7 @@ struct override_status_id { #define ENTRY(status, hid, uid, path, cpu_vfm, dmi...) { \ { { .id = hid }, { } }, \ { X86_MATCH_VFM(cpu_vfm, NULL), {} }, \ - { { .matches = dmi }, {} }, \ + { { .matches = dmi }, { } }, \ uid, \ path, \ status, \
@@ -458,7 +458,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), },#endif - {} + { } };#if IS_ENABLED (CONFIG_X86_ANDROID_TABLETS )
Signature · 1 line
2.56.0.rc1
[email protected]
AI reviewRe: [PATCH v1 2/4] ACPI: Drop unused .driver_data initializers in acpi_device_id arrays
In reply to Uwe Kleine-König (The Capable Hub)Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
From: Uwe Kleine-König (The Capable Hub) <[email protected]>
Many drivers explicitly initialize the .driver_data member in their
acpi_device_idarrays without actually using that value. Drop these assignments and while touching these lines use named initializers for .id and use consistent spacing.Signed-off-by Uwe Kleine-König (The Capable Hub) <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewRe: [PATCH v1 4/4] ACPI: Unify *_device_id list terminators
In reply to Uwe Kleine-König (The Capable Hub)Sashiko has reviewed this patch and found no issues.
Quoted 6 lines
Consistenly use a single space and no trailing , for the list terminator. This doesn't introduce any changes to the compiled result of the modified drivers and just aligns these to the common style of the other
device_idarrays.Signed-off-by Uwe Kleine-König (The Capable Hub) <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[email protected]
AI reviewRe: [PATCH v1 1/4] ACPI: Unify acpi_device_id list terminators
In reply to Uwe Kleine-König (The Capable Hub)Sashiko has reviewed this patch and found no issues.
Quoted 7 lines
Consistenly use an empty initializer with no trailing , for the list terminator. This doesn't introduce any changes to the compiled result of the modified drivers. Note that the first member of struct
acpi_device_idis a char[] and not a pointer, so an explicit "" is eqivalent to the default initialisation.Signed-off-by Uwe Kleine-König (The Capable Hub) <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rafael J. Wysocki (Intel)
maintainerQuoted 32 lines · Uwe Kleine-König (The Capable Hub)
From: Uwe Kleine-König <[email protected]>
Hello,
this series is about preparing
drivers/acpifor a change to structacpi_device_id. The idea is to replace .driver_data by an anonymous union, see
https://lore.kernel.org/all/[email protected]/
for more details. (The linked example is aboutplatform_device_id, I intend to apply itacpi_device_idand several others, too.)Before this union can be added, all initializers must use named initializers (C99 calls them designated initializers), which IMHO is a nice cleanup that can stand for itself as it makes the code easier to read.
Pawel sent a similar series earlier, find it at
https://lore.kernel.org/all/[email protected]/.
Compared to that the patch splitting is done differently and the base here is newer.I checked for the other
*_device_idand for these there is nothing to do belowdrivers/acpibecause the few instances already use named initializers.The last patch in this series is just some cosmetic to align the coding style. If you consider it churn, just drop it.
It would be great to get this series in soon, as keeping it up to date for a later resend is an annoying effort. Thanks for your cooperation.
Quoted 8 lines
Best regards
UweUwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminators
All patches applied as 7.5 material, thanks!
Quoted 37 lines · Rafael J. Wysocki (Intel)
Quoted 35 lines · Uwe Kleine-König (The Capable Hub)
From: Uwe Kleine-König <[email protected]>
Hello,
this series is about preparing
drivers/acpifor a change to structacpi_device_id. The idea is to replace .driver_data by an anonymous union, see
https://lore.kernel.org/all/[email protected]/
for more details. (The linked example is aboutplatform_device_id, I intend to apply itacpi_device_idand several others, too.)Before this union can be added, all initializers must use named initializers (C99 calls them designated initializers), which IMHO is a nice cleanup that can stand for itself as it makes the code easier to read.
Pawel sent a similar series earlier, find it at
https://lore.kernel.org/all/[email protected]/.
Compared to that the patch splitting is done differently and the base here is newer.I checked for the other
*_device_idand for these there is nothing to do belowdrivers/acpibecause the few instances already use named initializers.The last patch in this series is just some cosmetic to align the coding style. If you consider it churn, just drop it.
It would be great to get this series in soon, as keeping it up to date for a later resend is an annoying effort. Thanks for your cooperation.
Best regards
Uwe
Quoted 7 lines
Quoted 5 lines
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminatorsAll patches applied as 7.5 material, thanks!
That's great, thank you.
I fatfingered my author address in patch 2, so if someone wails that the author S-o-b is missing and your tree isn't set in stone yet, something like:
git filter-branch -f --env-filter 'if test "$GIT_AUTHOR_NAME" = "Uwe Kleine-König (The Capable Hub)"; then [email protected]; fi' next/master..
should fix it. Sorry!
Best regards
Uwe
Rafael J. Wysocki (Intel)
maintainerQuoted 47 lines · Uwe Kleine-König (The Capable Hub)
Quoted 37 lines · Rafael J. Wysocki (Intel)
Quoted 35 lines · Uwe Kleine-König (The Capable Hub)
From: Uwe Kleine-König <[email protected]>
Hello,
this series is about preparing
drivers/acpifor a change to structacpi_device_id. The idea is to replace .driver_data by an anonymous union, see
https://lore.kernel.org/all/[email protected]/
for more details. (The linked example is aboutplatform_device_id, I intend to apply itacpi_device_idand several others, too.)Before this union can be added, all initializers must use named initializers (C99 calls them designated initializers), which IMHO is a nice cleanup that can stand for itself as it makes the code easier to read.
Pawel sent a similar series earlier, find it at
https://lore.kernel.org/all/[email protected]/.
Compared to that the patch splitting is done differently and the base here is newer.I checked for the other
*_device_idand for these there is nothing to do belowdrivers/acpibecause the few instances already use named initializers.The last patch in this series is just some cosmetic to align the coding style. If you consider it churn, just drop it.
It would be great to get this series in soon, as keeping it up to date for a later resend is an annoying effort. Thanks for your cooperation.
Best regards
UweQuoted 7 lines
Quoted 5 lines
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminatorsAll patches applied as 7.5 material, thanks!
Quoted 8 lines
That's great, thank you.
I fatfingered my author address in patch 2, so if someone wails that the author S-o-b is missing and your tree isn't set in stone yet, something like:
git filter-branch -f --env-filter 'if test "$GIT_AUTHOR_NAME" = "Uwe Kleine-König (The Capable Hub)"; then [email protected]; fi' next/master..
should fix it. Sorry!
Thanks for the heads-up, I fixed it up.
Hey Rafael,
Quoted 7 lines · Rafael J. Wysocki (Intel)
Quoted 5 lines
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminatorsAll patches applied as 7.5 material, thanks!
While rebasing these patches (as part of my wip tree that contains a lot more similar patches) to next-20261113 I hit some merge conflicts. If you tell me where you applied it, I can take a look and provide my merge conflict resolution to allow double checking.
Best regards
Uwe
Rafael J. Wysocki (Intel)
maintainerQuoted 10 lines · Uwe Kleine-König (The Capable Hub)
Hey Rafael,
Quoted 6 lines · Rafael J. Wysocki (Intel)
Quoted 5 lines
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminators
Quoted 6 lines
Quoted 1 line
All patches applied as 7.5 material, thanks!
While rebasing these patches (as part of my wip tree that contains a lot more similar patches) to next-20261113 I hit some merge conflicts. If you tell me where you applied it, I can take a look and provide my merge conflict resolution to allow double checking.
I've rebased a couple of patches on some material merged previously.
Please see
Hello Rafael,
Quoted 19 lines · Rafael J. Wysocki (Intel)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)
Hey Rafael,
Quoted 6 lines · Rafael J. Wysocki (Intel)
Quoted 5 lines
Uwe Kleine-König (The Capable Hub) (4):
ACPI: Unifyacpi_device_idlist terminators
ACPI: Drop unused .driver_data initializers inacpi_device_idarrays
ACPI: Use named initializers foracpi_device_idarrays
ACPI: Unify*_device_idlist terminatorsQuoted 6 lines
Quoted 1 line
All patches applied as 7.5 material, thanks!
While rebasing these patches (as part of my wip tree that contains a lot more similar patches) to next-20261113 I hit some merge conflicts. If you tell me where you applied it, I can take a look and provide my merge conflict resolution to allow double checking.
Quoted 5 lines
I've rebased a couple of patches on some material merged previously.
Please see
OK, it seems you already rebased on top of the commits that made my rebase a bit bumpy and you did the same resolutions as me. :thumbsup:
Best regards
Uwe