Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pmac/low_i2c.c: three minor problems

Fix minor nits found by cppcheck

[./arch/powerpc/platforms/powermac/low_i2c.c:594]: (style) The scope of the variable chans can be reduced
[./arch/powerpc/platforms/powermac/low_i2c.c:594]: (style) The scope of the variable i can be reduced
[./arch/powerpc/platforms/powermac/low_i2c.c:1260]: (style) Redundant condition. It is safe to deallocate a NULL pointer

Signed-off-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

d binderman and committed by
Benjamin Herrenschmidt
213972e9 6237cdac

+4 -3
+4 -3
arch/powerpc/platforms/powermac/low_i2c.c
··· 592 592 /* Probe keywest-i2c busses */ 593 593 for_each_compatible_node(np, "i2c","keywest-i2c") { 594 594 struct pmac_i2c_host_kw *host; 595 - int multibus, chans, i; 595 + int multibus; 596 596 597 597 /* Found one, init a host structure */ 598 598 host = kw_i2c_host_init(np); ··· 614 614 * parent type 615 615 */ 616 616 if (multibus) { 617 + int chans, i; 618 + 617 619 parent = of_get_parent(np); 618 620 if (parent == NULL) 619 621 continue; ··· 1260 1258 if (inst == NULL) 1261 1259 return; 1262 1260 pmac_i2c_close(inst->bus); 1263 - if (inst) 1264 - kfree(inst); 1261 + kfree(inst); 1265 1262 } 1266 1263 1267 1264 static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len)