aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cmdlinepart.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-04-14 10:20:04 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-22 10:55:38 -0400
commited262c4f5cb8291668c27c88a022bd7628f067a4 (patch)
treea86fd8198b0fae7f2ca2a83b172a1f5b5c94970b /drivers/mtd/cmdlinepart.c
parent456d9fc92eb8635d53e8facc57764464b8759173 (diff)
[MTD] cmdlinepart.c: don't compare pointers with 0
Sparse spotted that 0 was compared to pointers. While I was at it, I also moved the assignments out of the if's. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/cmdlinepart.c')
-rw-r--r--drivers/mtd/cmdlinepart.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index b44292abd9f7..3e090436396d 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -119,7 +119,8 @@ static struct mtd_partition * newpart(char *s,
119 char *p; 119 char *p;
120 120
121 name = ++s; 121 name = ++s;
122 if ((p = strchr(name, delim)) == 0) 122 p = strchr(name, delim);
123 if (!p)
123 { 124 {
124 printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim); 125 printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
125 return NULL; 126 return NULL;
@@ -159,9 +160,10 @@ static struct mtd_partition * newpart(char *s,
159 return NULL; 160 return NULL;
160 } 161 }
161 /* more partitions follow, parse them */ 162 /* more partitions follow, parse them */
162 if ((parts = newpart(s + 1, &s, num_parts, 163 parts = newpart(s + 1, &s, num_parts, this_part + 1,
163 this_part + 1, &extra_mem, extra_mem_size)) == 0) 164 &extra_mem, extra_mem_size);
164 return NULL; 165 if (!parts)
166 return NULL;
165 } 167 }
166 else 168 else
167 { /* this is the last partition: allocate space for all */ 169 { /* this is the last partition: allocate space for all */