Linux bluetooth development
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv1 1/3] Bluetooth: btmrvl: Correct num_block name
Date: Thu, 27 Sep 2012 17:48:48 -0300	[thread overview]
Message-ID: <20120927204848.GB15463@joana> (raw)
In-Reply-To: <1348732308-29348-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

* Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> [2012-09-27 10:51:46 +0300]:

> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> 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>
> ---
>  drivers/bluetooth/btmrvl_sdio.c |   13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
> index da4df9c..25dc53b 100644
> --- a/drivers/bluetooth/btmrvl_sdio.c
> +++ b/drivers/bluetooth/btmrvl_sdio.c
> @@ -492,7 +492,7 @@ done:
>  static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
>  {
>  	u16 buf_len = 0;
> -	int ret, buf_block_len, blksz;
> +	int ret, num_blocks, blksz;
>  	struct sk_buff *skb = NULL;
>  	u32 type;
>  	u8 *payload = NULL;
> @@ -516,18 +516,17 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
>  	BT_DBG("%s buf_len %zu", hdev->name, buf_len);
>  
>  	blksz = SDIO_BLOCK_SIZE;
> -	buf_block_len = (buf_len + blksz - 1) / blksz;
> +	num_blocks = (buf_len + blksz - 1) / blksz;
>  
>  	if (buf_len <= SDIO_HEADER_LEN
> -			|| (buf_block_len * blksz) > ALLOC_BUF_SIZE) {
> +	    || (num_blocks * blksz) > ALLOC_BUF_SIZE) {
>  		BT_ERR("invalid packet length: %d", buf_len);
>  		ret = -EINVAL;
>  		goto exit;
>  	}
>  
>  	/* Allocate buffer */
> -	skb = bt_skb_alloc(buf_block_len * blksz + BTSDIO_DMA_ALIGN,
> -								GFP_ATOMIC);
> +	skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_ATOMIC);
>  	if (skb == NULL) {
>  		BT_ERR("No free skb");
>  		goto exit;
> @@ -543,7 +542,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
>  	payload = skb->data;
>  
>  	ret = sdio_readsb(card->func, payload, card->ioport,
> -			  buf_block_len * blksz);
> +			  num_blocks * blksz);
>  	if (ret < 0) {
>  		BT_ERR("readsb failed: %d", ret);
>  		ret = -EIO;
> @@ -594,7 +593,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
>  	default:
>  		BT_ERR("Unknown packet type:%d", type);
>  		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload,
> -						blksz * buf_block_len);
> +				     blksz * num_blocks);
>  
>  		kfree_skb(skb);
>  		skb = NULL;

By some reason this patch fails to apply:

Applying: Bluetooth: btmrvl: Correct num_block name
fatal: sha1 information is lacking or useless
(drivers/bluetooth/btmrvl_sdio.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bluetooth: btmrvl: Correct num_block name

	Gustavo

      parent reply	other threads:[~2012-09-27 20:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27  7:51 [PATCHv1 1/3] Bluetooth: btmrvl: Correct num_block name Andrei Emeltchenko
2012-09-27  7:51 ` [PATCHv1 2/3] Bluetooth: btmrvl: Use DIV_ROUND_UP macro Andrei Emeltchenko
2012-09-27  7:51 ` [PATCHv1 3/3] Bluetooth: btmrvl: Fix skb buffer overflow Andrei Emeltchenko
2012-09-27 20:51   ` Gustavo Padovan
2012-09-28 11:36     ` [PATCH 1/3] Bluetooth: btmrvl: Correct num_block name Andrei Emeltchenko
2012-09-28 11:36       ` [PATCH 2/3] Bluetooth: btmrvl: Use DIV_ROUND_UP macro Andrei Emeltchenko
2012-09-28 11:36       ` [PATCH 3/3] Bluetooth: btmrvl: Fix skb buffer overflow Andrei Emeltchenko
2012-09-28 19:52         ` Gustavo Padovan
2012-09-27 20:48 ` Gustavo Padovan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120927204848.GB15463@joana \
    --to=gustavo@padovan.org \
    --cc=Andrei.Emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox