From 55be71cfb77dc0a0a59716be3e1ac7946245ef67 Mon Sep 17 00:00:00 2001 From: Mika Kukkonen Date: Tue, 29 Jun 2004 05:20:18 -0700 Subject: [PATCH] Combined patch for remaining trivial sparse warnings in allnoconfig build Well, one of these (fs/block_dev.c) is little non-trivial, but i felt throwing that away would be a shame (and I did add comments ;-). Also almost all of these have been submitted earlier through other channels, but have not been picked up (the only controversial is again the fs/block_dev.c patch, where Linus felt a better job would be done with __ffs(), but I could not convince myself that is does the same thing as original code). Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- lib/kobject.c | 2 +- lib/rbtree.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/kobject.c b/lib/kobject.c index 5c2ade5739be..9b2519ee6e8c 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -37,7 +37,7 @@ static int populate_dir(struct kobject * kobj) int i; if (t && t->default_attrs) { - for (i = 0; (attr = t->default_attrs[i]); i++) { + for (i = 0; (attr = t->default_attrs[i]) != NULL; i++) { if ((error = sysfs_create_file(kobj,attr))) break; } diff --git a/lib/rbtree.c b/lib/rbtree.c index 860115d49dd3..61c12969be00 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -235,7 +235,7 @@ void rb_erase(struct rb_node *node, struct rb_root *root) struct rb_node *old = node, *left; node = node->rb_right; - while ((left = node->rb_left)) + while ((left = node->rb_left) != NULL) node = left; child = node->rb_right; parent = node->rb_parent; -- cgit v1.2.3