genksyms: Use same type in loop comparison
authorJesper Juhl <jj@chaosbits.net>
Mon, 11 Jul 2011 22:32:04 +0000 (00:32 +0200)
committerMichal Marek <mmarek@suse.cz>
Mon, 25 Jul 2011 12:55:17 +0000 (14:55 +0200)
The ARRAY_SIZE macro in scripts/genksyms/genksyms.c returns a value of
type size_t. That value is being compared to a variable of type int in
a loop in read_node(). Change the int variable to size_t type as well,
so we don't do signed vs unsigned type comparisons with all the
potential promotion/sign extension trouble that can cause (also
silences compiler warnings at high levels of warnings).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/genksyms/genksyms.c

index f9e7553..6d3fda0 100644 (file)
@@ -448,7 +448,7 @@ static struct string_list *read_node(FILE *f)
        node.string = buffer;
 
        if (node.string[1] == '#') {
        node.string = buffer;
 
        if (node.string[1] == '#') {
-               int n;
+               size_t n;
 
                for (n = 0; n < ARRAY_SIZE(symbol_types); n++) {
                        if (node.string[0] == symbol_types[n].n) {
 
                for (n = 0; n < ARRAY_SIZE(symbol_types); n++) {
                        if (node.string[0] == symbol_types[n].n) {