linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] emulator/bthost: Simplify bthost_create
@ 2014-11-03 16:20 Szymon Janc
  2014-11-03 16:20 ` [PATCH 2/3] emulator/bthost: Move smp_start to bthost_create Szymon Janc
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Szymon Janc @ 2014-11-03 16:20 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Use new0 instead of malloc+memset for allocating bthost.
---
 emulator/bthost.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/emulator/bthost.c b/emulator/bthost.c
index a2c72a9..a123228 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -219,12 +219,10 @@ struct bthost *bthost_create(void)
 {
 	struct bthost *bthost;
 
-	bthost = malloc(sizeof(*bthost));
+	bthost = new0(struct bthost, 1);
 	if (!bthost)
 		return NULL;
 
-	memset(bthost, 0, sizeof(*bthost));
-
 	/* Set defaults */
 	bthost->io_capability = 0x03;
 
-- 
1.9.1


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

end of thread, other threads:[~2014-11-04  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 16:20 [PATCH 1/3] emulator/bthost: Simplify bthost_create Szymon Janc
2014-11-03 16:20 ` [PATCH 2/3] emulator/bthost: Move smp_start to bthost_create Szymon Janc
2014-11-03 16:20 ` [PATCH 3/3] emulator/bthost: Remove empty bthost_stop function Szymon Janc
2014-11-04  9:02 ` [PATCH 1/3] emulator/bthost: Simplify bthost_create 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).