Skip to contentSkip to conversation

ARM: OMAP: Fix warning in clock.c

PATCH In review Dirk Behme 3 participants 4 messages Oct 4, 2006 – Oct 6, 2006

Subsystems (4)
lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

PATCH 1/1 ARM: OMAP: Fix warning in clock.c

Fix warning

arch/arm/mach-omap1/clock.c: In function 'omap1_clk_enable_generic':
arch/arm/mach-omap1/clock.c:499: warning: 'return' with no value, in function returning non-void

Signed-off-by Dirk Behme <dirk.behme_at_gmail.com>
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +1 -1
@@ -496,7 +496,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
-	return;
+	return 0;
 }
 
 static void omap1_clk_disable_generic(struct clk *clk)
#1 lore raw
Quoted 14 lines · Dirk Behme

Fix warning

arch/arm/mach-omap1/clock.c: In function 'omap1_clk_enable_generic':
arch/arm/mach-omap1/clock.c:499: warning: 'return' with no value, in function returning non-void

Signed-off-by Dirk Behme <dirk.behme_at_gmail.com>

arch/arm/mach-omap1/clock.c static int omap1_clk_enable_generic(stru · line 500

Quoted 6 lines
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +1 -1
@@ -496,7 +496,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
-	return;
+	return 0;
 }

Does it make sense to return any vaule at all? This functions return always 0. Perhaps in case there is no enable reg it should return something else. Btw, can this code run on omap2 cpu?

arch/arm/mach-omap1/clock.c +2 -4
index f8e1294..45d0314 100644
@@ -432,8 +432,7 @@ static int omap1_clk_enable(struct clk *
 			}
 
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_deny_idle(clk->parent);
+				omap1_clk_deny_idle(clk->parent);
 		}
 
 		ret = clk->enable(clk);
@@ -454,8 +453,7 @@ static void omap1_clk_disable(struct clk
 		if (likely(clk->parent)) {
 			omap1_clk_disable(clk->parent);
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_allow_idle(clk->parent);
+				omap1_clk_allow_idle(clk->parent);
 		}
 	}
 }
author
#2 lore raw
Quoted 18 lines · Ladislav Michl
Quoted 16 lines · Dirk Behme

Fix warning

arch/arm/mach-omap1/clock.c: In function 'omap1_clk_enable_generic':
arch/arm/mach-omap1/clock.c:499: warning: 'return' with no value, in function returning non-void

Signed-off-by Dirk Behme <dirk.behme_at_gmail.com>
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +0 -0
@@ -496,7 +496,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
Quoted 8 lines

arch/arm/mach-omap1/clock.c static int omap1_clk_enable_generic(stru · line 500

Quoted 3 lines
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +1 -1
-	return;
+	return 0;
 }

Does it make sense to return any vaule at all? This functions return always 0. Perhaps in case there is no enable reg it should return something else. Btw, can this code run on omap2 cpu?

What's about something like in attachment?

arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +4 -6
@@ -432,8 +432,7 @@ static int omap1_clk_enable(struct clk *
 			}
 
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_deny_idle(clk->parent);
+				omap1_clk_deny_idle(clk->parent);
 		}
 
 		ret = clk->enable(clk);
@@ -454,8 +453,7 @@ static void omap1_clk_disable(struct clk
 		if (likely(clk->parent)) {
 			omap1_clk_disable(clk->parent);
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_allow_idle(clk->parent);
+				omap1_clk_allow_idle(clk->parent);
 		}
 	}
 }
@@ -471,7 +469,7 @@ static int omap1_clk_enable_generic(stru
 	if (unlikely(clk->enable_reg == 0)) {
 		printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
 		       clk->name);
-		return 0;
+		return -EINVAL;
 	}
 
 	if (clk->flags & ENABLE_REG_32BIT) {
@@ -496,7 +494,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
-	return;
+	return 0;
 }
 
 static void omap1_clk_disable_generic(struct clk *clk)
reviewer
#3 lore raw
Quoted 65 lines · Dirk Behme
Quoted 19 lines · Ladislav Michl
Quoted 17 lines · Dirk Behme

Fix warning

arch/arm/mach-omap1/clock.c: In function 'omap1_clk_enable_generic':
arch/arm/mach-omap1/clock.c:499: warning: 'return' with no value, in function returning non-void

Signed-off-by Dirk Behme <dirk.behme_at_gmail.com>

--- ./arch/arm/mach-omap1/clock.c_orig 2006-10-04
15:07:39.000000000 +0200
+++ ./arch/arm/mach-omap1/clock.c 2006-10-04 15:09:41.000000000 +0200

(quoted diff) +0 -0
@@ -496,7 +496,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
Quoted 8 lines

arch/arm/mach-omap1/clock.c static int omap1_clk_enable_generic(stru · line 498

Quoted 3 lines
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +1 -1
-	return;
+	return 0;
 }

Does it make sense to return any vaule at all? This functions return always 0. Perhaps in case there is no enable reg it should return something else. Btw, can this code run on omap2 cpu?

What's about something like in attachment?

arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +3 -5
@@ -432,8 +432,7 @@ static int omap1_clk_enable(struct clk *
 			}
 
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_deny_idle(clk->parent);
+				omap1_clk_deny_idle(clk->parent);
 		}
 
 		ret = clk->enable(clk);
@@ -454,8 +453,7 @@ static void omap1_clk_disable(struct clk
 		if (likely(clk->parent)) {
 			omap1_clk_disable(clk->parent);
 			if (clk->flags & CLOCK_NO_IDLE_PARENT)
-				if (!cpu_is_omap24xx())
-					omap1_clk_allow_idle(clk->parent);
+				omap1_clk_allow_idle(clk->parent);
 		}
 	}
 }
@@ -471,7 +469,7 @@ static int omap1_clk_enable_generic(stru
 	if (unlikely(clk->enable_reg == 0)) {
 		printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
 		       clk->name);
-		return 0;
+		return -EINVAL;
 	}
 
 	if (clk->flags & ENABLE_REG_32BIT) {

arch/arm/mach-omap1/clock.c static int omap1_clk_enable_generic(stru · line 500

Quoted 8 lines
arch/arm/mach-omap1/clock.c renamed from arch/arm/mach-omap1/clock.c_orig +1 -1
@@ -496,7 +494,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
-	return;
+	return 0;
 }
 
 static void omap1_clk_disable_generic(struct clk *clk)

Pushed this one too.

Tony