From: David Marchand <david.marchand@redhat.com>
To: Andre Muezerie <andremue@linux.microsoft.com>
Cc: Tyler Retzlaff <roretzla@linux.microsoft.com>, dev@dpdk.org
Subject: Re: [PATCH] eal: simplify code to avoid Coverity false positive
Date: Thu, 15 May 2025 13:44:06 +0200 [thread overview]
Message-ID: <CAJFAV8x9dAP7ziqAgCZ9-5EuThAhCFgdQKHTMY1KysH1WPOU2A@mail.gmail.com> (raw)
In-Reply-To: <1744662518-5433-1-git-send-email-andremue@linux.microsoft.com>
On Mon, Apr 14, 2025 at 10:29 PM Andre Muezerie
<andremue@linux.microsoft.com> wrote:
>
> Coverity complained about an overflow in a recently added function:
>
> https://scan4.scan.coverity.com/#/project-view/66295/10075?selectedIssue=461876
>
> CID 461876: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW)
> 21. overflow_const: Expression powi, which is equal to 0, where base is
> known to be equal to 1024, overflows the type that receives it, an
> unsigned integer 64 bits wide.
>
> This complaint was a false positive, but it revealed that the function
> could be written in a simpler way, making the code more readable and
> likely allowing Coverity to make the right determination.
>
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Applied, thanks.
--
David Marchand
prev parent reply other threads:[~2025-05-15 11:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 20:28 Andre Muezerie
2025-05-15 11:44 ` David Marchand [this message]
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=CAJFAV8x9dAP7ziqAgCZ9-5EuThAhCFgdQKHTMY1KysH1WPOU2A@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=andremue@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=roretzla@linux.microsoft.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).