[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1615446661-67765-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Thu, 11 Mar 2021 15:11:01 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: kuba@...nel.org
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH v2] netdevsim: fib: Remove redundant code
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@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
Changes in v2:
- Modify the function type to void.
drivers/net/netdevsim/fib.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 46fb414..3ca0f54 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -869,10 +869,8 @@ static int nsim_fib6_event(struct nsim_fib_data *data,
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,
--
1.8.3.1
Powered by blists - more mailing lists