All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Shen Lichuan <shenlichuan@vivo.com>,
	habetsm.xilinx@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com,
	linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH v1] sfc: Convert to use ERR_CAST()
Date: Wed, 28 Aug 2024 14:23:02 +0100	[thread overview]
Message-ID: <6e57f3c0-84bb-ce5d-bbca-b1a823729262@gmail.com> (raw)
In-Reply-To: <20240828100044.53870-1-shenlichuan@vivo.com>

On 28/08/2024 11:00, Shen Lichuan wrote:
> 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>
> ---
>  drivers/net/ethernet/sfc/tc_counters.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/sfc/tc_counters.c b/drivers/net/ethernet/sfc/tc_counters.c
> index c44088424323..76d32641202b 100644
> --- a/drivers/net/ethernet/sfc/tc_counters.c
> +++ b/drivers/net/ethernet/sfc/tc_counters.c
> @@ -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); /* it's an ERR_PTR */

May as well remove the now superfluous comment.
Other than that this lgtm.

  reply	other threads:[~2024-08-28 13:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 10:00 [PATCH v1] sfc: Convert to use ERR_CAST() Shen Lichuan
2024-08-28 13:23 ` Edward Cree [this message]
2024-08-28 22:31   ` Jacob Keller
2024-08-28 23:01     ` Jakub Kicinski
2024-08-29  6:47       ` Alejandro Lucero Palau
2024-08-29 15:09         ` Jakub Kicinski
2024-09-02  8:00           ` Alejandro Lucero Palau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e57f3c0-84bb-ce5d-bbca-b1a823729262@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=pabeni@redhat.com \
    --cc=shenlichuan@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.