linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hciattach: Fix the timeout handling code
@ 2010-06-30 11:41 Vladimir Davydov
  2010-06-30 11:46 ` Johan Hedberg
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Davydov @ 2010-06-30 11:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Johan Hedberg, Sergey Kovalev

From: Vladimir Davydov <vladimir.davydov@promwad.com>

The variable 'retries' should be defined as static, or it will be always 0.

Signed-off-by: Vladimir Davydov <vladimir.davydov@promwad.com>

---
 tools/hciattach.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/hciattach.c b/tools/hciattach.c
index b13db1b..e772b6f 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -326,7 +326,8 @@ static int bcsp_max_retries = 10;
 static void bcsp_tshy_sig_alarm(int sig)
 {
 	unsigned char bcsp_sync_pkt[10] = 
{0xc0,0x00,0x41,0x00,0xbe,0xda,0xdc,0xed,0xed,0xc0};
-	int len, retries = 0;
+	int len;
+	static int retries = 0;
 
 	if (retries < bcsp_max_retries) {
 		retries++;
@@ -343,7 +344,8 @@ static void bcsp_tshy_sig_alarm(int sig)
 static void bcsp_tconf_sig_alarm(int sig)
 {
 	unsigned char bcsp_conf_pkt[10] = 
{0xc0,0x00,0x41,0x00,0xbe,0xad,0xef,0xac,0xed,0xc0};
-	int len, retries = 0;
+	int len;
+	static int retries = 0;
 
 	if (retries < bcsp_max_retries){
 		retries++;
-- 
1.6.4.2

-- 
Vladimir Davydov
Senior Developer
Promwad Innovation Company
Web: www.promwad.com
22, Olshevskogo St.,
220073, Minsk,
BELARUS
Phone/Fax: +375 (17) 312–1246
E-mail: vladimir.davydov@promwad.com
Skype: v_davydov

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] hciattach: Fix the timeout handling code
@ 2010-06-30 13:21 Vladimir Davydov
  2010-06-30 14:39 ` Johan Hedberg
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Davydov @ 2010-06-30 13:21 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Johan Hedberg, Sergey Kovalev, Vladimir Davydov

The variable 'retries' should be defined as static, or it will be always
0.
---
 tools/hciattach.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/hciattach.c b/tools/hciattach.c
index b13db1b..e772b6f 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -326,7 +326,8 @@ static int bcsp_max_retries = 10;
 static void bcsp_tshy_sig_alarm(int sig)
 {
 	unsigned char bcsp_sync_pkt[10] = {0xc0,0x00,0x41,0x00,0xbe,0xda,0xdc,0xed,0xed,0xc0};
-	int len, retries = 0;
+	int len;
+	static int retries = 0;
 
 	if (retries < bcsp_max_retries) {
 		retries++;
@@ -343,7 +344,8 @@ static void bcsp_tshy_sig_alarm(int sig)
 static void bcsp_tconf_sig_alarm(int sig)
 {
 	unsigned char bcsp_conf_pkt[10] = {0xc0,0x00,0x41,0x00,0xbe,0xad,0xef,0xac,0xed,0xc0};
-	int len, retries = 0;
+	int len;
+	static int retries = 0;
 
 	if (retries < bcsp_max_retries){
 		retries++;
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-30 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-30 11:41 [PATCH] hciattach: Fix the timeout handling code Vladimir Davydov
2010-06-30 11:46 ` Johan Hedberg
  -- strict thread matches above, loose matches on Subject: below --
2010-06-30 13:21 Vladimir Davydov
2010-06-30 14:39 ` Johan Hedberg

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).