From: Martin Habets <habetsm.xilinx@gmail.com>
To: Shen Lichuan <shenlichuan@vivo.com>
Cc: ecree.xilinx@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
linux-net-drivers@amd.com, linux-kernel@vger.kernel.org,
opensource.kernel@vivo.com
Subject: Re: [PATCH v2] sfc: Convert to use ERR_CAST()
Date: Thu, 29 Aug 2024 09:20:48 +0100 [thread overview]
Message-ID: <20240829081951.GA67561@gmail.com> (raw)
In-Reply-To: <20240829021253.3066-1-shenlichuan@vivo.com>
On Thu, Aug 29, 2024 at 10:12:53AM +0800, 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>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>
> ---
> v1 -> v2: Removed the superfluous comment.
>
> 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..a421b0123506 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);
> }
> ctr->cnt = cnt;
> refcount_set(&ctr->ref, 1);
> --
> 2.17.1
>
next prev parent reply other threads:[~2024-08-29 8:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 2:12 [PATCH v2] sfc: Convert to use ERR_CAST() Shen Lichuan
2024-08-29 8:20 ` Martin Habets [this message]
2024-08-29 14:05 ` Edward Cree
2024-08-30 18:20 ` patchwork-bot+netdevbpf
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=20240829081951.GA67561@gmail.com \
--to=habetsm.xilinx@gmail.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).