mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eelco Chaudron <echaudro@redhat.com>
To: Yan Zhen <yanzhen@vivo.com>
Cc: edumazet@google.com, pshelar@ovn.org, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	dev@openvswitch.org, linux-kernel@vger.kernel.org,
	opensource.kernel@vivo.com
Subject: Re: [PATCH v1 net-next] net: openvswitch: Use ERR_CAST() to return
Date: Thu, 29 Aug 2024 12:17:41 +0200	[thread overview]
Message-ID: <CF346267-CFB2-4DC9-9E88-C502E1358830@redhat.com> (raw)
In-Reply-To: <20240829095509.3151987-1-yanzhen@vivo.com>



On 29 Aug 2024, at 11:55, Yan Zhen wrote:

> Using ERR_CAST() is more reasonable and safer, When it is necessary
> to convert the type of an error pointer and return it.
>
> Signed-off-by: Yan Zhen <yanzhen@vivo.com>
> ---
>  net/openvswitch/flow_netlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index c92bdc4dfe19..729ef582a3a8 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -2491,7 +2491,7 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa,
>
>  	acts = nla_alloc_flow_actions(new_acts_size);
>  	if (IS_ERR(acts))
> -		return (void *)acts;
> +		return ERR_CAST(acts);

Change looks good to me.

Acked-by: Eelco Chaudron <echaudro@redhat.com>

>  	memcpy(acts->actions, (*sfa)->actions, (*sfa)->actions_len);
>  	acts->actions_len = (*sfa)->actions_len;
> -- 
> 2.34.1


  reply	other threads:[~2024-08-29 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  9:55 Yan Zhen
2024-08-29 10:17 ` Eelco Chaudron [this message]
2024-08-29 15:30 ` [ovs-dev] " Aaron Conole
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=CF346267-CFB2-4DC9-9E88-C502E1358830@redhat.com \
    --to=echaudro@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=yanzhen@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

all inboxes | Powered by JetHome®