* [PATCH] netdevsim: fib: Remove redundant code
@ 2021-03-10 2:35 Jiapeng Chong
2021-03-10 10:01 ` Ido Schimmel
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-03-10 2:35 UTC (permalink / raw)
To: kuba; +Cc: davem, netdev, linux-kernel, Jiapeng Chong
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>
---
drivers/net/netdevsim/fib.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 46fb414..db794f9 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -871,8 +871,6 @@ static int nsim_fib6_event(struct nsim_fib_data *data,
static int 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,
@@ -886,7 +884,7 @@ static int nsim_fib_event(struct nsim_fib_event *fib_event)
break;
}
- return err;
+ return 0;
}
static int nsim_fib4_prepare_event(struct fib_notifier_info *info,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netdevsim: fib: Remove redundant code
2021-03-10 2:35 [PATCH] netdevsim: fib: Remove redundant code Jiapeng Chong
@ 2021-03-10 10:01 ` Ido Schimmel
0 siblings, 0 replies; 2+ messages in thread
From: Ido Schimmel @ 2021-03-10 10:01 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: kuba, davem, netdev, linux-kernel
On Wed, Mar 10, 2021 at 10:35:27AM +0800, Jiapeng Chong wrote:
> 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>
> ---
> drivers/net/netdevsim/fib.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
> index 46fb414..db794f9 100644
> --- a/drivers/net/netdevsim/fib.c
> +++ b/drivers/net/netdevsim/fib.c
> @@ -871,8 +871,6 @@ static int nsim_fib6_event(struct nsim_fib_data *data,
>
> static int nsim_fib_event(struct nsim_fib_event *fib_event)
Can you change to 'static void' ?
> {
> - int err = 0;
> -
> switch (fib_event->family) {
> case AF_INET:
> nsim_fib4_event(fib_event->data, &fib_event->fen_info,
> @@ -886,7 +884,7 @@ static int nsim_fib_event(struct nsim_fib_event *fib_event)
> break;
> }
>
> - return err;
> + return 0;
> }
>
> static int nsim_fib4_prepare_event(struct fib_notifier_info *info,
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-10 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 2:35 [PATCH] netdevsim: fib: Remove redundant code Jiapeng Chong
2021-03-10 10:01 ` Ido Schimmel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).