Skip to contentSkip to conversation

kernel/async.c: fixing compilation warnings

PATCH Superseded Viresh Kumar 2 participants 3 messages Jan 14, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/async.c: fixing compilation warnings

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

---
 kernel/async.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/async.c +2 -2
index cd9dbb9..9c06931 100644
@@ -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 calltime = {0}, 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 starttime = {0}, delta, endtime;
 
 	if (initcall_debug && system_state == SYSTEM_BOOTING) {
 		printk("async_waiting @ %i\n", task_pid_nr(current));
Signature · 1 line
1.7.2.2
#1 lore raw
Quoted 16 lines · 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

---
kernel/async.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
kernel/async.c +0 -0
index cd9dbb9..9c06931 100644

kernel/async.c static void async_run_entry_fn(struct work_struct · line 123

Quoted 6 lines
kernel/async.c +1 -1
@@ -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 calltime = {0}, delta, rettime;

I think this is a false positive so we can use uninitalized_var().

kernel/async.c EXPORT_SYMBOL_GPL(async_synchronize_full_domain); · line 271

Quoted 9 lines
kernel/async.c +1 -1
 	/* 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 starttime = {0}, delta, endtime;
 

Same for this one.

kernel/async.c EXPORT_SYMBOL_GPL(async_synchronize_full_domain); · line 273

Quoted 2 lines
kernel/async.c +0 -0
 	if (initcall_debug && system_state == SYSTEM_BOOTING) {
 		printk("async_waiting @ %i\n", task_pid_nr(current));

Thanks,

Jack

Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
#2 lore raw
Quoted 27 lines · Jack Stone
Quoted 16 lines · 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

---
kernel/async.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
kernel/async.c +0 -0
index cd9dbb9..9c06931 100644

kernel/async.c static void async_run_entry_fn(struct work_struct · line 123

Quoted 6 lines
kernel/async.c +1 -1
@@ -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 calltime = {0}, delta, rettime;

I think this is a false positive so we can use uninitalized_var().

Quoted 12 lines

kernel/async.c EXPORT_SYMBOL_GPL(async_synchronize_full_domain); · line 271

Quoted 9 lines
kernel/async.c +1 -1
 	/* 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 starttime = {0}, delta, endtime;
 

Same for this one.

I will resend it with suggested changes.

--
viresh