diff mbox series

[linux-next] mlxsw: remove redundant err variable

Message ID 20220829105454.266509-1-cui.jinpeng2@zte.com.cn (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [linux-next] mlxsw: remove redundant err variable | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
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 7 of 7 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/check_selftest success No net selftest shell script
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, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

CGEL Aug. 29, 2022, 10:54 a.m. UTC
From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

Return value from mlxsw_core_bus_device_register() directly
instead of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
---
 drivers/net/ethernet/mellanox/mlxsw/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Petr Machata Aug. 29, 2022, 11:11 a.m. UTC | #1
cgel.zte@gmail.com writes:

> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
>
> Return value from mlxsw_core_bus_device_register() directly
> instead of taking this in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

Reviewed-by: Petr Machata <petrm@nvidia.com>

Thanks!
Ammar Faizi Aug. 29, 2022, 12:14 p.m. UTC | #2
On Mon, Aug 29, 2022 at 5:56 PM wrote:
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
>
> Return value from mlxsw_core_bus_device_register() directly
> instead of taking this in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>

Reviewed-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Jakub Kicinski Aug. 31, 2022, 6:05 a.m. UTC | #3
On Mon, 29 Aug 2022 10:54:55 +0000 cgel.zte@gmail.com wrote:
> +	return mlxsw_core_bus_device_register(mlxsw_core->bus_info,
>  					     mlxsw_core->bus,
>  					     mlxsw_core->bus_priv, true,
>  					     devlink, extack);

Please realign continuation lines so that their starts match the
opening bracket. Please keep the review tags you received.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index afbe046b35a0..be9901ddf987 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -1496,15 +1496,14 @@  mlxsw_devlink_core_bus_device_reload_up(struct devlink *devlink, enum devlink_re
 					struct netlink_ext_ack *extack)
 {
 	struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
-	int err;
 
 	*actions_performed = BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) |
 			     BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE);
-	err = mlxsw_core_bus_device_register(mlxsw_core->bus_info,
+
+	return mlxsw_core_bus_device_register(mlxsw_core->bus_info,
 					     mlxsw_core->bus,
 					     mlxsw_core->bus_priv, true,
 					     devlink, extack);
-	return err;
 }
 
 static int mlxsw_devlink_flash_update(struct devlink *devlink,