]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tg3: clean up redundant initialization of tnapi
authorColin Ian King <colin.king@canonical.com>
Thu, 14 Sep 2017 16:01:25 +0000 (17:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Sep 2017 17:00:29 +0000 (10:00 -0700)
tnapi is being initialized and then immediately updated and
hence the initialiation is redundant.  Clean up the warning
by moving the declaration and initialization to the inside
of the for-loop.

Cleans up clang scan-build warning:
warning: Value stored to 'tnapi' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c

index af33dc15c55f98e518c222ed4e1a3d1a551bcdcb..656e6af70f0a03c0cf55f317784da0e1e7153994 100644 (file)
@@ -11536,11 +11536,11 @@ static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq,
        tg3_napi_enable(tp);
 
        for (i = 0; i < tp->irq_cnt; i++) {
-               struct tg3_napi *tnapi = &tp->napi[i];
                err = tg3_request_irq(tp, i);
                if (err) {
                        for (i--; i >= 0; i--) {
-                               tnapi = &tp->napi[i];
+                               struct tg3_napi *tnapi = &tp->napi[i];
+
                                free_irq(tnapi->irq_vec, tnapi);
                        }
                        goto out_napi_fini;