From: Xu Yilun <yilun.xu@intel.com>
To: Tom Rix <trix@redhat.com>
Cc: Marco Pagani <marpagan@redhat.com>,
Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.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: Thu, 7 Apr 2022 10:09:35 +0800 [thread overview]
Message-ID: <20220407020935.GA256292@yilunxu-OptiPlex-7050> (raw)
In-Reply-To: <d39cdc4c-0dc5-f929-17fa-ffbaf9e767c7@redhat.com>
On Wed, Apr 06, 2022 at 07:18:21AM -0700, Tom Rix wrote:
>
> On 4/5/22 11:53 AM, 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.
> >
> > 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;
>
> Reviewed-by: Tom Rix <trix@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
>
> > /* Write out the complete 32-bit chunks */
next prev parent reply other threads:[~2022-04-07 2:17 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 [this message]
2022-04-20 4:24 ` Moritz Fischer
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=20220407020935.GA256292@yilunxu-OptiPlex-7050 \
--to=yilun.xu@intel.com \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marpagan@redhat.com \
--cc=mdf@kernel.org \
--cc=trix@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.