diff mbox series

net: fec_ptp: remove redundant initialization of variable val

Message ID 20220123184936.113486-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit 6e667749271e58d34238cf700e543beabdbe6184
Delegated to: Netdev Maintainers
Headers show
Series net: fec_ptp: remove redundant initialization of variable val | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Colin Ian King Jan. 23, 2022, 6:49 p.m. UTC
Variable val is being initialized with a value that is never read,
it is being re-assigned later. The assignment is redundant and
can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/freescale/fec_ptp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Joakim Zhang Jan. 24, 2022, 6:34 a.m. UTC | #1
> -----Original Message-----
> From: Colin Ian King <colin.i.king@gmail.com>
> Sent: 2022年1月24日 2:50
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; David S . Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>;
> netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] net: fec_ptp: remove redundant initialization of variable val
> 
> Variable val is being initialized with a value that is never read, it is being
> re-assigned later. The assignment is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Looks good for me, so

Reviewed-by: Joakim Zhang <qiangqing.zhang@nxp.com>

Best Regards,
Joakim Zhang
> ---
>  drivers/net/ethernet/freescale/fec_ptp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c
> b/drivers/net/ethernet/freescale/fec_ptp.c
> index af99017a5453..7d49c28215f3 100644
> --- a/drivers/net/ethernet/freescale/fec_ptp.c
> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
> @@ -101,7 +101,6 @@ static int fec_ptp_enable_pps(struct
> fec_enet_private *fep, uint enable)
>  	u32 val, tempval;
>  	struct timespec64 ts;
>  	u64 ns;
> -	val = 0;
> 
>  	if (fep->pps_enable == enable)
>  		return 0;
> --
> 2.33.1
patchwork-bot+netdevbpf@kernel.org Jan. 25, 2022, 1:26 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Sun, 23 Jan 2022 18:49:36 +0000 you wrote:
> Variable val is being initialized with a value that is never read,
> it is being re-assigned later. The assignment is redundant and
> can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/net/ethernet/freescale/fec_ptp.c | 1 -
>  1 file changed, 1 deletion(-)

Here is the summary with links:
  - net: fec_ptp: remove redundant initialization of variable val
    https://git.kernel.org/netdev/net-next/c/6e667749271e

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index af99017a5453..7d49c28215f3 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -101,7 +101,6 @@  static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
 	u32 val, tempval;
 	struct timespec64 ts;
 	u64 ns;
-	val = 0;
 
 	if (fep->pps_enable == enable)
 		return 0;