From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Remove unneeded calculation and magic number
Date: Thu, 3 May 2012 11:18:21 +0300 [thread overview]
Message-ID: <20120503081814.GA8310@aemeltch-MOBL1> (raw)
In-Reply-To: <1336031752-8153-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi,
On Thu, May 03, 2012 at 10:55:52AM +0300, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Remove magic number unneeded calculation since
> hlen = L2CAP_HDR_SIZE + L2CAP_PSMLEN_SIZE
Since Gustavo removed hlen I'll do the same.
Best regards
Andrei Emeltchenko
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> net/bluetooth/l2cap_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 07a09cc..1748c3c 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1922,8 +1922,8 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
> /* Create L2CAP header */
> lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);
> lh->cid = cpu_to_le16(chan->dcid);
> - lh->len = cpu_to_le16(len + (hlen - L2CAP_HDR_SIZE));
> - put_unaligned(chan->psm, skb_put(skb, 2));
> + lh->len = cpu_to_le16(len + L2CAP_PSMLEN_SIZE);
> + put_unaligned(chan->psm, skb_put(skb, L2CAP_PSMLEN_SIZE));
>
> err = l2cap_skbuff_fromiovec(chan, msg, len, count, skb);
> if (unlikely(err < 0)) {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-05-03 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-03 7:55 [PATCH] Bluetooth: Remove unneeded calculation and magic number Andrei Emeltchenko
2012-05-03 8:18 ` Andrei Emeltchenko [this message]
2012-05-03 8:28 ` Andrei Emeltchenko
2012-05-04 19:23 ` Gustavo Padovan
-- strict thread matches above, loose matches on Subject: below --
2012-05-04 7:29 Andrei Emeltchenko
2012-05-06 16:03 ` Marcel Holtmann
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=20120503081814.GA8310@aemeltch-MOBL1 \
--to=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;
as well as URLs for NNTP newsgroup(s).