From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Stern Subject: Re: [PATCH v2 1/4] USB: introduce usb_device_no_sg_constraint() helper Date: Mon, 5 Aug 2013 10:07:34 -0400 (EDT) Message-ID: References: <1375692423-9497-2-git-send-email-ming.lei@canonical.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "David S. Miller" , Greg Kroah-Hartman , Oliver Neukum , Sarah Sharp , , To: Ming Lei Return-path: In-Reply-To: <1375692423-9497-2-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Mon, 5 Aug 2013, Ming Lei wrote: > Some host controllers(such as xHCI) can support building > packet from discontinuous buffers, so introduce one flag > and helper for this kind of host controllers, then the > feature can help some applications(such as usbnet) by > supporting arbitrary length of sg buffers. > +static inline bool usb_device_no_sg_constraint(struct usb_device *udev) > +{ > + if (udev && udev->bus && udev->bus->no_sg_constraint) > + return true; > + else > + return false; > +} A more elegant implementation would be: return udev && udev->bus && udev->bus->no_sg_constraint; I doubt it will make any difference to the object code, though. Apart from that, this looks fine. Acked-by: Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html