diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-08 05:39:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:01 -0500 |
commit | 41f96935b4c41daea2c4dbbf137960375cf764c1 (patch) | |
tree | 9af3af5e41f68baf063b5f929797c837169bb9df /drivers/isdn/hisax | |
parent | 0b2dd130a5a8774a30de1f94266f6b9a9892153c (diff) |
[PATCH] isdn: replace kmalloc+memset with kzalloc
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/config.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/fsm.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc4s8s_l1.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/hisax_fcpcipnp.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hisax/st5481_init.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 3 |
10 files changed, 10 insertions, 23 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index 876fec6c6be8..9e70c206779e 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -123,11 +123,10 @@ static int avma1cs_probe(struct pcmcia_device *p_dev) | |||
123 | DEBUG(0, "avma1cs_attach()\n"); | 123 | DEBUG(0, "avma1cs_attach()\n"); |
124 | 124 | ||
125 | /* Allocate space for private device-specific data */ | 125 | /* Allocate space for private device-specific data */ |
126 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); | 126 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
127 | if (!local) | 127 | if (!local) |
128 | return -ENOMEM; | 128 | return -ENOMEM; |
129 | 129 | ||
130 | memset(local, 0, sizeof(local_info_t)); | ||
131 | p_dev->priv = local; | 130 | p_dev->priv = local; |
132 | 131 | ||
133 | /* The io structure describes IO port mapping */ | 132 | /* The io structure describes IO port mapping */ |
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index cede72cdbb31..9d6b7b0f6746 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c | |||
@@ -869,14 +869,13 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow | |||
869 | struct IsdnCard *card = cards + cardnr; | 869 | struct IsdnCard *card = cards + cardnr; |
870 | struct IsdnCardState *cs; | 870 | struct IsdnCardState *cs; |
871 | 871 | ||
872 | cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); | 872 | cs = kzalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); |
873 | if (!cs) { | 873 | if (!cs) { |
874 | printk(KERN_WARNING | 874 | printk(KERN_WARNING |
875 | "HiSax: No memory for IsdnCardState(card %d)\n", | 875 | "HiSax: No memory for IsdnCardState(card %d)\n", |
876 | cardnr + 1); | 876 | cardnr + 1); |
877 | goto out; | 877 | goto out; |
878 | } | 878 | } |
879 | memset(cs, 0, sizeof(struct IsdnCardState)); | ||
880 | card->cs = cs; | 879 | card->cs = cs; |
881 | spin_lock_init(&cs->statlock); | 880 | spin_lock_init(&cs->statlock); |
882 | spin_lock_init(&cs->lock); | 881 | spin_lock_init(&cs->lock); |
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index 4e180d210faa..79ab9dda7d08 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -146,9 +146,8 @@ static int elsa_cs_probe(struct pcmcia_device *link) | |||
146 | DEBUG(0, "elsa_cs_attach()\n"); | 146 | DEBUG(0, "elsa_cs_attach()\n"); |
147 | 147 | ||
148 | /* Allocate space for private device-specific data */ | 148 | /* Allocate space for private device-specific data */ |
149 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); | 149 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
150 | if (!local) return -ENOMEM; | 150 | if (!local) return -ENOMEM; |
151 | memset(local, 0, sizeof(local_info_t)); | ||
152 | 151 | ||
153 | local->p_dev = link; | 152 | local->p_dev = link; |
154 | link->priv = local; | 153 | link->priv = local; |
diff --git a/drivers/isdn/hisax/fsm.c b/drivers/isdn/hisax/fsm.c index 0d44a3f480ac..34fade96a581 100644 --- a/drivers/isdn/hisax/fsm.c +++ b/drivers/isdn/hisax/fsm.c | |||
@@ -26,12 +26,10 @@ FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount) | |||
26 | int i; | 26 | int i; |
27 | 27 | ||
28 | fsm->jumpmatrix = (FSMFNPTR *) | 28 | fsm->jumpmatrix = (FSMFNPTR *) |
29 | kmalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL); | 29 | kzalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL); |
30 | if (!fsm->jumpmatrix) | 30 | if (!fsm->jumpmatrix) |
31 | return -ENOMEM; | 31 | return -ENOMEM; |
32 | 32 | ||
33 | memset(fsm->jumpmatrix, 0, sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count); | ||
34 | |||
35 | for (i = 0; i < fncount; i++) | 33 | for (i = 0; i < fncount; i++) |
36 | if ((fnlist[i].state>=fsm->state_count) || (fnlist[i].event>=fsm->event_count)) { | 34 | if ((fnlist[i].state>=fsm->state_count) || (fnlist[i].event>=fsm->event_count)) { |
37 | printk(KERN_ERR "FsmNew Error line %d st(%ld/%ld) ev(%ld/%ld)\n", | 35 | printk(KERN_ERR "FsmNew Error line %d st(%ld/%ld) ev(%ld/%ld)\n", |
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c index de9b1a4d6bac..a2fa4ecb8c88 100644 --- a/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/drivers/isdn/hisax/hfc4s8s_l1.c | |||
@@ -1591,11 +1591,10 @@ hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1591 | hfc4s8s_param *driver_data = (hfc4s8s_param *) ent->driver_data; | 1591 | hfc4s8s_param *driver_data = (hfc4s8s_param *) ent->driver_data; |
1592 | hfc4s8s_hw *hw; | 1592 | hfc4s8s_hw *hw; |
1593 | 1593 | ||
1594 | if (!(hw = kmalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) { | 1594 | if (!(hw = kzalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) { |
1595 | printk(KERN_ERR "No kmem for HFC-4S/8S card\n"); | 1595 | printk(KERN_ERR "No kmem for HFC-4S/8S card\n"); |
1596 | return (err); | 1596 | return (err); |
1597 | } | 1597 | } |
1598 | memset(hw, 0, sizeof(hfc4s8s_hw)); | ||
1599 | 1598 | ||
1600 | hw->pdev = pdev; | 1599 | hw->pdev = pdev; |
1601 | err = pci_enable_device(pdev); | 1600 | err = pci_enable_device(pdev); |
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 7105b043add8..5a6989f23fcf 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c | |||
@@ -1481,9 +1481,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1481 | iface = iface_used; | 1481 | iface = iface_used; |
1482 | if (! | 1482 | if (! |
1483 | (context = | 1483 | (context = |
1484 | kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) | 1484 | kzalloc(sizeof(hfcusb_data), GFP_KERNEL))) |
1485 | return (-ENOMEM); /* got no mem */ | 1485 | return (-ENOMEM); /* got no mem */ |
1486 | memset(context, 0, sizeof(hfcusb_data)); | ||
1487 | 1486 | ||
1488 | ep = iface->endpoint; | 1487 | ep = iface->endpoint; |
1489 | vcf = validconf[small_match]; | 1488 | vcf = validconf[small_match]; |
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c index f6db55a752c4..9e088fce8c3a 100644 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c | |||
@@ -841,12 +841,10 @@ new_adapter(void) | |||
841 | struct hisax_b_if *b_if[2]; | 841 | struct hisax_b_if *b_if[2]; |
842 | int i; | 842 | int i; |
843 | 843 | ||
844 | adapter = kmalloc(sizeof(struct fritz_adapter), GFP_KERNEL); | 844 | adapter = kzalloc(sizeof(struct fritz_adapter), GFP_KERNEL); |
845 | if (!adapter) | 845 | if (!adapter) |
846 | return NULL; | 846 | return NULL; |
847 | 847 | ||
848 | memset(adapter, 0, sizeof(struct fritz_adapter)); | ||
849 | |||
850 | adapter->isac.hisax_d_if.owner = THIS_MODULE; | 848 | adapter->isac.hisax_d_if.owner = THIS_MODULE; |
851 | adapter->isac.hisax_d_if.ifc.priv = &adapter->isac; | 849 | adapter->isac.hisax_d_if.ifc.priv = &adapter->isac; |
852 | adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1; | 850 | adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1; |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 46ed65334c51..45debde05fbd 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -155,9 +155,8 @@ static int sedlbauer_probe(struct pcmcia_device *link) | |||
155 | DEBUG(0, "sedlbauer_attach()\n"); | 155 | DEBUG(0, "sedlbauer_attach()\n"); |
156 | 156 | ||
157 | /* Allocate space for private device-specific data */ | 157 | /* Allocate space for private device-specific data */ |
158 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); | 158 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
159 | if (!local) return -ENOMEM; | 159 | if (!local) return -ENOMEM; |
160 | memset(local, 0, sizeof(local_info_t)); | ||
161 | local->cardnr = -1; | 160 | local->cardnr = -1; |
162 | 161 | ||
163 | local->p_dev = link; | 162 | local->p_dev = link; |
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c index 2716aa5c60f7..bb3a28a53ff4 100644 --- a/drivers/isdn/hisax/st5481_init.c +++ b/drivers/isdn/hisax/st5481_init.c | |||
@@ -69,12 +69,10 @@ static int probe_st5481(struct usb_interface *intf, | |||
69 | le16_to_cpu(dev->descriptor.idProduct), | 69 | le16_to_cpu(dev->descriptor.idProduct), |
70 | number_of_leds); | 70 | number_of_leds); |
71 | 71 | ||
72 | adapter = kmalloc(sizeof(struct st5481_adapter), GFP_KERNEL); | 72 | adapter = kzalloc(sizeof(struct st5481_adapter), GFP_KERNEL); |
73 | if (!adapter) | 73 | if (!adapter) |
74 | return -ENOMEM; | 74 | return -ENOMEM; |
75 | 75 | ||
76 | memset(adapter, 0, sizeof(struct st5481_adapter)); | ||
77 | |||
78 | adapter->number_of_leds = number_of_leds; | 76 | adapter->number_of_leds = number_of_leds; |
79 | adapter->usb_dev = dev; | 77 | adapter->usb_dev = dev; |
80 | 78 | ||
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 6b754f183796..3e3e18239ec7 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -137,9 +137,8 @@ static int teles_probe(struct pcmcia_device *link) | |||
137 | DEBUG(0, "teles_attach()\n"); | 137 | DEBUG(0, "teles_attach()\n"); |
138 | 138 | ||
139 | /* Allocate space for private device-specific data */ | 139 | /* Allocate space for private device-specific data */ |
140 | local = kmalloc(sizeof(local_info_t), GFP_KERNEL); | 140 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
141 | if (!local) return -ENOMEM; | 141 | if (!local) return -ENOMEM; |
142 | memset(local, 0, sizeof(local_info_t)); | ||
143 | local->cardnr = -1; | 142 | local->cardnr = -1; |
144 | 143 | ||
145 | local->p_dev = link; | 144 | local->p_dev = link; |