From: Edward Cree <ecree.xilinx@gmail.com>
To: Haowen Bai <baihaowen@meizu.com>,
Martin Habets <habetsm.xilinx@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] sfc: ef10: Fix assigning negative value to unsigned variable
Date: Mon, 11 Apr 2022 17:27:01 +0100 [thread overview]
Message-ID: <1912936d-14b5-f6af-c927-c46fabc72da5@gmail.com> (raw)
In-Reply-To: <1649640757-30041-1-git-send-email-baihaowen@meizu.com>
On 11/04/2022 02:32, Haowen Bai wrote:
> fix warning reported by smatch:
> 251 drivers/net/ethernet/sfc/ef10.c:2259 efx_ef10_tx_tso_desc()
> warn: assigning (-208) to unsigned variable 'ip_tot_len'
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
> V1->V2: to assign "0x10000 - EFX_TSO2_MAX_HDRLEN" is the actual
> semantics of the value.
>
> drivers/net/ethernet/sfc/ef10.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index 50d535981a35..c9ee5011803f 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
> @@ -2256,7 +2256,7 @@ int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue, struct sk_buff *skb,
> * guaranteed to satisfy the second as we only attempt TSO if
> * inner_network_header <= 208.
> */
> - ip_tot_len = -EFX_TSO2_MAX_HDRLEN;
> + ip_tot_len = 0x10000 - EFX_TSO2_MAX_HDRLEN;
> EFX_WARN_ON_ONCE_PARANOID(mss + EFX_TSO2_MAX_HDRLEN +
> (tcp->doff << 2u) > ip_tot_len);
>
>
next prev parent reply other threads:[~2022-04-11 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 1:32 Haowen Bai
2022-04-11 16:27 ` Edward Cree [this message]
2022-04-12 4:00 ` 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=1912936d-14b5-f6af-c927-c46fabc72da5@gmail.com \
--to=ecree.xilinx@gmail.com \
--cc=baihaowen@meizu.com \
--cc=davem@davemloft.net \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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®