[PATCH] Remove not needed total variable in get_ltk_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux