Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed262c4f authored by Adrian Bunk's avatar Adrian Bunk Committed by David Woodhouse
Browse files

[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: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 456d9fc9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ static struct mtd_partition * newpart(char *s,
		char *p;

	    	name = ++s;
		if ((p = strchr(name, delim)) == 0)
		p = strchr(name, delim);
		if (!p)
		{
			printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
			return NULL;
@@ -159,8 +160,9 @@ static struct mtd_partition * newpart(char *s,
			return NULL;
		}
		/* more partitions follow, parse them */
		if ((parts = newpart(s + 1, &s, num_parts,
		                     this_part + 1, &extra_mem, extra_mem_size)) == 0)
		parts = newpart(s + 1, &s, num_parts, this_part + 1,
				&extra_mem, extra_mem_size);
		if (!parts)
			return NULL;
	}
	else