lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACVXFVOM0sfaqM2dBGdRPsnAM3cUnAH0zKrwUr1xMd3e_x16rA@mail.gmail.com>
Date:	Mon, 5 Aug 2013 22:33:32 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Alan Stern <stern@...land.harvard.edu>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Oliver Neukum <oneukum@...e.de>,
	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	netdev@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 1/4] USB: introduce usb_device_no_sg_constraint() helper

On Mon, Aug 5, 2013 at 10:07 PM, Alan Stern <stern@...land.harvard.edu> wrote:
> 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.

OK, this can save 3 line code, and I will take it in v3.

>
> Acked-by: Alan Stern <stern@...land.harvard.edu>

Thanks for your Ack and review.

Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ