linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mirq-linux@rere.qmqm.pl
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [bug report] usb: gadget: u_serial: process RX in workqueue instead of tasklet
Date: Mon, 24 Jun 2019 15:41:54 +0200	[thread overview]
Message-ID: <20190624134154.GA3953@qmqm.qmqm.pl> (raw)
In-Reply-To: <20190624123258.GA31097@mwanda>

On Mon, Jun 24, 2019 at 03:32:58PM +0300, Dan Carpenter wrote:
> Hello Michał Mirosław,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch 8b4c62aef6f6: "usb: gadget: u_serial: process RX in
> workqueue instead of tasklet" from Dec 16, 2018, leads to the
> following Smatch complaint:
[...] 
>    431		/* We want our data queue to become empty ASAP, keeping data
>    432		 * in the tty and ldisc (not here).  If we couldn't push any
>    433		 * this time around, RX may be starved, so wait until next jiffy.
>    434		 *
>    435		 * We may leave non-empty queue only when there is a tty, and
>    436		 * either it is throttled or there is no more room in flip buffer.
>    437		 */
>    438		if (!list_empty(queue) && !tty_throttled(tty))
>                                           ^^^^^^^^^^^^^^^^^^^
> in the original code there was check for NULL here but the patch removed
> it.
> 
>    439			schedule_delayed_work(&port->push, 1);
>    440	

Hi Dan,

The code is correct and explained in the comment above it - while() loop
above can be exited before emptying the queue only when tty != NULL.

Best Regards,
Michał Mirosław

  reply	other threads:[~2019-06-24 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 12:32 [bug report] usb: gadget: u_serial: process RX in workqueue instead of tasklet Dan Carpenter
2019-06-24 13:41 ` mirq-linux [this message]
2019-06-24 14:16   ` Dan Carpenter

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=20190624134154.GA3953@qmqm.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-usb@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 NNTP newsgroup(s).