aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2005-11-07 04:01:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:00 -0500
commit089b1dbbde28f0f641c20beabba28fa89ab4fab9 (patch)
treed95a59688897569f2aa875ec5a9576caaedfc2cc
parentf5e3c2faa20615e900ab26bd957f898400435924 (diff)
[PATCH] bluetooth: kmalloc + memset -> kzalloc conversion
Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Cc: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/bluetooth/bcm203x.c4
-rw-r--r--drivers/bluetooth/bfusb.c4
-rw-r--r--drivers/bluetooth/bluecard_cs.c3
-rw-r--r--drivers/bluetooth/bpa10x.c4
-rw-r--r--drivers/bluetooth/bt3c_cs.c3
-rw-r--r--drivers/bluetooth/btuart_cs.c3
-rw-r--r--drivers/bluetooth/dtl1_cs.c3
-rw-r--r--drivers/bluetooth/hci_bcsp.c3
-rw-r--r--drivers/bluetooth/hci_h4.c4
-rw-r--r--drivers/bluetooth/hci_ldisc.c4
-rw-r--r--drivers/bluetooth/hci_usb.c4
-rw-r--r--drivers/bluetooth/hci_vhci.c4
12 files changed, 12 insertions, 31 deletions
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 5fd3e4cb7525..8e7fb3551775 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -179,14 +179,12 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
179 if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0)) 179 if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0))
180 return -ENODEV; 180 return -ENODEV;
181 181
182 data = kmalloc(sizeof(*data), GFP_KERNEL); 182 data = kzalloc(sizeof(*data), GFP_KERNEL);
183 if (!data) { 183 if (!data) {
184 BT_ERR("Can't allocate memory for data structure"); 184 BT_ERR("Can't allocate memory for data structure");
185 return -ENOMEM; 185 return -ENOMEM;
186 } 186 }
187 187
188 memset(data, 0, sizeof(*data));
189
190 data->udev = udev; 188 data->udev = udev;
191 data->state = BCM203X_LOAD_MINIDRV; 189 data->state = BCM203X_LOAD_MINIDRV;
192 190
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 1e9db0156ea7..067e27893e4a 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -673,13 +673,11 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
673 } 673 }
674 674
675 /* Initialize control structure and load firmware */ 675 /* Initialize control structure and load firmware */
676 if (!(bfusb = kmalloc(sizeof(struct bfusb), GFP_KERNEL))) { 676 if (!(bfusb = kzalloc(sizeof(struct bfusb), GFP_KERNEL))) {
677 BT_ERR("Can't allocate memory for control structure"); 677 BT_ERR("Can't allocate memory for control structure");
678 goto done; 678 goto done;
679 } 679 }
680 680
681 memset(bfusb, 0, sizeof(struct bfusb));
682
683 bfusb->udev = udev; 681 bfusb->udev = udev;
684 bfusb->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; 682 bfusb->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress;
685 bfusb->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress; 683 bfusb->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress;
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 26fe9c0e1d20..f36c563d72c4 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -870,10 +870,9 @@ static dev_link_t *bluecard_attach(void)
870 int ret; 870 int ret;
871 871
872 /* Create new info device */ 872 /* Create new info device */
873 info = kmalloc(sizeof(*info), GFP_KERNEL); 873 info = kzalloc(sizeof(*info), GFP_KERNEL);
874 if (!info) 874 if (!info)
875 return NULL; 875 return NULL;
876 memset(info, 0, sizeof(*info));
877 876
878 link = &info->link; 877 link = &info->link;
879 link->priv = info; 878 link->priv = info;
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 0db0400519c9..ecbeb7eaba8e 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -553,14 +553,12 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
553 if (intf->cur_altsetting->desc.bInterfaceNumber > 0) 553 if (intf->cur_altsetting->desc.bInterfaceNumber > 0)
554 return -ENODEV; 554 return -ENODEV;
555 555
556 data = kmalloc(sizeof(*data), GFP_KERNEL); 556 data = kzalloc(sizeof(*data), GFP_KERNEL);
557 if (!data) { 557 if (!data) {
558 BT_ERR("Can't allocate data structure"); 558 BT_ERR("Can't allocate data structure");
559 return -ENOMEM; 559 return -ENOMEM;
560 } 560 }
561 561
562 memset(data, 0, sizeof(*data));
563
564 data->udev = udev; 562 data->udev = udev;
565 563
566 rwlock_init(&data->lock); 564 rwlock_init(&data->lock);
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 2e0338d80f32..d2a0add19cc8 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -671,10 +671,9 @@ static dev_link_t *bt3c_attach(void)
671 int ret; 671 int ret;
672 672
673 /* Create new info device */ 673 /* Create new info device */
674 info = kmalloc(sizeof(*info), GFP_KERNEL); 674 info = kzalloc(sizeof(*info), GFP_KERNEL);
675 if (!info) 675 if (!info)
676 return NULL; 676 return NULL;
677 memset(info, 0, sizeof(*info));
678 677
679 link = &info->link; 678 link = &info->link;
680 link->priv = info; 679 link->priv = info;
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 89486ea7a021..529a28a3209d 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -590,10 +590,9 @@ static dev_link_t *btuart_attach(void)
590 int ret; 590 int ret;
591 591
592 /* Create new info device */ 592 /* Create new info device */
593 info = kmalloc(sizeof(*info), GFP_KERNEL); 593 info = kzalloc(sizeof(*info), GFP_KERNEL);
594 if (!info) 594 if (!info)
595 return NULL; 595 return NULL;
596 memset(info, 0, sizeof(*info));
597 596
598 link = &info->link; 597 link = &info->link;
599 link->priv = info; 598 link->priv = info;
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 84c1f8839422..dec5980a1cd6 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -569,10 +569,9 @@ static dev_link_t *dtl1_attach(void)
569 int ret; 569 int ret;
570 570
571 /* Create new info device */ 571 /* Create new info device */
572 info = kmalloc(sizeof(*info), GFP_KERNEL); 572 info = kzalloc(sizeof(*info), GFP_KERNEL);
573 if (!info) 573 if (!info)
574 return NULL; 574 return NULL;
575 memset(info, 0, sizeof(*info));
576 575
577 link = &info->link; 576 link = &info->link;
578 link->priv = info; 577 link->priv = info;
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 0a4761415ac3..8fddfdfd0fbd 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -715,10 +715,9 @@ static int bcsp_open(struct hci_uart *hu)
715 715
716 BT_DBG("hu %p", hu); 716 BT_DBG("hu %p", hu);
717 717
718 bcsp = kmalloc(sizeof(*bcsp), GFP_ATOMIC); 718 bcsp = kzalloc(sizeof(*bcsp), GFP_ATOMIC);
719 if (!bcsp) 719 if (!bcsp)
720 return -ENOMEM; 720 return -ENOMEM;
721 memset(bcsp, 0, sizeof(*bcsp));
722 721
723 hu->priv = bcsp; 722 hu->priv = bcsp;
724 skb_queue_head_init(&bcsp->unack); 723 skb_queue_head_init(&bcsp->unack);
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 12e369a66fc2..4804d474dc87 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -76,12 +76,10 @@ static int h4_open(struct hci_uart *hu)
76 76
77 BT_DBG("hu %p", hu); 77 BT_DBG("hu %p", hu);
78 78
79 h4 = kmalloc(sizeof(*h4), GFP_ATOMIC); 79 h4 = kzalloc(sizeof(*h4), GFP_ATOMIC);
80 if (!h4) 80 if (!h4)
81 return -ENOMEM; 81 return -ENOMEM;
82 82
83 memset(h4, 0, sizeof(*h4));
84
85 skb_queue_head_init(&h4->txq); 83 skb_queue_head_init(&h4->txq);
86 84
87 hu->priv = h4; 85 hu->priv = h4;
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 4a775f6ea390..573ff6c1be5f 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -272,13 +272,11 @@ static int hci_uart_tty_open(struct tty_struct *tty)
272 if (hu) 272 if (hu)
273 return -EEXIST; 273 return -EEXIST;
274 274
275 if (!(hu = kmalloc(sizeof(struct hci_uart), GFP_KERNEL))) { 275 if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
276 BT_ERR("Can't allocate controll structure"); 276 BT_ERR("Can't allocate controll structure");
277 return -ENFILE; 277 return -ENFILE;
278 } 278 }
279 279
280 memset(hu, 0, sizeof(struct hci_uart));
281
282 tty->disc_data = hu; 280 tty->disc_data = hu;
283 hu->tty = tty; 281 hu->tty = tty;
284 282
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 6756cb20b753..f510b25b2c59 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -875,13 +875,11 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
875 goto done; 875 goto done;
876 } 876 }
877 877
878 if (!(husb = kmalloc(sizeof(struct hci_usb), GFP_KERNEL))) { 878 if (!(husb = kzalloc(sizeof(struct hci_usb), GFP_KERNEL))) {
879 BT_ERR("Can't allocate: control structure"); 879 BT_ERR("Can't allocate: control structure");
880 goto done; 880 goto done;
881 } 881 }
882 882
883 memset(husb, 0, sizeof(struct hci_usb));
884
885 husb->udev = udev; 883 husb->udev = udev;
886 husb->bulk_out_ep = bulk_out_ep; 884 husb->bulk_out_ep = bulk_out_ep;
887 husb->bulk_in_ep = bulk_in_ep; 885 husb->bulk_in_ep = bulk_in_ep;
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 52cbd45c308f..85738223ff0c 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -261,12 +261,10 @@ static int vhci_open(struct inode *inode, struct file *file)
261 struct vhci_data *vhci; 261 struct vhci_data *vhci;
262 struct hci_dev *hdev; 262 struct hci_dev *hdev;
263 263
264 vhci = kmalloc(sizeof(struct vhci_data), GFP_KERNEL); 264 vhci = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
265 if (!vhci) 265 if (!vhci)
266 return -ENOMEM; 266 return -ENOMEM;
267 267
268 memset(vhci, 0, sizeof(struct vhci_data));
269
270 skb_queue_head_init(&vhci->readq); 268 skb_queue_head_init(&vhci->readq);
271 init_waitqueue_head(&vhci->read_wait); 269 init_waitqueue_head(&vhci->read_wait);
272 270