Skip to contentSkip to conversation

cgroup/getdelays: Squish uninitialized variable warning for old GCC compilers

PATCH In review Markos Chandras 3 participants 4 messages Jan 3, 2012 – Jan 4, 2012 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 7/21 cgroup/getdelays: Squish uninitialized variable warning for old GCC compilers

Hi, please review the attached patch. It is a trivial fix for slightly old GCC versions.

Signature · 1 line
markos

From 9a47290369456d5406845b0d5c37b1577e55ef11 Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
Date: Thu, 22 Dec 2011 12:07:30 +0000
Subject: [PATCH 07/21] cgroup/getdelays: Squish uninitialized variable warning for old GCC compilers

---
 testcases/kernel/controllers/cgroup/getdelays.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/controllers/cgroup/getdelays.c +1 -1
index da735b2..5c79423 100644
@@ -263,7 +263,7 @@ void print_ioacct(struct taskstats *t)
 
 int main(int argc, char *argv[])
 {
-	int c, rc, rep_len, aggr_len, len2, cmd_type;
+	int c, rc, rep_len, aggr_len, len2, cmd_type = 0;
 	__u16 id;
 	__u32 mypid;
 
Signature · 1 line
1.7.1

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 2 lines · Markos Chandras

Hi, please review the attached patch. It is a trivial fix for slightly old GCC versions.

It would be better to set it below the declarations. Although this
isn't part of check_patch.pl, it's a BSD style(9)'ism that makes things a lot easier to read.
Thanks,
-Garrett

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

Hi!

Quoted 3 lines

It would be better to set it below the declarations. Although this
isn't part of check_patch.pl, it's a BSD style(9)'ism that makes things a lot easier to read.

If this is only to silence compiler warning I would commit this as it is.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hi!

Quoted 6 lines
Quoted 3 lines

If this is only to silence compiler warning I would commit this as it is.

I studied the code over and over and cmd_type is never used uninitialized. So yes, it is just a simple fix to silence old compilers.

Seems so to me as well, commited.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list