Re: [PATCH 1/4] usb: dwc3: move all string helper functions to debug.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Sep 05, 2014 at 06:23:24PM +0000, Paul Zimmerman wrote:
> > +static inline const char *dwc3_ep_event_string(u8 event)
> > +{
> > +	switch (event) {
> > +	case DWC3_DEPEVT_XFERCOMPLETE:
> > +		return "Transfer Complete";
> > +	case DWC3_DEPEVT_XFERINPROGRESS:
> > +		return "Transfer In-Progress";
> > +	case DWC3_DEPEVT_XFERNOTREADY:
> > +		return "Transfer Not Ready";
> > +	case DWC3_DEPEVT_RXTXFIFOEVT:
> > +		return "FIFO";
> > +	case DWC3_DEPEVT_STREAMEVT:
> > +		return "Stream";
> > +	case DWC3_DEPEVT_EPCMDCMPLT:
> > +		return "Endpoint Command Complete";
> > +	}
> > +
> > +	return "UNKNOWN";
> > +}
> 
> Just curious - did you check the size of the compiled code after this
> change? Since these functions are all inline now, it seems like the
> compiler would be within its rights to duplicate the strings at each
> of the call sites. Hopefully GCC is smarter than that, but you never
> know...

Before:

   text	   data	    bss	    dec	    hex	filename
   7559	    160	      8	   7727	   1e2f	drivers/usb/dwc3/core.o
   9875	      0	      0	   9875	   2693	drivers/usb/dwc3/debugfs.o
  46785	   2051	      8	  48844	   becc	drivers/usb/dwc3/dwc3.o
   7329	    722	      0	   8051	   1f73	drivers/usb/dwc3/ep0.o
  21488	   1169	      0	  22657	   5881	drivers/usb/dwc3/gadget.o
    534	      0	      0	    534	    216	drivers/usb/dwc3/host.o

After:

   text	   data	    bss	    dec	    hex	filename
   7559	    160	      8	   7727	   1e2f	drivers/usb/dwc3/core.o
   9875	      0	      0	   9875	   2693	drivers/usb/dwc3/debugfs.o
  46785	   2051	      8	  48844	   becc	drivers/usb/dwc3/dwc3.o
   7329	    722	      0	   8051	   1f73	drivers/usb/dwc3/ep0.o
  21488	   1169	      0	  22657	   5881	drivers/usb/dwc3/gadget.o
    534	      0	      0	    534	    216	drivers/usb/dwc3/host.o

Even if there was a difference, these little guys are only used when
you have either debug or trace enabled, so you're already dealing with a
development environment and the concerns which minimal there.

cheers

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux