Re: [PATCH v3 06/11] usb: musb: factor out hcd initalization

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

 



>>>>> "Daniel" == Daniel Mack <zonque@xxxxxxxxx> writes:

Hi,

 Daniel> +struct musb_hcd_link {
 Daniel> +	struct musb *musb;
 Daniel> +};
 Daniel> +
 Daniel> +struct musb *hcd_to_musb(struct usb_hcd *hcd)
 Daniel> +{
 Daniel> +	struct musb_hcd_link *link = (struct musb_hcd_link *) hcd->hcd_priv;
 Daniel> +	return link->musb;
 Daniel> +}
 Daniel> +
 >> 
 >> Sorry, I missed this first time around - But why the indirection with
 >> musb_hcd_link? Why not simply directly store a pointer to struct musb in
 >> hcd_priv?

 Daniel> Well, that's also possible. I just thought it's nicer (more readable)
 Daniel> that way. But I can as well rework it so the struct isn't needed. It
 Daniel> won't safe us any binary size or anything though. So I'm not sure.

Well, it will save one level of indirection (hcd_priv->link->musb vs
hcd_priv->musb).

 Daniel> Any particular reason why you don't like the struct? :)

Just that it's an unneeded extra level of indirection.

-- 
Bye, Peter Korsgaard
--
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