diff options
| author | Dan Carpenter <[email protected]> | 2010-11-18 20:27:32 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2010-11-18 23:00:46 +0000 |
| commit | 09c9feb94672bdb3ca6d424a292ffc26eff8ca0b (patch) | |
| tree | e73e487f5b89de79c62ae784f0eda0721bc8f3c1 /Documentation/filesystems/configfs/configfs_example_explicit.c | |
| parent | kernel-doc: escape xml for structs (diff) | |
| download | kernel-09c9feb94672bdb3ca6d424a292ffc26eff8ca0b.tar.gz kernel-09c9feb94672bdb3ca6d424a292ffc26eff8ca0b.zip | |
Documentation: make configfs example code simpler, clearer
If "p" is NULL then it will cause an oops when we pass it to
simple_strtoul(). In this case "p" can not be NULL so I removed the
check. I also changed the check a little to make it more explicit that
we are testing whether p points to the NUL char.
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Joel Becker <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'Documentation/filesystems/configfs/configfs_example_explicit.c')
| -rw-r--r-- | Documentation/filesystems/configfs/configfs_example_explicit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/filesystems/configfs/configfs_example_explicit.c b/Documentation/filesystems/configfs/configfs_example_explicit.c index d428cc9f07f3..fd53869f5633 100644 --- a/Documentation/filesystems/configfs/configfs_example_explicit.c +++ b/Documentation/filesystems/configfs/configfs_example_explicit.c @@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless, char *p = (char *) page; tmp = simple_strtoul(p, &p, 10); - if (!p || (*p && (*p != '\n'))) + if ((*p != '\0') && (*p != '\n')) return -EINVAL; if (tmp > INT_MAX) |
