linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Felipe Balbi <balbi@kernel.org>
Cc: Pawel Laszczak <pawell@cadence.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	ltyrala@cadence.com, adouglas@cadence.com
Subject: [02/31] usb: usbssp: Added some decoding functions.
Date: Tue, 11 Sep 2018 10:12:27 +0200	[thread overview]
Message-ID: <20180911081227.GB8963@kroah.com> (raw)

On Tue, Sep 11, 2018 at 08:48:43AM +0300, Felipe Balbi wrote:
> 
> Hi,
> 
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> > On Thu, Jul 19, 2018 at 06:57:35PM +0100, Pawel Laszczak wrote:
> >> This patch add additional functions that converts some fields to string.
> >> 
> >> For example function usbssp_trb_comp_code_string take completion
> >> code value and return string describing completion code.
> >> 
> >> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> >> ---
> >>  drivers/usb/usbssp/gadget.h | 580 ++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 580 insertions(+)
> >> 
> >> diff --git a/drivers/usb/usbssp/gadget.h b/drivers/usb/usbssp/gadget.h
> >> index 49e7271187cc..b5c17603af78 100644
> >> --- a/drivers/usb/usbssp/gadget.h
> >> +++ b/drivers/usb/usbssp/gadget.h
> >> @@ -930,6 +930,73 @@ struct usbssp_transfer_event {
> >>  #define COMP_UNDEFINED_ERROR			33
> >>  #define COMP_INVALID_STREAM_ID_ERROR		34
> >>  
> >> +static inline const char *usbssp_trb_comp_code_string(u8 status)
> >
> > <snip>
> >
> >
> > You have _giant_ inline functions here, why?
> >
> > Please just put this all in a .c file and let the linker properly handle
> > things.  You do not want to duplicate all of these crazy strings all
> > over the place where ever you call these functions.
> >
> > And I am guessing this is only for some sort of "debugging" mode?  If
> > so, shouldn't there be a way to not even build this in?  Some systems
> > are very space constrained...
> 
> many of them seem to be a straight copy from xhci.

Which doesn't mean it's a great model to copy :)

Let's learn from our past mistakes, having had to try to slim down a
kernel for a limited memory system is a chore that no one should have to
manually hack up the source tree just to accomplish it.

thanks,

greg k-h

             reply	other threads:[~2018-09-11  8:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11  8:12 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-11  9:01 [02/31] usb: usbssp: Added some decoding functions Pawel Laszczak
2018-09-11  5:48 Felipe Balbi
2018-09-10 18:18 Greg Kroah-Hartman
2018-07-19 17:57 Pawel Laszczak
2018-07-12 17:07 Greg Kroah-Hartman
2018-07-12 16:43 Pawel Laszczak
2018-07-12  6:35 Greg Kroah-Hartman
2018-07-12  6:28 Pawel Laszczak
2018-07-12  6:10 Greg Kroah-Hartman
2018-07-12  5:46 Pawel Laszczak

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=20180911081227.GB8963@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adouglas@cadence.com \
    --cc=balbi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ltyrala@cadence.com \
    --cc=pawell@cadence.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;
as well as URLs for NNTP newsgroup(s).