Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Fix two minor compiler warnings
Browse files Browse the repository at this point in the history
In cmd/splat.c there was a comparison between an __u32 and an int.  To
resolve the issue simply use a __u32 and strtoul() when converting the
provided user string.

In module/spl/spl-vnode.c we should explicitly cast nd->last.name to
a const char * which is what is expected by the prototype.
  • Loading branch information
behlendorf committed Jul 26, 2010
1 parent 8b0eb3f commit 849c50e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cmd/splat.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,15 @@ static test_t *test_find(char *sub_str, char *test_str)
ListIterator si, ti;
subsystem_t *sub;
test_t *test;
int sub_num, test_num;
__u32 sub_num, test_num;

/* No error checking here because it may not be a number, it's
/*
* No error checking here because it may not be a number, it's
* perfectly OK for it to be a string. Since we're just using
* it for comparison purposes this is all very safe.
*/
sub_num = strtol(sub_str, NULL, 0);
test_num = strtol(test_str, NULL, 0);
sub_num = strtoul(sub_str, NULL, 0);
test_num = strtoul(test_str, NULL, 0);

si = list_iterator_create(subsystems);

Expand Down
3 changes: 2 additions & 1 deletion module/spl/spl-vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ EXPORT_SYMBOL(vn_seek);
static struct dentry *
vn_lookup_hash(struct nameidata *nd)
{
return lookup_one_len(nd->last.name, nd->nd_dentry, nd->last.len);
return lookup_one_len((const char *)nd->last.name,
nd->nd_dentry, nd->last.len);
} /* lookup_hash() */

static void
Expand Down

0 comments on commit 849c50e

Please sign in to comment.