From: Lucas De Marchi <lucas.demarchi@intel.com>
To: x86@kernel.org
Cc: "Dave Hansen" <dave.hansen@linux.intel.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-pci@vger.kernel.org, intel-gfx@lists.freedesktop.org,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Matt Roper" <matthew.d.roper@intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>
Subject: [PATCH v5 4/5] x86/quirks: Remove unused logic for flags
Date: Thu, 13 Jan 2022 16:28:42 -0800 [thread overview]
Message-ID: <20220114002843.2083382-4-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20220114002843.2083382-1-lucas.demarchi@intel.com>
The flags were only used to mark the quirk as applied when it was
requested to be called only once. Now all the users were converted to
use a static local variable, so this logic can be removed.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
arch/x86/kernel/early-quirks.c | 35 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 7c70977737de..1db4d92f8a85 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -695,37 +695,33 @@ static void __init apple_airport_reset(int bus, int slot, int func)
early_iounmap(mmio, BCM4331_MMIO_SIZE);
}
-#define QFLAG_APPLY_ONCE 0x1
-#define QFLAG_APPLIED 0x2
-#define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED)
struct chipset {
u32 vendor;
u32 device;
u32 class;
u32 class_mask;
- u32 flags;
void (*f)(int num, int slot, int func);
};
static struct chipset early_qrk[] __initdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
- PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, 0, nvidia_bugs },
+ PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, nvidia_bugs },
{ PCI_VENDOR_ID_VIA, PCI_ANY_ID,
- PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, 0, via_bugs },
+ PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, via_bugs },
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB,
- PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config },
+ PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, fix_hypertransport_config },
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS,
- PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs },
+ PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, ati_bugs },
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,
- PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd },
+ PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, ati_bugs_contd },
{ PCI_VENDOR_ID_INTEL, 0x3403, PCI_CLASS_BRIDGE_HOST,
- PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
+ PCI_BASE_CLASS_BRIDGE, intel_remapping_check },
{ PCI_VENDOR_ID_INTEL, 0x3405, PCI_CLASS_BRIDGE_HOST,
- PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
+ PCI_BASE_CLASS_BRIDGE, intel_remapping_check },
{ PCI_VENDOR_ID_INTEL, 0x3406, PCI_CLASS_BRIDGE_HOST,
- PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
+ PCI_BASE_CLASS_BRIDGE, intel_remapping_check },
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID,
- 0, intel_graphics_quirks },
+ intel_graphics_quirks },
/*
* HPET on the current version of the Baytrail platform has accuracy
* problems: it will halt in deep idle state - so we disable it.
@@ -735,9 +731,9 @@ static struct chipset early_qrk[] __initdata = {
* http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/atom-z8000-datasheet-vol-1.pdf
*/
{ PCI_VENDOR_ID_INTEL, 0x0f00,
- PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet},
+ PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, force_disable_hpet},
{ PCI_VENDOR_ID_BROADCOM, 0x4331,
- PCI_CLASS_NETWORK_OTHER, PCI_ANY_ID, 0, apple_airport_reset},
+ PCI_CLASS_NETWORK_OTHER, PCI_ANY_ID, apple_airport_reset},
{}
};
@@ -778,12 +774,9 @@ static int __init check_dev_quirk(int num, int slot, int func)
((early_qrk[i].device == PCI_ANY_ID) ||
(early_qrk[i].device == device)) &&
(!((early_qrk[i].class ^ class) &
- early_qrk[i].class_mask))) {
- if ((early_qrk[i].flags &
- QFLAG_DONE) != QFLAG_DONE)
- early_qrk[i].f(num, slot, func);
- early_qrk[i].flags |= QFLAG_APPLIED;
- }
+ early_qrk[i].class_mask)))
+ early_qrk[i].f(num, slot, func);
+
}
type = read_pci_config_byte(num, slot, func,
--
2.34.1
next prev parent reply other threads:[~2022-01-14 0:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 0:28 [PATCH v5 1/5] x86/quirks: Fix stolen detection with integrated + discrete GPU Lucas De Marchi
2022-01-14 0:28 ` [PATCH v5 2/5] x86/quirks: Stop using QFLAG_APPLY_ONCE in via_bugs() Lucas De Marchi
2022-01-14 0:28 ` [PATCH v5 3/5] x86/quirks: Stop using QFLAG_APPLY_ONCE in nvidia_bugs() Lucas De Marchi
2022-01-14 0:28 ` Lucas De Marchi [this message]
2022-01-14 0:28 ` [PATCH v5 5/5] x86/quirks: Improve line wrap on quirk conditions Lucas De Marchi
2022-01-18 9:40 ` [PATCH v5 1/5] x86/quirks: Fix stolen detection with integrated + discrete GPU Borislav Petkov
2022-01-18 16:36 ` Lucas De Marchi
2022-01-18 17:26 ` Borislav Petkov
2022-01-18 17:58 ` [Intel-gfx] " Bjorn Helgaas
2022-01-18 18:37 ` Borislav Petkov
2022-01-18 20:01 ` Bjorn Helgaas
2022-01-18 20:31 ` Borislav Petkov
2022-01-19 20:30 ` Lucas De Marchi
2022-01-19 20:58 ` Bjorn Helgaas
2022-01-18 19:05 ` Lucas De Marchi
2022-01-18 19:14 ` Borislav Petkov
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=20220114002843.2083382-4-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=bhelgaas@google.com \
--cc=dave.hansen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-pci@vger.kernel.org \
--cc=matthew.d.roper@intel.com \
--cc=mingo@redhat.com \
--cc=rodrigo.vivi@intel.com \
--cc=tglx@linutronix.de \
--cc=ville.syrjala@linux.intel.com \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).