diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-06-25 22:39:45 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 00:13:21 (GMT) |
commit | 5ac24979dcb3418a295e11823c1f2506df1d9926 (patch) | |
tree | 7f7994297c3075371983a09c319eb7a851ff2d84 /drivers | |
parent | 251da4130115b29403a57096fa0988249f31fc55 (diff) | |
download | linux-fsl-qoriq-5ac24979dcb3418a295e11823c1f2506df1d9926.tar.xz |
net: qmi_wwan: simplify a check in qmi_wwan_bind()
This code is easier to read if we specify which flags we want at the
condition instead of at the top of the function.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 68ca676..484eaa5 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -129,7 +129,6 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc; struct usb_cdc_union_desc *cdc_union = NULL; struct usb_cdc_ether_desc *cdc_ether = NULL; - u32 required = 1 << USB_CDC_HEADER_TYPE | 1 << USB_CDC_UNION_TYPE; u32 found = 0; struct usb_driver *driver = driver_of(intf); struct qmi_wwan_state *info = (void *)&dev->data; @@ -197,7 +196,8 @@ next_desc: } /* did we find all the required ones? */ - if ((found & required) != required) { + if (!(found & (1 << USB_CDC_HEADER_TYPE)) || + !(found & (1 << USB_CDC_UNION_TYPE))) { dev_err(&intf->dev, "CDC functional descriptors missing\n"); goto err; } |