aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/jsm/jsm_tty.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2007-02-14 03:33:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:52 -0500
commit8f31bb39ec2a5622974666c72257e74c22492602 (patch)
tree48f38c994f02c8699fe2a69599e8cc1bc8d36ea8 /drivers/serial/jsm/jsm_tty.c
parent3689a0ec60bc8f56cc372c1dfa0d89dab48f7c9c (diff)
[PATCH] serial: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/jsm/jsm_tty.c')
-rw-r--r--drivers/serial/jsm/jsm_tty.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
index 7cf1c60027f8..be22bbdbc8e5 100644
--- a/drivers/serial/jsm/jsm_tty.c
+++ b/drivers/serial/jsm/jsm_tty.c
@@ -194,31 +194,28 @@ static int jsm_tty_open(struct uart_port *port)
194 /* Drop locks, as malloc with GFP_KERNEL can sleep */ 194 /* Drop locks, as malloc with GFP_KERNEL can sleep */
195 195
196 if (!channel->ch_rqueue) { 196 if (!channel->ch_rqueue) {
197 channel->ch_rqueue = (u8 *) kmalloc(RQUEUESIZE, GFP_KERNEL); 197 channel->ch_rqueue = kzalloc(RQUEUESIZE, GFP_KERNEL);
198 if (!channel->ch_rqueue) { 198 if (!channel->ch_rqueue) {
199 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev, 199 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev,
200 "unable to allocate read queue buf"); 200 "unable to allocate read queue buf");
201 return -ENOMEM; 201 return -ENOMEM;
202 } 202 }
203 memset(channel->ch_rqueue, 0, RQUEUESIZE);
204 } 203 }
205 if (!channel->ch_equeue) { 204 if (!channel->ch_equeue) {
206 channel->ch_equeue = (u8 *) kmalloc(EQUEUESIZE, GFP_KERNEL); 205 channel->ch_equeue = kzalloc(EQUEUESIZE, GFP_KERNEL);
207 if (!channel->ch_equeue) { 206 if (!channel->ch_equeue) {
208 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev, 207 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev,
209 "unable to allocate error queue buf"); 208 "unable to allocate error queue buf");
210 return -ENOMEM; 209 return -ENOMEM;
211 } 210 }
212 memset(channel->ch_equeue, 0, EQUEUESIZE);
213 } 211 }
214 if (!channel->ch_wqueue) { 212 if (!channel->ch_wqueue) {
215 channel->ch_wqueue = (u8 *) kmalloc(WQUEUESIZE, GFP_KERNEL); 213 channel->ch_wqueue = kzalloc(WQUEUESIZE, GFP_KERNEL);
216 if (!channel->ch_wqueue) { 214 if (!channel->ch_wqueue) {
217 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev, 215 jsm_printk(INIT, ERR, &channel->ch_bd->pci_dev,
218 "unable to allocate write queue buf"); 216 "unable to allocate write queue buf");
219 return -ENOMEM; 217 return -ENOMEM;
220 } 218 }
221 memset(channel->ch_wqueue, 0, WQUEUESIZE);
222 } 219 }
223 220
224 channel->ch_flags &= ~(CH_OPENING); 221 channel->ch_flags &= ~(CH_OPENING);
@@ -392,13 +389,12 @@ int jsm_tty_init(struct jsm_board *brd)
392 * Okay to malloc with GFP_KERNEL, we are not at 389 * Okay to malloc with GFP_KERNEL, we are not at
393 * interrupt context, and there are no locks held. 390 * interrupt context, and there are no locks held.
394 */ 391 */
395 brd->channels[i] = kmalloc(sizeof(struct jsm_channel), GFP_KERNEL); 392 brd->channels[i] = kzalloc(sizeof(struct jsm_channel), GFP_KERNEL);
396 if (!brd->channels[i]) { 393 if (!brd->channels[i]) {
397 jsm_printk(CORE, ERR, &brd->pci_dev, 394 jsm_printk(CORE, ERR, &brd->pci_dev,
398 "%s:%d Unable to allocate memory for channel struct\n", 395 "%s:%d Unable to allocate memory for channel struct\n",
399 __FILE__, __LINE__); 396 __FILE__, __LINE__);
400 } 397 }
401 memset(brd->channels[i], 0, sizeof(struct jsm_channel));
402 } 398 }
403 } 399 }
404 400