Commit 213972e9 authored by d binderman's avatar d binderman Committed by Benjamin Herrenschmidt

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: default avatarDavid Binderman <dcb314@hotmail.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 6237cdac
...@@ -592,7 +592,7 @@ static void __init kw_i2c_probe(void) ...@@ -592,7 +592,7 @@ static void __init kw_i2c_probe(void)
/* Probe keywest-i2c busses */ /* Probe keywest-i2c busses */
for_each_compatible_node(np, "i2c","keywest-i2c") { for_each_compatible_node(np, "i2c","keywest-i2c") {
struct pmac_i2c_host_kw *host; struct pmac_i2c_host_kw *host;
int multibus, chans, i; int multibus;
/* Found one, init a host structure */ /* Found one, init a host structure */
host = kw_i2c_host_init(np); host = kw_i2c_host_init(np);
...@@ -614,6 +614,8 @@ static void __init kw_i2c_probe(void) ...@@ -614,6 +614,8 @@ static void __init kw_i2c_probe(void)
* parent type * parent type
*/ */
if (multibus) { if (multibus) {
int chans, i;
parent = of_get_parent(np); parent = of_get_parent(np);
if (parent == NULL) if (parent == NULL)
continue; continue;
...@@ -1258,8 +1260,7 @@ static void pmac_i2c_do_end(struct pmf_function *func, void *instdata) ...@@ -1258,8 +1260,7 @@ static void pmac_i2c_do_end(struct pmf_function *func, void *instdata)
if (inst == NULL) if (inst == NULL)
return; return;
pmac_i2c_close(inst->bus); pmac_i2c_close(inst->bus);
if (inst) kfree(inst);
kfree(inst);
} }
static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len) static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment