From: Moritz Fischer <mdf@kernel.org>
To: Marco Pagani <marpagan@redhat.com>
Cc: Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.com>,
Xu Yilun <yilun.xu@intel.com>, Tom Rix <trix@redhat.com>,
linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fpga: altera-pr-ip: fix unsigned comparison with less than zero
Date: Tue, 19 Apr 2022 21:24:15 -0700 [thread overview]
Message-ID: <Yl+K789ZUWd5Si0B@archbook> (raw)
In-Reply-To: <20220405185349.220607-1-marpagan@redhat.com>
Marco,
On Tue, Apr 05, 2022 at 08:53:49PM +0200, Marco Pagani wrote:
> Fix the "comparison with less than zero" warning reported by
> cppcheck for the unsigned (size_t) parameter "count" of the
> "alt_pr_fpga_write()" function.
>
Should this have a Reported-by: tag?
> Signed-off-by: Marco Pagani <marpagan@redhat.com>
> ---
> drivers/fpga/altera-pr-ip-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/altera-pr-ip-core.c b/drivers/fpga/altera-pr-ip-core.c
> index be0667968d33..2ff3d8e46a0c 100644
> --- a/drivers/fpga/altera-pr-ip-core.c
> +++ b/drivers/fpga/altera-pr-ip-core.c
> @@ -108,7 +108,7 @@ static int alt_pr_fpga_write(struct fpga_manager *mgr, const char *buf,
> u32 *buffer_32 = (u32 *)buf;
> size_t i = 0;
>
> - if (count <= 0)
> + if (count == 0)
> return -EINVAL;
if (!count)
return -EINVAL?
>
> /* Write out the complete 32-bit chunks */
> --
> 2.35.1
Cheers,
Moritz
>
next prev parent reply other threads:[~2022-04-20 4:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 18:53 [PATCH] fpga: altera-pr-ip: fix unsigned comparison with less than zero Marco Pagani
2022-04-06 14:18 ` Tom Rix
2022-04-07 2:09 ` Xu Yilun
2022-04-20 4:24 ` Moritz Fischer [this message]
2022-04-22 15:47 ` Marco Pagani
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=Yl+K789ZUWd5Si0B@archbook \
--to=mdf@kernel.org \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marpagan@redhat.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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