Skip to content

Commit

Permalink
sfc: Convert to use ERR_CAST()
Browse files Browse the repository at this point in the history
As opposed to open-code, using the ERR_CAST macro clearly indicates that
this is a pointer to an error value and a type conversion was performed.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20240829021253.3066-1-shenlichuan@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Shen Lichuan authored and Jakub Kicinski committed Aug 30, 2024
1 parent fbdaffe commit 74ce94a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sfc/tc_counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct efx_tc_counter_index *efx_tc_flower_get_counter_index(
&ctr->linkage,
efx_tc_counter_id_ht_params);
kfree(ctr);
return (void *)cnt; /* it's an ERR_PTR */
return ERR_CAST(cnt);
}
ctr->cnt = cnt;
refcount_set(&ctr->ref, 1);
Expand Down

0 comments on commit 74ce94a

Please sign in to comment.