Skip to contentSkip to conversation

kernel/vma: Add missing return statement for non-void functions

PATCH NAK Markos Chandras 2 participants 2 messages Jan 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 16/21 kernel/vma: Add missing return statement for non-void functions

Hi, please review the attached patch

Signature · 1 line
markos

From b5bec4470a937d9d63b05798d34c0c33c19348d4 Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
Date: Thu, 22 Dec 2011 15:04:50 +0000
Subject: [PATCH 16/21] kernel/vma: Add missing return statement for non-void functions

---
 testcases/kernel/mem/vma/vma01.c |    2 ++
 testcases/kernel/mem/vma/vma02.c |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)
testcases/kernel/mem/vma/vma01.c +2 -0
index 398d7a1..14c0525 100644
@@ -151,6 +151,8 @@ static void *get_end_addr(void *addr_s, char *mapfile)
 	}
 	fclose(fp);
 	tst_brkm(TBROK, cleanup, "no matched s = %p found.", addr_s);
+
+	return NULL;
 }
 
 static void check_status(int status)
testcases/kernel/mem/vma/vma02.c +5 -0
index a1c8f24..fe7cff6 100644
@@ -152,6 +152,9 @@ int main(int argc, char** argv)
 			tst_brkm(TWARN|TERRNO, NULL, "munmap");
 	}
 	tst_exit();
+
+	/* We should never be here */
+	return 0;
 }
 
 void usage(void)
@@ -166,5 +169,7 @@ int main(void) {
 #else /* no NUMA */
 int main(void) {
 	tst_brkm(TCONF, NULL, "no NUMA development packages installed.");
+	/* We should never be here */
+	return 0;
 }
 #endif
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 1 line · On Tuesday 03 January 2012 08:21:48 Markos Chandras wrote:

Hi, please review the attached patch

two of these hunks are fallout of your tst_brkm() no attribute change. those don't actually return, so there shouldn't be a need to add explicit returns.

the 3rd hunk (adding a return after tst_exit) is wrong -- that is marked noreturn and isn't changing.
-mike

------------------------------------------------------------------------------
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