All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/2] numa_helper: Fix compiler warnings
Date: Tue, 29 Aug 2017 17:35:08 +0200	[thread overview]
Message-ID: <20170829153509.12613-1-pvorel@suse.cz> (raw)

about comparison between signed and unsigned integer

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/lib/numa_helper.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c
index a852f152f..afc09b8db 100644
--- a/testcases/kernel/lib/numa_helper.c
+++ b/testcases/kernel/lib/numa_helper.c
@@ -60,7 +60,7 @@ unsigned long get_max_node(void)
 static void get_nodemask_allnodes(nodemask_t * nodemask, unsigned long max_node)
 {
 	unsigned long nodemask_size = max_node / 8;
-	int i;
+	unsigned int i;
 	char fn[64];
 	struct stat st;
 
@@ -95,7 +95,7 @@ static int filter_nodemask_mem(nodemask_t * nodemask, unsigned long max_node)
 		return -2;
 	}
 #else
-	int i;
+	unsigned int i;
 	/*
 	 * old libnuma/kernel don't have MPOL_F_MEMS_ALLOWED, so let's assume
 	 * that we can use any node with memory > 0
@@ -112,7 +112,7 @@ static int filter_nodemask_mem(nodemask_t * nodemask, unsigned long max_node)
 
 static int cpumask_has_cpus(char *cpumask, size_t len)
 {
-	int j;
+	unsigned int j;
 	for (j = 0; j < len; j++)
 		if (cpumask[j] == '\0')
 			return 0;
@@ -129,7 +129,8 @@ static void filter_nodemask_cpu(nodemask_t * nodemask, unsigned long max_node)
 	char fn[64];
 	FILE *f;
 	size_t len;
-	int i, ret;
+	unsigned int i;
+	int ret;
 
 	for (i = 0; i < max_node; i++) {
 		if (!nodemask_isset(nodemask, i))
@@ -164,7 +165,7 @@ int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes)
 {
 	int ret = 0;
 #if HAVE_NUMA_H
-	int i;
+	unsigned int i;
 	nodemask_t *nodemask = NULL;
 #endif
 	*num_nodes = 0;
-- 
2.14.0


             reply	other threads:[~2017-08-29 15:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 15:35 Petr Vorel [this message]
2017-08-29 15:35 ` [LTP] [PATCH v2 2/2] syscalls/mbind: cleanup and rewrite mbind01 into new API Petr Vorel
2017-08-30 10:57   ` Jan Stancek
2017-08-30 12:37     ` Petr Vorel
2017-08-30 14:08       ` Jan Stancek
2017-08-30 14:35         ` Petr Vorel
2017-08-30 15:24           ` Jan Stancek
2017-08-31  5:06             ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170829153509.12613-1-pvorel@suse.cz \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.