netdevsim: fib: Remove redundant code
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Thu, 11 Mar 2021 07:11:01 +0000 (15:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Mar 2021 22:32:48 +0000 (14:32 -0800)
Fix the following coccicheck warnings:

./drivers/net/netdevsim/fib.c:874:5-8: Unneeded variable: "err". Return
"0" on line 889.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/fib.c

index 46fb414f7ca63d350b91e8b9702aba0e59d1c3a8..3ca0f54d0c3bc5388c7af89e2e81191df25c55b0 100644 (file)
@@ -869,10 +869,8 @@ err_rt_offload_failed_flag_set:
        return err;
 }
 
-static int nsim_fib_event(struct nsim_fib_event *fib_event)
+static void nsim_fib_event(struct nsim_fib_event *fib_event)
 {
-       int err = 0;
-
        switch (fib_event->family) {
        case AF_INET:
                nsim_fib4_event(fib_event->data, &fib_event->fen_info,
@@ -885,8 +883,6 @@ static int nsim_fib_event(struct nsim_fib_event *fib_event)
                nsim_fib6_event_fini(&fib_event->fib6_event);
                break;
        }
-
-       return err;
 }
 
 static int nsim_fib4_prepare_event(struct fib_notifier_info *info,