[PATCH 1/3] emulator/bthost: Simplify bthost_create

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

 



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

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