public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] kernel/async.c: fixing compilation warnings
@ 2011-01-14 11:53 Viresh Kumar
  2011-01-14 13:13 ` Jack Stone
  0 siblings, 1 reply; 6+ messages in thread
From: Viresh Kumar @ 2011-01-14 11:53 UTC (permalink / raw)
  To: linux-kernel, jwjstone; +Cc: Viresh Kumar

This patch fixes following compilation warnings:
270:10: warning: ‘starttime.tv64’ may be used uninitialized in this function
122:10: warning: ‘calltime.tv64’ may be used uninitialized in this function

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 kernel/async.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/async.c b/kernel/async.c
index cd9dbb9..3ff777b 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work)
 	struct async_entry *entry =
 		container_of(work, struct async_entry, work);
 	unsigned long flags;
-	ktime_t calltime, delta, rettime;
+	ktime_t uninitialized_var(calltime), delta, rettime;
 
 	/* 1) move self to the running queue */
 	spin_lock_irqsave(&async_lock, flags);
@@ -267,7 +267,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
 void async_synchronize_cookie_domain(async_cookie_t cookie,
 				     struct list_head *running)
 {
-	ktime_t starttime, delta, endtime;
+	ktime_t uninitialized_var(starttime), delta, endtime;
 
 	if (initcall_debug && system_state == SYSTEM_BOOTING) {
 		printk("async_waiting @ %i\n", task_pid_nr(current));
-- 
1.7.2.2


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

* Re: [PATCH resend] kernel/async.c: fixing compilation warnings
  2011-01-14 11:53 [PATCH resend] kernel/async.c: fixing compilation warnings Viresh Kumar
@ 2011-01-14 13:13 ` Jack Stone
  2011-01-14 15:27   ` Arjan van de Ven
  0 siblings, 1 reply; 6+ messages in thread
From: Jack Stone @ 2011-01-14 13:13 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-kernel, arjan

[cc Arjan van de Ven]
On 14/01/2011 11:53, Viresh Kumar wrote:
> This patch fixes following compilation warnings:
> 270:10: warning: ‘starttime.tv64’ may be used uninitialized in this function
> 122:10: warning: ‘calltime.tv64’ may be used uninitialized in this function
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>

Looks good to me

Reviewed-by: Jack Stone <jwjstone@fastmail.fm>
> ---
>  kernel/async.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/async.c b/kernel/async.c
> index cd9dbb9..3ff777b 100644
> --- a/kernel/async.c
> +++ b/kernel/async.c
> @@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work)
>  	struct async_entry *entry =
>  		container_of(work, struct async_entry, work);
>  	unsigned long flags;
> -	ktime_t calltime, delta, rettime;
> +	ktime_t uninitialized_var(calltime), delta, rettime;
>  
>  	/* 1) move self to the running queue */
>  	spin_lock_irqsave(&async_lock, flags);
> @@ -267,7 +267,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
>  void async_synchronize_cookie_domain(async_cookie_t cookie,
>  				     struct list_head *running)
>  {
> -	ktime_t starttime, delta, endtime;
> +	ktime_t uninitialized_var(starttime), delta, endtime;
>  
>  	if (initcall_debug && system_state == SYSTEM_BOOTING) {
>  		printk("async_waiting @ %i\n", task_pid_nr(current));


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

* Re: [PATCH resend] kernel/async.c: fixing compilation warnings
  2011-01-14 13:13 ` Jack Stone
@ 2011-01-14 15:27   ` Arjan van de Ven
  2011-01-14 18:39     ` Jack Stone
  0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2011-01-14 15:27 UTC (permalink / raw)
  To: Jack Stone; +Cc: Viresh Kumar, linux-kernel

On 1/14/2011 5:13 AM, Jack Stone wrote:
> rning: ‘calltime.tv64’ may be used uninitialized in this function

which is clearly a.. gcc funny to be honest. it's a false positive by 
any stretch.

> >  


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

* Re: [PATCH resend] kernel/async.c: fixing compilation warnings
  2011-01-14 15:27   ` Arjan van de Ven
@ 2011-01-14 18:39     ` Jack Stone
  2011-01-14 19:13       ` Arjan van de Ven
  0 siblings, 1 reply; 6+ messages in thread
From: Jack Stone @ 2011-01-14 18:39 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Viresh Kumar, linux-kernel

On 14/01/2011 15:27, Arjan van de Ven wrote:
> On 1/14/2011 5:13 AM, Jack Stone wrote:
>> rning: ‘calltime.tv64’ may be used uninitialized in this function
> 
> which is clearly a.. gcc funny to be honest. it's a false positive by
> any stretch.
> 

Agreed. Who should merge this?

Thanks,

Jack

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

* Re: [PATCH resend] kernel/async.c: fixing compilation warnings
  2011-01-14 18:39     ` Jack Stone
@ 2011-01-14 19:13       ` Arjan van de Ven
  2011-01-15 11:11         ` Jack Stone
  0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2011-01-14 19:13 UTC (permalink / raw)
  To: Jack Stone; +Cc: Viresh Kumar, linux-kernel

On 1/14/2011 10:39 AM, Jack Stone wrote:
> On 14/01/2011 15:27, Arjan van de Ven wrote:
>> On 1/14/2011 5:13 AM, Jack Stone wrote:
>>> rning: ‘calltime.tv64’ may be used uninitialized in this function
>> which is clearly a.. gcc funny to be honest. it's a false positive by
>> any stretch.
>>
> Agreed. Who should merge this?

should it be?
traditionally we have shied away for workarounds for false positives 
from gcc.....


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

* Re: [PATCH resend] kernel/async.c: fixing compilation warnings
  2011-01-14 19:13       ` Arjan van de Ven
@ 2011-01-15 11:11         ` Jack Stone
  0 siblings, 0 replies; 6+ messages in thread
From: Jack Stone @ 2011-01-15 11:11 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Viresh Kumar, linux-kernel

"Arjan van de Ven" <arjan@linux.intel.com> wrote:

>On 1/14/2011 10:39 AM, Jack Stone wrote:
>> On 14/01/2011 15:27, Arjan van de Ven wrote:
>>> On 1/14/2011 5:13 AM, Jack Stone wrote:
>>>> rning: ‘calltime.tv64’ may be used uninitialized in this function
>>> which is clearly a.. gcc funny to be honest. it's a false positive
>by
>>> any stretch.
>>>
>> Agreed. Who should merge this?
>
>should it be?
>traditionally we have shied away for workarounds for false positives 
>from gcc.....

I don't mind. I thought that was what uninitalized_var() was for.

Thanks,

Jack


-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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

end of thread, other threads:[~2011-01-15 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 11:53 [PATCH resend] kernel/async.c: fixing compilation warnings Viresh Kumar
2011-01-14 13:13 ` Jack Stone
2011-01-14 15:27   ` Arjan van de Ven
2011-01-14 18:39     ` Jack Stone
2011-01-14 19:13       ` Arjan van de Ven
2011-01-15 11:11         ` Jack Stone

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