Skip to content

Commit

Permalink
genksyms: Use same type in loop comparison
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
jjuhl authored and michal42 committed Jul 25, 2011
1 parent 0ff3577 commit 1ae1470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/genksyms/genksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static struct string_list *read_node(FILE *f)
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) {
Expand Down

0 comments on commit 1ae1470

Please sign in to comment.