Re: [PATCH 6/8] usb/gadget: add "new-style" interface to udc-core

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

 



Michal Nazarewicz wrote:
On Tue, 21 Jun 2011 12:12:28 +0200, Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:
@@ -155,6 +193,14 @@ err1:
 }
 EXPORT_SYMBOL_GPL(usb_add_gadget_udc);
+static int udc_is_newstyle(struct usb_udc *udc)
+{
+    if (udc->gadget->ops->udc_start && udc->gadget->ops->udc_stop)
+        return 1;
+    return 0;
+}

Why not just

    return udc->gadget->ops->udc_start && udc->gadget->ops->udc_stop;

“&&” guarantees the result will be 0 or 1.

Sure it does. It looks more obvious to me the other way around.

Sebastian
--
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