linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] emulator/hciemu: Fix return value
@ 2015-11-16 13:12 Gowtham Anandha Babu
  2015-11-16 13:51 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Gowtham Anandha Babu @ 2015-11-16 13:12 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: bharat.panda, Gowtham Anandha Babu

make throws out the following errors.

emulator/hciemu.c: In function ‘hciemu_get_master_scan_enable’:
emulator/hciemu.c:433:3: error: return makes integer from pointer without a cast [-Werror]
   return NULL;
   ^
emulator/hciemu.c: In function ‘hciemu_get_master_le_scan_enable’:
emulator/hciemu.c:441:3: error: return makes integer from pointer without a cast [-Werror]
   return NULL;
   ^
cc1: all warnings being treated as errors

Fixed by returning zero.
---
 emulator/hciemu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emulator/hciemu.c b/emulator/hciemu.c
index c8d9db5..6a53499 100644
--- a/emulator/hciemu.c
+++ b/emulator/hciemu.c
@@ -430,7 +430,7 @@ const uint8_t *hciemu_get_client_bdaddr(struct hciemu *hciemu)
 uint8_t hciemu_get_master_scan_enable(struct hciemu *hciemu)
 {
 	if (!hciemu || !hciemu->master_dev)
-		return NULL;
+		return 0;
 
 	return btdev_get_scan_enable(hciemu->master_dev);
 }
@@ -438,7 +438,7 @@ uint8_t hciemu_get_master_scan_enable(struct hciemu *hciemu)
 uint8_t hciemu_get_master_le_scan_enable(struct hciemu *hciemu)
 {
 	if (!hciemu || !hciemu->master_dev)
-		return NULL;
+		return 0;
 
 	return btdev_get_le_scan_enable(hciemu->master_dev);
 }
-- 
1.9.1


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

* Re: [PATCH] emulator/hciemu: Fix return value
  2015-11-16 13:12 [PATCH] emulator/hciemu: Fix return value Gowtham Anandha Babu
@ 2015-11-16 13:51 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-11-16 13:51 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth, bharat.panda

Hi Gowtham,

On Mon, Nov 16, 2015, Gowtham Anandha Babu wrote:
> make throws out the following errors.
> 
> emulator/hciemu.c: In function ‘hciemu_get_master_scan_enable’:
> emulator/hciemu.c:433:3: error: return makes integer from pointer without a cast [-Werror]
>    return NULL;
>    ^
> emulator/hciemu.c: In function ‘hciemu_get_master_le_scan_enable’:
> emulator/hciemu.c:441:3: error: return makes integer from pointer without a cast [-Werror]
>    return NULL;
>    ^
> cc1: all warnings being treated as errors
> 
> Fixed by returning zero.
> ---
>  emulator/hciemu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.

Interestingly these were previously returning 'bool' instead of 'uint8_t'
which apparently didn't cause this kind of warning.

Johan

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

end of thread, other threads:[~2015-11-16 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16 13:12 [PATCH] emulator/hciemu: Fix return value Gowtham Anandha Babu
2015-11-16 13:51 ` 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).