Skip to content

Commit 69c42d4

Browse files
andy-shevIngo Molnar
authored andcommitted
x86/pci: Simplify code by using the new dmi_get_bios_year() helper
...instead of open coding its functionality. No changes in functionality. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 492a1ab commit 69c42d4

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

arch/x86/pci/acpi.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,8 @@ static const struct dmi_system_id pci_crs_quirks[] __initconst = {
140140

141141
void __init pci_acpi_crs_quirks(void)
142142
{
143-
int year;
144-
145-
if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) && year < 2008) {
146-
if (iomem_resource.end <= 0xffffffff)
147-
pci_use_crs = false;
148-
}
143+
if ((dmi_get_bios_year() < 2008) && (iomem_resource.end <= 0xffffffff))
144+
pci_use_crs = false;
149145

150146
dmi_check_system(pci_crs_quirks);
151147

arch/x86/pci/direct.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,13 @@ static const struct pci_raw_ops pci_direct_conf2 = {
195195
static int __init pci_sanity_check(const struct pci_raw_ops *o)
196196
{
197197
u32 x = 0;
198-
int year, devfn;
198+
int devfn;
199199

200200
if (pci_probe & PCI_NO_CHECKS)
201201
return 1;
202202
/* Assume Type 1 works for newer systems.
203203
This handles machines that don't have anything on PCI Bus 0. */
204-
dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL);
205-
if (year >= 2001)
204+
if (dmi_get_bios_year() >= 2001)
206205
return 1;
207206

208207
for (devfn = 0; devfn < 0x100; devfn++) {

arch/x86/pci/mmconfig-shared.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,19 +547,14 @@ static void __init pci_mmcfg_reject_broken(int early)
547547
static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
548548
struct acpi_mcfg_allocation *cfg)
549549
{
550-
int year;
551-
552550
if (cfg->address < 0xFFFFFFFF)
553551
return 0;
554552

555553
if (!strncmp(mcfg->header.oem_id, "SGI", 3))
556554
return 0;
557555

558-
if (mcfg->header.revision >= 1) {
559-
if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
560-
year >= 2010)
561-
return 0;
562-
}
556+
if ((mcfg->header.revision >= 1) && (dmi_get_bios_year() >= 2010))
557+
return 0;
563558

564559
pr_err(PREFIX "MCFG region for %04x [bus %02x-%02x] at %#llx "
565560
"is above 4GB, ignored\n", cfg->pci_segment,

0 commit comments

Comments
 (0)