All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER
@ 2013-02-18 16:04 Syam Sidhardhan
  2013-02-18 16:04 ` [PATCH 2/2] avctp: Fix invalid file descriptor close Syam Sidhardhan
  2013-02-18 16:13 ` [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Johan Hedberg
  0 siblings, 2 replies; 6+ messages in thread
From: Syam Sidhardhan @ 2013-02-18 16:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan

Fixes the following error:
tools/btmgmt.c: In function ‘index_rsp’:
tools/btmgmt.c:756:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
tools/btmgmt.c: In function ‘cmd_info’:
tools/btmgmt.c:791:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make[1]: *** [tools/btmgmt.o] Error 1
make: *** [all] Error 2
---
 tools/btmgmt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 85e790b..715efde 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -753,7 +753,7 @@ static void index_rsp(uint8_t status, uint16_t len, const void *param,
 		if (monitor)
 			printf("hci%u ", index);
 
-		data = GINT_TO_POINTER(index);
+		data = GINT_TO_POINTER((gint) index);
 
 		if (mgmt_send(mgmt, MGMT_OP_READ_INFO, index, 0, NULL,
 						info_rsp, data, NULL) == 0) {
@@ -788,7 +788,7 @@ static void cmd_info(struct mgmt *mgmt, uint16_t index, int argc, char **argv)
 		return;
 	}
 
-	data = GINT_TO_POINTER(index);
+	data = GINT_TO_POINTER((gint) index);
 
 	if (mgmt_send(mgmt, MGMT_OP_READ_INFO, index, 0, NULL, info_rsp,
 							data, NULL) == 0) {
-- 
1.7.9.5


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

* [PATCH 2/2] avctp: Fix invalid file descriptor close
  2013-02-18 16:04 [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Syam Sidhardhan
@ 2013-02-18 16:04 ` Syam Sidhardhan
  2013-02-20  8:00   ` Johan Hedberg
  2013-02-18 16:13 ` [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Johan Hedberg
  1 sibling, 1 reply; 6+ messages in thread
From: Syam Sidhardhan @ 2013-02-18 16:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan

During avctp_confirm_cb(), if any error happens we set the session
state to AVCTP_STATE_DISCONNECTED, which inturn try to close fd 0.
---

I'm not sure about this fix in the latest upstream code,
but in the case of Bluez 4.101, I got the following
error log(with extra fd print) and this patch fixes the same.

audio/avctp.c:avctp_confirm_cb() AVCTP: incoming connect from BC:47:60:F5:88:89
Refusing unexpected connect from BC:47:60:F5:88:89
audio/avctp.c:avctp_set_state() AVCTP Disconnected
    audio/avctp.c:avctp_disconnected()
AVCTP: closing uinput[fd=0] for BC:47:60:F5:88:89


 profiles/audio/avctp.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 13dd4c3..c276c52 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1201,6 +1201,7 @@ static struct avctp *avctp_get_internal(struct btd_device *device)
 	session->server = server;
 	session->device = btd_device_ref(device);
 	session->state = AVCTP_STATE_DISCONNECTED;
+	session->uinput = -1;
 
 	server->sessions = g_slist_append(server->sessions, session);
 
-- 
1.7.9.5


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

* Re: [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER
  2013-02-18 16:04 [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Syam Sidhardhan
  2013-02-18 16:04 ` [PATCH 2/2] avctp: Fix invalid file descriptor close Syam Sidhardhan
@ 2013-02-18 16:13 ` Johan Hedberg
  2013-02-18 16:44   ` Lucas De Marchi
  1 sibling, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2013-02-18 16:13 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth

Hi Syam,

On Mon, Feb 18, 2013, Syam Sidhardhan wrote:
> Fixes the following error:
> tools/btmgmt.c: In function ‘index_rsp’:
> tools/btmgmt.c:756:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> tools/btmgmt.c: In function ‘cmd_info’:
> tools/btmgmt.c:791:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> cc1: all warnings being treated as errors
> make[1]: *** [tools/btmgmt.o] Error 1
> make: *** [all] Error 2
> ---
>  tools/btmgmt.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

This patch has been applied. For whatever reason I did not get this
warning/error in my environment. Which gcc version and architecture are
you using?

Johan

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

* Re: [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER
  2013-02-18 16:13 ` [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Johan Hedberg
@ 2013-02-18 16:44   ` Lucas De Marchi
  2013-02-19  9:30     ` Syam Sidhardhan
  0 siblings, 1 reply; 6+ messages in thread
From: Lucas De Marchi @ 2013-02-18 16:44 UTC (permalink / raw)
  To: Syam Sidhardhan, linux-bluetooth

On Mon, Feb 18, 2013 at 1:13 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Syam,
>
> On Mon, Feb 18, 2013, Syam Sidhardhan wrote:
>> Fixes the following error:
>> tools/btmgmt.c: In function ‘index_rsp’:
>> tools/btmgmt.c:756:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>> tools/btmgmt.c: In function ‘cmd_info’:
>> tools/btmgmt.c:791:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>> cc1: all warnings being treated as errors
>> make[1]: *** [tools/btmgmt.o] Error 1
>> make: *** [all] Error 2
>> ---
>>  tools/btmgmt.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> This patch has been applied. For whatever reason I did not get this
> warning/error in my environment. Which gcc version and architecture are
> you using?

The problem is more likely to be in the different glib versions and
running on 32 bits:
https://bugzilla.gnome.org/show_bug.cgi?id=661546

Lucas De Marchi

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

* Re: [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER
  2013-02-18 16:44   ` Lucas De Marchi
@ 2013-02-19  9:30     ` Syam Sidhardhan
  0 siblings, 0 replies; 6+ messages in thread
From: Syam Sidhardhan @ 2013-02-19  9:30 UTC (permalink / raw)
  To: Lucas De Marchi, linux-bluetooth

Hi Johan,

-----Original Message----- 
From: Lucas De Marchi
Sent: Monday, February 18, 2013 10:14 PM
To: Syam Sidhardhan ; linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER

On Mon, Feb 18, 2013 at 1:13 PM, Johan Hedberg <johan.hedberg@gmail.com> 
wrote:
> Hi Syam,
>
> On Mon, Feb 18, 2013, Syam Sidhardhan wrote:
>> Fixes the following error:
>> tools/btmgmt.c: In function ‘index_rsp’:
>> tools/btmgmt.c:756:10: error: cast to pointer from integer of different 
>> size [-Werror=int-to-pointer-cast]
>> tools/btmgmt.c: In function ‘cmd_info’:
>> tools/btmgmt.c:791:9: error: cast to pointer from integer of different 
>> size [-Werror=int-to-pointer-cast]
>> cc1: all warnings being treated as errors
>> make[1]: *** [tools/btmgmt.o] Error 1
>> make: *** [all] Error 2
>> ---
>>  tools/btmgmt.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> This patch has been applied. For whatever reason I did not get this
> warning/error in my environment. Which gcc version and architecture are
> you using?

The problem is more likely to be in the different glib versions and
running on 32 bits:
https://bugzilla.gnome.org/show_bug.cgi?id=661546

I found this in gcc version 4.6.3 for PC arch(i386 on ubuntu 12.04) with 
glib version 2.28.0.

Regards,
Syam 


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

* Re: [PATCH 2/2] avctp: Fix invalid file descriptor close
  2013-02-18 16:04 ` [PATCH 2/2] avctp: Fix invalid file descriptor close Syam Sidhardhan
@ 2013-02-20  8:00   ` Johan Hedberg
  0 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2013-02-20  8:00 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth

Hi Syam,

On Mon, Feb 18, 2013, Syam Sidhardhan wrote:
> During avctp_confirm_cb(), if any error happens we set the session
> state to AVCTP_STATE_DISCONNECTED, which inturn try to close fd 0.
> ---
> 
> I'm not sure about this fix in the latest upstream code,
> but in the case of Bluez 4.101, I got the following
> error log(with extra fd print) and this patch fixes the same.
> 
> audio/avctp.c:avctp_confirm_cb() AVCTP: incoming connect from BC:47:60:F5:88:89
> Refusing unexpected connect from BC:47:60:F5:88:89
> audio/avctp.c:avctp_set_state() AVCTP Disconnected
>     audio/avctp.c:avctp_disconnected()
> AVCTP: closing uinput[fd=0] for BC:47:60:F5:88:89
> 
> 
>  profiles/audio/avctp.c |    1 +
>  1 file changed, 1 insertion(+)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2013-02-20  8:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18 16:04 [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Syam Sidhardhan
2013-02-18 16:04 ` [PATCH 2/2] avctp: Fix invalid file descriptor close Syam Sidhardhan
2013-02-20  8:00   ` Johan Hedberg
2013-02-18 16:13 ` [PATCH 1/2] tools: Fix compilation error with GINT_TO_POINTER Johan Hedberg
2013-02-18 16:44   ` Lucas De Marchi
2013-02-19  9:30     ` Syam Sidhardhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.