Skip to contentSkip to conversation

sparc: leds_resource.end assigned to itself in clock_board_probe()

PATCH Applied Roel Kluin 3 participants 5 messages Jan 14, 2010 – Jan 15, 2010 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 sparc: leds_resource.end assigned to itself in clock_board_probe()

These statements appear redundant.

---
Is there any reason to assign this to itself?

arch/sparc/kernel/central.c +0 -2
index f3b5466..773caf4 100644
@@ -99,7 +99,6 @@ static int __devinit clock_board_probe(struct of_device *op,
 
 	p->leds_resource.start = (unsigned long)
 		(p->clock_regs + CLOCK_CTRL);
-	p->leds_resource.end = p->leds_resource.end;
 	p->leds_resource.name = "leds";
 
 	p->leds_pdev.name = "sunfire-clockboard-leds";
@@ -194,7 +193,6 @@ static int __devinit fhc_probe(struct of_device *op,
 	if (!p->central) {
 		p->leds_resource.start = (unsigned long)
 			(p->pregs + FHC_PREGS_CTRL);
-		p->leds_resource.end = p->leds_resource.end;
 		p->leds_resource.name = "leds";
 
 		p->leds_pdev.name = "sunfire-fhc-leds";
#1 lore raw
Quoted 11 lines · On Thu, 14 Jan 2010 17:55:55 +0100 Roel Kluin <[email protected]> wrote:

These statements appear redundant.

---
Is there any reason to assign this to itself?

arch/sparc/kernel/central.c +0 -0
index f3b5466..773caf4 100644

arch/sparc/kernel/central.c static int __devinit clock_board_probe(struct · line 102

Quoted 4 lines
arch/sparc/kernel/central.c +0 -1
@@ -99,7 +99,6 @@ static int __devinit clock_board_probe(struct
 of_device *op, 
 	p->leds_resource.start = (unsigned long)
 		(p->clock_regs + CLOCK_CTRL);
-	p->leds_resource.end = p->leds_resource.end;

I have the feeling that the right fix is to have:

	p->leds_resource.end = p->leds_resource.start;

hence describing a 1 byte region.

	M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
author
#2 lore raw

It should be a 1 byte region.

---

Quoted 10 lines

Review static int __devinit clock_board_probe(struct · line 102

Quoted 7 lines

Is there any reason to assign this to itself?

(quoted diff) +0 -1
@@ -99,7 +99,6 @@ static int __devinit clock_board_probe(struct
 of_device *op, 
 	p->leds_resource.start = (unsigned long)
 		(p->clock_regs + CLOCK_CTRL);
-	p->leds_resource.end = p->leds_resource.end;

I have the feeling that the right fix is to have:

Quoted 3 lines
	p->leds_resource.end = p->leds_resource.start;

hence describing a 1 byte region.

arch/sparc/kernel/central.c +2 -2
index f3b5466..4589ca3 100644
@@ -99,7 +99,7 @@ static int __devinit clock_board_probe(struct of_device *op,
 
 	p->leds_resource.start = (unsigned long)
 		(p->clock_regs + CLOCK_CTRL);
-	p->leds_resource.end = p->leds_resource.end;
+	p->leds_resource.end = p->leds_resource.start;
 	p->leds_resource.name = "leds";
 
 	p->leds_pdev.name = "sunfire-clockboard-leds";
@@ -194,7 +194,7 @@ static int __devinit fhc_probe(struct of_device *op,
 	if (!p->central) {
 		p->leds_resource.start = (unsigned long)
 			(p->pregs + FHC_PREGS_CTRL);
-		p->leds_resource.end = p->leds_resource.end;
+		p->leds_resource.end = p->leds_resource.start;
 		p->leds_resource.name = "leds";
 
 		p->leds_pdev.name = "sunfire-fhc-leds";