diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-09-28 07:36:08 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-09-28 11:55:25 -0400 |
commit | 42632805f5f2d754567e9fff5298d14a40680d71 (patch) | |
tree | 4d5a8c3748e452c556fe88b5e5e1ab73f6b96936 /drivers/bluetooth | |
parent | 13465c0aeb9c56a4e4799f25aeff41d05f8a3fab (diff) |
Bluetooth: btmrvl: Correct num_block name
Make code readable by correcting name from buf_block_len to num_blocks
since it represent number of blocks; NOT a length of a block buffer.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index 3f4bfc814dc7..645b42e143fa 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -492,7 +492,7 @@ done: | |||
492 | static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) | 492 | static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) |
493 | { | 493 | { |
494 | u16 buf_len = 0; | 494 | u16 buf_len = 0; |
495 | int ret, buf_block_len, blksz; | 495 | int ret, num_blocks, blksz; |
496 | struct sk_buff *skb = NULL; | 496 | struct sk_buff *skb = NULL; |
497 | u32 type; | 497 | u32 type; |
498 | u8 *payload = NULL; | 498 | u8 *payload = NULL; |
@@ -514,18 +514,17 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) | |||
514 | } | 514 | } |
515 | 515 | ||
516 | blksz = SDIO_BLOCK_SIZE; | 516 | blksz = SDIO_BLOCK_SIZE; |
517 | buf_block_len = (buf_len + blksz - 1) / blksz; | 517 | num_blocks = (buf_len + blksz - 1) / blksz; |
518 | 518 | ||
519 | if (buf_len <= SDIO_HEADER_LEN | 519 | if (buf_len <= SDIO_HEADER_LEN |
520 | || (buf_block_len * blksz) > ALLOC_BUF_SIZE) { | 520 | || (num_blocks * blksz) > ALLOC_BUF_SIZE) { |
521 | BT_ERR("invalid packet length: %d", buf_len); | 521 | BT_ERR("invalid packet length: %d", buf_len); |
522 | ret = -EINVAL; | 522 | ret = -EINVAL; |
523 | goto exit; | 523 | goto exit; |
524 | } | 524 | } |
525 | 525 | ||
526 | /* Allocate buffer */ | 526 | /* Allocate buffer */ |
527 | skb = bt_skb_alloc(buf_block_len * blksz + BTSDIO_DMA_ALIGN, | 527 | skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_ATOMIC); |
528 | GFP_ATOMIC); | ||
529 | if (skb == NULL) { | 528 | if (skb == NULL) { |
530 | BT_ERR("No free skb"); | 529 | BT_ERR("No free skb"); |
531 | goto exit; | 530 | goto exit; |
@@ -541,7 +540,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) | |||
541 | payload = skb->data; | 540 | payload = skb->data; |
542 | 541 | ||
543 | ret = sdio_readsb(card->func, payload, card->ioport, | 542 | ret = sdio_readsb(card->func, payload, card->ioport, |
544 | buf_block_len * blksz); | 543 | num_blocks * blksz); |
545 | if (ret < 0) { | 544 | if (ret < 0) { |
546 | BT_ERR("readsb failed: %d", ret); | 545 | BT_ERR("readsb failed: %d", ret); |
547 | ret = -EIO; | 546 | ret = -EIO; |
@@ -590,7 +589,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) | |||
590 | default: | 589 | default: |
591 | BT_ERR("Unknown packet type:%d", type); | 590 | BT_ERR("Unknown packet type:%d", type); |
592 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload, | 591 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload, |
593 | blksz * buf_block_len); | 592 | blksz * num_blocks); |
594 | 593 | ||
595 | kfree_skb(skb); | 594 | kfree_skb(skb); |
596 | skb = NULL; | 595 | skb = NULL; |