Commit b9183fdd authored by Alison Schofield's avatar Alison Schofield Committed by Greg Kroah-Hartman

staging: vt6656: move local var init into declaration

Improve readability by initializing local variables at declaration.

In one instance, vnt_start_interrupt_urb_complete(), also use that
local variable in subsequent switch.
Signed-off-by: default avatarAlison Schofield <amsfield22@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e0f86b3
...@@ -101,9 +101,9 @@ void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data) ...@@ -101,9 +101,9 @@ void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data)
static void vnt_start_interrupt_urb_complete(struct urb *urb) static void vnt_start_interrupt_urb_complete(struct urb *urb)
{ {
struct vnt_private *priv = urb->context; struct vnt_private *priv = urb->context;
int status; int status = urb->status;
switch (urb->status) { switch (status) {
case 0: case 0:
case -ETIMEDOUT: case -ETIMEDOUT:
break; break;
...@@ -116,8 +116,6 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb) ...@@ -116,8 +116,6 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb)
break; break;
} }
status = urb->status;
if (status != STATUS_SUCCESS) { if (status != STATUS_SUCCESS) {
priv->int_buf.in_use = false; priv->int_buf.in_use = false;
...@@ -207,9 +205,8 @@ static void vnt_submit_rx_urb_complete(struct urb *urb) ...@@ -207,9 +205,8 @@ static void vnt_submit_rx_urb_complete(struct urb *urb)
int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
{ {
int status = 0; int status = 0;
struct urb *urb; struct urb *urb = rcb->urb;
urb = rcb->urb;
if (!rcb->skb) { if (!rcb->skb) {
dev_dbg(&priv->usb->dev, "rcb->skb is null\n"); dev_dbg(&priv->usb->dev, "rcb->skb is null\n");
return status; return status;
...@@ -269,15 +266,13 @@ int vnt_tx_context(struct vnt_private *priv, ...@@ -269,15 +266,13 @@ int vnt_tx_context(struct vnt_private *priv,
struct vnt_usb_send_context *context) struct vnt_usb_send_context *context)
{ {
int status; int status;
struct urb *urb; struct urb *urb = context->urb;
if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) { if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) {
context->in_use = false; context->in_use = false;
return STATUS_RESOURCES; return STATUS_RESOURCES;
} }
urb = context->urb;
usb_fill_bulk_urb(urb, usb_fill_bulk_urb(urb,
priv->usb, priv->usb,
usb_sndbulkpipe(priv->usb, 3), usb_sndbulkpipe(priv->usb, 3),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment