Linux-Media Archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Johannes Stezenbach <js@linuxtv.org>
Cc: linux-media@vger.kernel.org
Subject: Re: [bug report] [PATCH] dvb: b2c2/flexcop driver refactoring part 2: add modular Flexcop driver
Date: Mon, 6 May 2024 08:56:22 +0300	[thread overview]
Message-ID: <4caa1870-900b-4d61-a707-c98b6010068e@moroto.mountain> (raw)
In-Reply-To: <ZjaZj9Eo838SQAp8@linuxtv.org>

On Sat, May 04, 2024 at 10:24:47PM +0200, Johannes Stezenbach wrote:
> Hi Dan,
> 
> On Sat, May 04, 2024 at 02:24:21PM +0300, Dan Carpenter wrote:
> > [ This patch is 19 years old now...  :P  Sorry!  - dan ]
> > 
> > Commit 2add87a95068 ("[PATCH] dvb: b2c2/flexcop driver refactoring
> > part 2: add modular Flexcop driver") from May 16, 2005 (linux-next),
> > leads to the following Smatch static checker warning:
> 
> I think the patches were from Patrick and misattributed because
> I was too stupid to operate git correctly at the time.
> 
> > 	drivers/media/usb/b2c2/flexcop-usb.c:199 flexcop_usb_memory_req()
> > 	warn: iterator 'i' not incremented
> 
> > --> 199         for (i = 0; i < len;) {
> > 
> > No i++.
> 
> >     208                 ret = flexcop_usb_v8_memory_req(fc_usb, req,
> >     209                         page_start + (addr / V8_MEMORY_PAGE_SIZE),
> >     210                         (addr & V8_MEMORY_PAGE_MASK) |
> >     211                                 (V8_MEMORY_EXTENDED*extended),
> >     212                         &buf[i], pagechunk);
> >                                 ^^^^^^^^
> > I think adding an i++ doesn't make sense.  Are we really writing a byte
> > at a time?
> C> 
> >     213 
> >     214                 if (ret < 0)
> >     215                         return ret;
> >     216                 addr += pagechunk;
> >     217                 len -= pagechunk;
> >     218         }
> 
> The loop is weird, but I guess it worked because the len -= pagechunk
> would have terminated the loop and supposedly there was only one
> iteration ever. I doubt anyone has hardware to test it, so don't
> change it. Well, I certainly won't touch it, you can do it if you want.

Nah.  It's fine.  If you don't know, then I for sure don't know.

regards,
dan carpenter


      reply	other threads:[~2024-05-06  5:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 11:24 [bug report] [PATCH] dvb: b2c2/flexcop driver refactoring part 2: add modular Flexcop driver Dan Carpenter
2024-05-04 20:24 ` Johannes Stezenbach
2024-05-06  5:56   ` Dan Carpenter [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=4caa1870-900b-4d61-a707-c98b6010068e@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=js@linuxtv.org \
    --cc=linux-media@vger.kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).