From deeccbf4e96de1cd4ed136f865b96a90db374886 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Sat, 4 Apr 2020 12:26:35 +0200 Subject: Drop explicit NULL initializations from `device_operations` Unmentioned fields are initialized with 0 (or NULL) implicitly. Beside that, the struct has grown over the years. There are too many optional fields to list them all. Change-Id: Icb9e14c58153d7c14817bcde148e86e977666e4b Signed-off-by: Elyes HAOUAS Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/coreboot/+/40126 Reviewed-by: Angel Pons Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/device/azalia_device.c | 1 - src/device/cardbus_device.c | 2 -- src/device/hypertransport.c | 2 -- src/device/pci_device.c | 4 ---- src/device/pciexp_device.c | 2 -- src/device/pcix_device.c | 2 -- 6 files changed, 13 deletions(-) (limited to 'src/device') diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 36a70f9ec7..152bde4fd4 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -251,6 +251,5 @@ struct device_operations default_azalia_audio_ops = { .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = azalia_audio_init, - .scan_bus = 0, .ops_pci = &azalia_audio_pci_ops, }; diff --git a/src/device/cardbus_device.c b/src/device/cardbus_device.c index e56202a1ed..b3dc669892 100644 --- a/src/device/cardbus_device.c +++ b/src/device/cardbus_device.c @@ -157,8 +157,6 @@ struct device_operations default_cardbus_ops_bus = { .read_resources = cardbus_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = cardbus_enable_resources, - .init = 0, .scan_bus = pci_scan_bridge, - .enable = 0, .reset_bus = pci_bus_reset, }; diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c index 4256550747..7815415a21 100644 --- a/src/device/hypertransport.c +++ b/src/device/hypertransport.c @@ -495,9 +495,7 @@ struct device_operations default_ht_ops_bus = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_bus_enable_resources, - .init = 0, .scan_bus = ht_scan_bridge, - .enable = 0, .reset_bus = pci_bus_reset, .ops_pci = &ht_bus_ops_pci, }; diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 0099470160..02cb5addfb 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -761,8 +761,6 @@ struct device_operations default_pci_ops_dev = { .acpi_fill_ssdt = pci_rom_ssdt, #endif .init = pci_dev_init, - .scan_bus = 0, - .enable = 0, .ops_pci = &pci_dev_ops_pci, }; @@ -775,9 +773,7 @@ struct device_operations default_pci_ops_bus = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_bus_enable_resources, - .init = 0, .scan_bus = pci_scan_bridge, - .enable = 0, .reset_bus = pci_bus_reset, .ops_pci = &pci_bus_ops_pci, }; diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c index 1a4854d381..07d559ac11 100644 --- a/src/device/pciexp_device.c +++ b/src/device/pciexp_device.c @@ -502,9 +502,7 @@ struct device_operations default_pciexp_ops_bus = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_bus_enable_resources, - .init = 0, .scan_bus = pciexp_scan_bridge, - .enable = 0, .reset_bus = pci_bus_reset, .ops_pci = &pciexp_bus_ops_pci, }; diff --git a/src/device/pcix_device.c b/src/device/pcix_device.c index 32ad16e51f..88f58b4995 100644 --- a/src/device/pcix_device.c +++ b/src/device/pcix_device.c @@ -123,9 +123,7 @@ struct device_operations default_pcix_ops_bus = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_bus_enable_resources, - .init = 0, .scan_bus = pcix_scan_bridge, - .enable = 0, .reset_bus = pci_bus_reset, .ops_pci = &pcix_bus_ops_pci, }; -- cgit v1.2.3