mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86, acpi/irq: Minor readability cleanup of gsi_to_irq()
@ 2012-03-29 16:48 Alexander Gordeev
  2012-03-30  7:15 ` Eric W. Biederman
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Gordeev @ 2012-03-29 16:48 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Eric W. Biederman, linux-kernel

Init value of 'irq' variable is never used. So do not initialize it.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 arch/x86/kernel/acpi/boot.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 406ed77..f148557 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -103,13 +103,11 @@ static u32 isa_irq_to_gsi[NR_IRQS_LEGACY] __read_mostly = {
 
 static unsigned int gsi_to_irq(unsigned int gsi)
 {
-	unsigned int irq = gsi + NR_IRQS_LEGACY;
-	unsigned int i;
+	unsigned int irq;
 
-	for (i = 0; i < NR_IRQS_LEGACY; i++) {
-		if (isa_irq_to_gsi[i] == gsi) {
-			return i;
-		}
+	for (irq = 0; irq < NR_IRQS_LEGACY; irq++) {
+		if (isa_irq_to_gsi[irq] == gsi)
+			return irq;
 	}
 
 	/* Provide an identity mapping of gsi == irq
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86, acpi/irq: Minor readability cleanup of gsi_to_irq()
  2012-03-29 16:48 [PATCH] x86, acpi/irq: Minor readability cleanup of gsi_to_irq() Alexander Gordeev
@ 2012-03-30  7:15 ` Eric W. Biederman
  0 siblings, 0 replies; 2+ messages in thread
From: Eric W. Biederman @ 2012-03-30  7:15 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: H. Peter Anvin, linux-kernel

Alexander Gordeev <agordeev@redhat.com> writes:

> Init value of 'irq' variable is never used. So do not initialize it.

Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>

> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---

Looks good to me.    I was going to ask what idiot wrote that silly
thing but it appears that idiot was me.    I must have rewritten
the function and forgotten to cleanup that initial assignment to irq.

That change makes it much clearer what is going on thank you.

Eric

>  arch/x86/kernel/acpi/boot.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> index 406ed77..f148557 100644
> --- a/arch/x86/kernel/acpi/boot.c
> +++ b/arch/x86/kernel/acpi/boot.c
> @@ -103,13 +103,11 @@ static u32 isa_irq_to_gsi[NR_IRQS_LEGACY] __read_mostly = {
>  
>  static unsigned int gsi_to_irq(unsigned int gsi)
>  {
> -	unsigned int irq = gsi + NR_IRQS_LEGACY;
> -	unsigned int i;
> +	unsigned int irq;
>  
> -	for (i = 0; i < NR_IRQS_LEGACY; i++) {
> -		if (isa_irq_to_gsi[i] == gsi) {
> -			return i;
> -		}
> +	for (irq = 0; irq < NR_IRQS_LEGACY; irq++) {
> +		if (isa_irq_to_gsi[irq] == gsi)
> +			return irq;
>  	}
>  
>  	/* Provide an identity mapping of gsi == irq

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-30  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 16:48 [PATCH] x86, acpi/irq: Minor readability cleanup of gsi_to_irq() Alexander Gordeev
2012-03-30  7:15 ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome