mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Shigeru Yoshida <syoshida@redhat.com>,
	jmaloy@redhat.com, ying.xue@windriver.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] tipc: Remove redundant call to TLV_SPACE()
Date: Thu, 16 Nov 2023 10:46:30 +0100	[thread overview]
Message-ID: <59083303fc79497b2658ff15ac3c18b985e270ab.camel@redhat.com> (raw)
In-Reply-To: <20231114144336.1714364-1-syoshida@redhat.com>

Hi,

On Tue, 2023-11-14 at 23:43 +0900, Shigeru Yoshida wrote:
> The purpose of TLV_SPACE() is to add the TLV descriptor size to the size of
> the TLV value passed as argument and align the resulting size to
> TLV_ALIGNTO.
> 
> tipc_tlv_alloc() calls TLV_SPACE() on its argument. In other words,
> tipc_tlv_alloc() takes its argument as the size of the TLV value. So the
> call to TLV_SPACE() in tipc_get_err_tlv() is redundant. Let's remove this
> redundancy.
> 
> Fixes: d0796d1ef63d ("tipc: convert legacy nl bearer dump to nl compat")
> Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>

The patch LGTM, but I think this is more a cleanup then a fix, please
re-submit it for net-next, dropping the Fixes tag (so it will not land
in stable tree).

With the above you can add:

Acked-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  net/tipc/netlink_compat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
> index 5bc076f2fa74..db0365c9b8bd 100644
> --- a/net/tipc/netlink_compat.c
> +++ b/net/tipc/netlink_compat.c
> @@ -167,7 +167,7 @@ static struct sk_buff *tipc_get_err_tlv(char *str)
>  	int str_len = strlen(str) + 1;
>  	struct sk_buff *buf;
>  
> -	buf = tipc_tlv_alloc(TLV_SPACE(str_len));
> +	buf = tipc_tlv_alloc(str_len);
>  	if (buf)
>  		tipc_add_tlv(buf, TIPC_TLV_ERROR_STRING, str, str_len);
>  


  reply	other threads:[~2023-11-16  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 14:43 Shigeru Yoshida
2023-11-16  9:46 ` Paolo Abeni [this message]
2023-11-17  0:26   ` Shigeru Yoshida

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=59083303fc79497b2658ff15ac3c18b985e270ab.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syoshida@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.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®