Re: [PATCH 03/11] xhci: Log extra info on "ERROR Transfer event TRB DMA ptr not part of current TD"

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

 



On Mon, 4 Aug 2014, Mathias Nyman wrote:

> > --- a/drivers/usb/host/xhci-ring.c
> > +++ b/drivers/usb/host/xhci-ring.c
> > @@ -1718,10 +1718,12 @@ cleanup:
> >   * TRB in this TD, this function returns that TRB's segment.  Otherwise it
> >   * returns 0.
> >   */
> > -struct xhci_segment *trb_in_td(struct xhci_segment *start_seg,
> > +struct xhci_segment *trb_in_td(struct xhci_hcd *xhci,
> > +		struct xhci_segment *start_seg,
> >  		union xhci_trb	*start_trb,
> >  		union xhci_trb	*end_trb,
> > -		dma_addr_t	suspect_dma)
> > +		dma_addr_t	suspect_dma,
> > +		bool		debug)
> 
> The added debug information is useful, but I'm not a big fan of the boolean debug function parameter.
> 
> I get that we only want to print the information when we really expect the trb to be in the TD, and fail.
> This is a simple way of doing it, but reading the code with lots of true / false function arguments is difficult.
> (xhci has too many of them already)
> 
> I haven't got a better solution, all other variants seems to have their own drawbacks.
> New suggestions are welcome

This function could be made private.  Then there could be two separate 
public functions to call it, one with the debug parameter set to true 
and one with the parameter set to false.

The parameter's name could be changed to something more readable, such 
as warn_if_not_found.

Alan Stern


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




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

  Powered by Linux