public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: Fix warning in clock.c
@ 2006-10-04 13:28 Dirk Behme
  2006-10-05  7:48 ` Ladislav Michl
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2006-10-04 13:28 UTC (permalink / raw)
  To: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]


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>


[-- Attachment #2: clock_warning_patch.txt --]
[-- Type: text/plain, Size: 301 bytes --]

--- ./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
@@ -496,7 +496,7 @@ static int omap1_clk_enable_generic(stru
 		}
 	}
 
-	return;
+	return 0;
 }
 
 static void omap1_clk_disable_generic(struct clk *clk)


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ARM: OMAP: Fix warning in clock.c
  2006-10-04 13:28 [PATCH] ARM: OMAP: Fix warning in clock.c Dirk Behme
@ 2006-10-05  7:48 ` Ladislav Michl
  2006-10-05 13:22   ` Dirk Behme
  0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2006-10-05  7:48 UTC (permalink / raw)
  To: Dirk Behme; +Cc: linux-omap-open-source

On Wed, Oct 04, 2006 at 03:28:43PM +0200, Dirk Behme wrote:
> 
> 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
> @@ -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?


diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index f8e1294..45d0314 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -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);
 		}
 	}
 }

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

* Re: [PATCH] ARM: OMAP: Fix warning in clock.c
  2006-10-05  7:48 ` Ladislav Michl
@ 2006-10-05 13:22   ` Dirk Behme
  2006-10-06 12:52     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2006-10-05 13:22 UTC (permalink / raw)
  To: Ladislav Michl; +Cc: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

Ladislav Michl wrote:
> On Wed, Oct 04, 2006 at 03:28:43PM +0200, Dirk Behme wrote:
> 
>>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
>>@@ -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?

What's about something like in attachment?


[-- Attachment #2: clock_warning_patch.txt --]
[-- Type: text/plain, Size: 1114 bytes --]

--- ./arch/arm/mach-omap1/clock.c_orig	2006-10-05 15:10:17.000000000 +0200
+++ ./arch/arm/mach-omap1/clock.c	2006-10-05 15:14:26.000000000 +0200
@@ -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)


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ARM: OMAP: Fix warning in clock.c
  2006-10-05 13:22   ` Dirk Behme
@ 2006-10-06 12:52     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2006-10-06 12:52 UTC (permalink / raw)
  To: Dirk Behme; +Cc: Ladislav Michl, linux-omap-open-source

* Dirk Behme <dirk.behme@googlemail.com> [061005 16:28]:
> Ladislav Michl wrote:
> >On Wed, Oct 04, 2006 at 03:28:43PM +0200, Dirk Behme wrote:
> >
> >>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
> >>@@ -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?
> 
> What's about something like in attachment?
> 

> --- ./arch/arm/mach-omap1/clock.c_orig	2006-10-05 15:10:17.000000000 +0200
> +++ ./arch/arm/mach-omap1/clock.c	2006-10-05 15:14:26.000000000 +0200
> @@ -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)
> 

Pushed this one too.

Tony

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

end of thread, other threads:[~2006-10-06 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-04 13:28 [PATCH] ARM: OMAP: Fix warning in clock.c Dirk Behme
2006-10-05  7:48 ` Ladislav Michl
2006-10-05 13:22   ` Dirk Behme
2006-10-06 12:52     ` Tony Lindgren

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