diff mbox series

[v3,2/3] x86/quirks: Improve line wrap on quirk conditions

Message ID 20220107210516.907834-2-lucas.demarchi@intel.com
State New
Headers show
Series [v3,1/3] x86/quirks: Replace QFLAG_APPLY_ONCE with static locals | expand

Commit Message

Lucas De Marchi Jan. 7, 2022, 9:05 p.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

Rodrigo Vivi Jan. 10, 2022, 5:11 p.m. UTC | #1
On Fri, Jan 07, 2022 at 01:05:15PM -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.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  arch/x86/kernel/early-quirks.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
> index 8b689c2b8cc7..df34963e23bf 100644
> --- a/arch/x86/kernel/early-quirks.c
> +++ b/arch/x86/kernel/early-quirks.c
> @@ -767,14 +767,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,
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 8b689c2b8cc7..df34963e23bf 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -767,14 +767,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,