linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szymon Janc <szymon@janc.net.pl>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon@janc.net.pl>
Subject: [PATCH] Remove not needed total variable in get_ltk_info
Date: Mon,  5 Mar 2012 19:58:39 +0100	[thread overview]
Message-ID: <1330973919-3704-1-git-send-email-szymon@janc.net.pl> (raw)

This variable is not really needed and was mostly dead assigned.
---
 src/adapter.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 3c23971..acb845e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1776,10 +1776,9 @@ static struct smp_ltk_info *get_ltk_info(const char *addr, const char *value)
 {
 	struct smp_ltk_info *ltk;
 	char *ptr;
-	int i, ret, total;
+	int i, ret;
 
-	total = strlen(value);
-	if (total < 60) {
+	if (strlen(value) < 60) {
 		error("Unexpectedly short (%zu) LTK", strlen(value));
 		return NULL;
 	}
@@ -1791,7 +1790,6 @@ static struct smp_ltk_info *get_ltk_info(const char *addr, const char *value)
 	str2buf(value, ltk->val, sizeof(ltk->val));
 
 	ptr = (char *) value + 2 * sizeof(ltk->val) + 1;
-	total -= 2 * sizeof(ltk->val) + 1;
 
 	ret = sscanf(ptr, " %hhd %hhd %hhd %hhd %hd %n",
 					(uint8_t *) &ltk->addr_type,
@@ -1802,7 +1800,6 @@ static struct smp_ltk_info *get_ltk_info(const char *addr, const char *value)
 		return NULL;
 	}
 	ptr += i;
-	total -= i;
 
 	str2buf(ptr, ltk->rand, sizeof(ltk->rand));
 
-- 
1.7.9.1



             reply	other threads:[~2012-03-05 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 18:58 Szymon Janc [this message]
2012-03-05 19:35 ` [PATCH] Remove not needed total variable in get_ltk_info Johan Hedberg

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=1330973919-3704-1-git-send-email-szymon@janc.net.pl \
    --to=szymon@janc.net.pl \
    --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).