RE: [Intel-wired-lan] [PATCH] ice: Make use of the helper function devm_add_action_or_reset()

From: G, GurucharanX
Date: Fri Oct 01 2021 - 11:29:12 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Cai Huoqing
> Sent: Wednesday, September 22, 2021 6:30 PM
> To: caihuoqing@xxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx; Jakub Kicinski <kuba@xxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH] ice: Make use of the helper function
> devm_add_action_or_reset()
>
> The helper function devm_add_action_or_reset() will internally call
> devm_add_action(), and if devm_add_action() fails then it will execute the
> action mentioned and return the error code. So use
> devm_add_action_or_reset() instead of devm_add_action() to simplify the
> error handling, reduce the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@xxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_devlink.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>

Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)