All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fredrik Noring <noring@nocrew.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pete Zaitcev <zaitcev@kotori.zaitcev.us>,
	linux-usb@vger.kernel.org,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Kate Stewart <kstewart@linuxfoundation.org>
Subject: [05/22] USB: mon: no need to check return value of debugfs_create functions
Date: Tue, 29 May 2018 20:15:20 +0200	[thread overview]
Message-ID: <20180529181518.GA2244@localhost.localdomain> (raw)

Hi Greg,

On Tue, May 29, 2018 at 06:51:54PM +0200, Greg Kroah-Hartman wrote:
> On Tue, May 29, 2018 at 11:34:34AM -0500, Pete Zaitcev wrote:
> > On Tue, 29 May 2018 17:30:50 +0200
> > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > 
> > > When calling debugfs functions, there is no need to ever check the
> > > return value.  The function can work or not, but the code logic should
> > > never do something different based on this.
> > 
> > Okay, fair enough. And the code works, surprisingly, even when the
> > debugfs is disabled (well, according to my review). I just have one
> > question - wouldn't it be cleaner to deprecate and remove the text
> > API altogether?
> 
> If you think we can do that, sure!  But what's the odds that someone
> still uses it?  This patch doesn't change any real functionality.

I had some use of this text API last year, when I also discovered and
submitted and fix for its data corruption problems described in commit
a5f596830e27e "usb: usbmon: Read text within supplied buffer size".

A significant disadvantage with the text API is, as far as I understand it,
that it can drop events (due to its buffering limit) without informing API
readers (via event sequence numbers or some such).

I've found a couple of USB bugs/problems (commit d6c931ea32dc0 "USB: OHCI:
Fix NULL dereference in HCDs using HCD_LOCAL_MEM" for instance) and I'm
still investigating at least one bug possibly related to lost interrupts
where some kind of probing method could be helpful.

However, I would explore other kernel probing methods for that. Not only
because I'm curious but also because I have the impression that there are
more powerful methods available than this text API. Would you recommend
any alternatives?

Fredrik
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-05-29 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 18:15 Fredrik Noring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-29 16:51 [05/22] USB: mon: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2018-05-29 16:34 Pete Zaitcev
2018-05-29 15:30 Greg Kroah-Hartman

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=20180529181518.GA2244@localhost.localdomain \
    --to=noring@nocrew.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=zaitcev@kotori.zaitcev.us \
    /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.