public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] readahead02: fix signed/unsigned comparison warnings
@ 2014-04-22  8:37 Jan Stancek
  2014-04-22  8:37 ` [LTP] [PATCH 2/2] readahead02: read in 2M chunks Jan Stancek
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Stancek @ 2014-04-22  8:37 UTC (permalink / raw)
  To: ltp-list

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/readahead/readahead02.c |   22 +++++++++++---------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
index 66158f0..8940821 100644
--- a/testcases/kernel/syscalls/readahead/readahead02.c
+++ b/testcases/kernel/syscalls/readahead/readahead02.c
@@ -120,7 +120,7 @@ static void drop_caches(void)
 	}
 }
 
-static long parse_entry(const char *fname, const char *entry)
+static unsigned long parse_entry(const char *fname, const char *entry)
 {
 	FILE *f;
 	long value = -1;
@@ -140,17 +140,17 @@ static long parse_entry(const char *fname, const char *entry)
 	return value;
 }
 
-static long get_bytes_read(void)
+static unsigned long get_bytes_read(void)
 {
 	char fname[128];
-	char entry[] = "read_bytes: %ld";
+	char entry[] = "read_bytes: %lu";
 	sprintf(fname, "/proc/%u/io", getpid());
 	return parse_entry(fname, entry);
 }
 
-static long get_cached_size(void)
+static unsigned long get_cached_size(void)
 {
-	char entry[] = "Cached: %ld";
+	char entry[] = "Cached: %lu";
 	return parse_entry(meminfo_fname, entry);
 }
 
@@ -158,7 +158,7 @@ static void create_testfile(void)
 {
 	FILE *f;
 	char *tmp;
-	int i;
+	size_t i;
 
 	tst_resm(TINFO, "creating test file of size: %ld", testfile_size);
 	tmp = SAFE_MALLOC(cleanup, pagesize);
@@ -197,9 +197,11 @@ static void create_testfile(void)
  * @cached: returns cached kB from /proc/meminfo
  */
 static void read_testfile(int do_readahead, const char *fname, size_t fsize,
-			  long *read_bytes, long *usec, long *cached)
+			  unsigned long *read_bytes, long *usec,
+			  unsigned long *cached)
 {
-	int fd, i;
+	int fd;
+	size_t i;
 	long read_bytes_start;
 	unsigned char *p, tmp;
 	unsigned long time_start_usec, time_end_usec;
@@ -261,9 +263,9 @@ static void read_testfile(int do_readahead, const char *fname, size_t fsize,
 
 static void test_readahead(void)
 {
-	long read_bytes, read_bytes_ra;
+	unsigned long read_bytes, read_bytes_ra;
 	long usec, usec_ra;
-	long cached_max, cached_low, cached, cached_ra;
+	unsigned long cached_max, cached_low, cached, cached_ra;
 	char proc_io_fname[128];
 	sprintf(proc_io_fname, "/proc/%u/io", getpid());
 
-- 
1.7.1


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-05-15 11:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22  8:37 [LTP] [PATCH 1/2] readahead02: fix signed/unsigned comparison warnings Jan Stancek
2014-04-22  8:37 ` [LTP] [PATCH 2/2] readahead02: read in 2M chunks Jan Stancek
2014-05-13  5:18   ` Madan
2014-05-13  6:55     ` Jan Stancek
2014-05-13  8:42       ` Madan
2014-05-13  9:20         ` Jan Stancek
2014-05-15 11:47   ` chrubis

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