aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord binderman <dcb314@hotmail.com>2010-02-05 21:13:29 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-04-07 04:00:37 -0400
commit213972e9faf8a16b27fee01ae7c7071de5080268 (patch)
tree69291b2417d58e58e77d84ca88c6fe78536902b0
parent6237cdac5dd26d5ba81acf5daa737c8645614410 (diff)
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>
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index f45331ab97cb..06a137c5b8bb 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -592,7 +592,7 @@ static void __init kw_i2c_probe(void)
592 /* Probe keywest-i2c busses */ 592 /* Probe keywest-i2c busses */
593 for_each_compatible_node(np, "i2c","keywest-i2c") { 593 for_each_compatible_node(np, "i2c","keywest-i2c") {
594 struct pmac_i2c_host_kw *host; 594 struct pmac_i2c_host_kw *host;
595 int multibus, chans, i; 595 int multibus;
596 596
597 /* Found one, init a host structure */ 597 /* Found one, init a host structure */
598 host = kw_i2c_host_init(np); 598 host = kw_i2c_host_init(np);
@@ -614,6 +614,8 @@ static void __init kw_i2c_probe(void)
614 * parent type 614 * parent type
615 */ 615 */
616 if (multibus) { 616 if (multibus) {
617 int chans, i;
618
617 parent = of_get_parent(np); 619 parent = of_get_parent(np);
618 if (parent == NULL) 620 if (parent == NULL)
619 continue; 621 continue;
@@ -1258,8 +1260,7 @@ static void pmac_i2c_do_end(struct pmf_function *func, void *instdata)
1258 if (inst == NULL) 1260 if (inst == NULL)
1259 return; 1261 return;
1260 pmac_i2c_close(inst->bus); 1262 pmac_i2c_close(inst->bus);
1261 if (inst) 1263 kfree(inst);
1262 kfree(inst);
1263} 1264}
1264 1265
1265static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len) 1266static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len)