diff mbox series

[v2,2/2] x86/quirks: better wrap quirk conditions

Message ID 20220106003654.770316-2-lucas.demarchi@intel.com
State New
Headers show
Series [v2,1/2] x86/quirks: Fix logic to apply quirk once | expand

Commit Message

Lucas De Marchi Jan. 6, 2022, 12:36 a.m. UTC
Remove extra parenthesis and wrap lines so it's easier to read what are
the conditions being checked. The call to the hook also had an extra
indentation: remove here to conform to coding style.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 arch/x86/kernel/early-quirks.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Bjorn Helgaas Jan. 6, 2022, 10:23 p.m. UTC | #1
On Wed, Jan 05, 2022 at 04:36:54PM -0800, Lucas De Marchi wrote:
> Remove extra parenthesis and wrap lines so it's easier to read what are
> the conditions being checked. The call to the hook also had an extra
> indentation: remove here to conform to coding style.

It's nice when your subject lines are consistent.  These look like:

  x86/quirks: Fix logic to apply quirk once
  x86/quirks: better wrap quirk conditions

The second isn't capitalized like the first.  Obviously if you split
the first patch, you'll have three subject lines, and one will mention
Alderlake.

Bjorn
Lucas De Marchi Jan. 6, 2022, 10:45 p.m. UTC | #2
On Thu, Jan 06, 2022 at 04:23:25PM -0600, Bjorn Helgaas wrote:
>On Wed, Jan 05, 2022 at 04:36:54PM -0800, Lucas De Marchi wrote:
>> Remove extra parenthesis and wrap lines so it's easier to read what are
>> the conditions being checked. The call to the hook also had an extra
>> indentation: remove here to conform to coding style.
>
>It's nice when your subject lines are consistent.  These look like:
>
>  x86/quirks: Fix logic to apply quirk once
>  x86/quirks: better wrap quirk conditions
>
>The second isn't capitalized like the first.  Obviously if you split

trying to maintain the entropy from

	git log --oneline --no-merges -- arch/x86/kernel/early-quirks.c

:). Jokes aside, yeah, my bad.

>the first patch, you'll have three subject lines, and one will mention
>Alderlake.

See my reply to the first patch - Alderlake is only the reproducer, but
it's broken in other platforms as well, as long as it's paired with an
Intel discrete gpu in the "right" pci slot.

It would be weird to send a patch "Fix xyz in Alderlake" and then
telling people with the same problem in Icelake that they are
missing that fix. So I went with the approach: 1) what is the generic
problem; 2) where it was initially reproduced.

thanks
Lucas De Marchi

>
>Bjorn
diff mbox series

Patch

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 102ecd0a910e..03256f802aba 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -766,14 +766,12 @@  static int __init check_dev_quirk(int num, int slot, int func)
 	device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
 
 	for (i = 0; early_qrk[i].f != NULL; i++) {
-		if (((early_qrk[i].vendor == PCI_ANY_ID) ||
-			(early_qrk[i].vendor == vendor)) &&
-			((early_qrk[i].device == PCI_ANY_ID) ||
-			(early_qrk[i].device == device)) &&
-			(!((early_qrk[i].class ^ class) &
-			    early_qrk[i].class_mask)))
-				early_qrk[i].f(num, slot, func);
-
+		if ((early_qrk[i].vendor == PCI_ANY_ID ||
+		     early_qrk[i].vendor == vendor) &&
+		    (early_qrk[i].device == PCI_ANY_ID ||
+		     early_qrk[i].device == device) &&
+		    !((early_qrk[i].class ^ class) & early_qrk[i].class_mask))
+			early_qrk[i].f(num, slot, func);
 	}
 
 	type = read_pci_config_byte(num, slot, func,