Skip to content

Commit

Permalink
nfc: mrvl: reduce the scope of local variables
Browse files Browse the repository at this point in the history
In two places the 'ep_desc' and 'skb' local variables are used only
within if() or for() block, so they scope can be reduced which makes the
entire code slightly easier to follow.  No functional change.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Krzysztof Kozlowski authored and David S. Miller committed Jun 3, 2021
1 parent a582240 commit 2c95e6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/nfc/nfcmrvl/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static int nfcmrvl_inc_tx(struct nfcmrvl_usb_drv_data *drv_data)
static void nfcmrvl_bulk_complete(struct urb *urb)
{
struct nfcmrvl_usb_drv_data *drv_data = urb->context;
struct sk_buff *skb;
int err;

dev_dbg(&drv_data->udev->dev, "urb %p status %d count %d\n",
Expand All @@ -67,6 +66,8 @@ static void nfcmrvl_bulk_complete(struct urb *urb)
return;

if (!urb->status) {
struct sk_buff *skb;

skb = nci_skb_alloc(drv_data->priv->ndev, urb->actual_length,
GFP_ATOMIC);
if (!skb) {
Expand Down Expand Up @@ -285,7 +286,6 @@ static void nfcmrvl_waker(struct work_struct *work)
static int nfcmrvl_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_endpoint_descriptor *ep_desc;
struct nfcmrvl_usb_drv_data *drv_data;
struct nfcmrvl_private *priv;
int i;
Expand All @@ -303,6 +303,8 @@ static int nfcmrvl_probe(struct usb_interface *intf,
return -ENOMEM;

for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
struct usb_endpoint_descriptor *ep_desc;

ep_desc = &intf->cur_altsetting->endpoint[i].desc;

if (!drv_data->bulk_tx_ep &&
Expand Down

0 comments on commit 2c95e6c

Please sign in to comment.