aboutsummaryrefslogtreecommitdiff
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-03-24 03:15:31 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 07:33:18 -0800
commit88abaab4f9b08381e30e737980a1c49d6b524dfc (patch)
treed33aa82674c00c37cd293c9e888cff785880ce5a /drivers/s390/cio
parentfb630517f0d0736ea73af07d6b357be9ad67e6f1 (diff)
[PATCH] s390: kzalloc() conversion in drivers/s390
Convert all kmalloc + memset sequences in drivers/s390 to kzalloc usage. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/ccwgroup.c3
-rw-r--r--drivers/s390/cio/chsc.c3
-rw-r--r--drivers/s390/cio/css.c3
-rw-r--r--drivers/s390/cio/device.c6
-rw-r--r--drivers/s390/cio/device_ops.c9
-rw-r--r--drivers/s390/cio/qdio.c20
6 files changed, 15 insertions, 29 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 8013c8eb76f..bdfee7fbaa2 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -157,11 +157,10 @@ ccwgroup_create(struct device *root,
if (argc > 256) /* disallow dumb users */
return -EINVAL;
- gdev = kmalloc(sizeof(*gdev) + argc*sizeof(gdev->cdev[0]), GFP_KERNEL);
+ gdev = kzalloc(sizeof(*gdev) + argc*sizeof(gdev->cdev[0]), GFP_KERNEL);
if (!gdev)
return -ENOMEM;
- memset(gdev, 0, sizeof(*gdev) + argc*sizeof(gdev->cdev[0]));
atomic_set(&gdev->onoff, 0);
del_drvdata = 0;
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 8b57fe62a9f..6412b2c3edd 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1403,10 +1403,9 @@ new_channel_path(int chpid)
struct channel_path *chp;
int ret;
- chp = kmalloc(sizeof(struct channel_path), GFP_KERNEL);
+ chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL);
if (!chp)
return -ENOMEM;
- memset(chp, 0, sizeof(struct channel_path));
/* fill in status, etc. */
chp->id = chpid;
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 5b304dbacae..74ea8aac4b7 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -630,10 +630,9 @@ css_enqueue_subchannel_slow(struct subchannel_id schid)
struct slow_subchannel *new_slow_sch;
unsigned long flags;
- new_slow_sch = kmalloc(sizeof(struct slow_subchannel), GFP_ATOMIC);
+ new_slow_sch = kzalloc(sizeof(struct slow_subchannel), GFP_ATOMIC);
if (!new_slow_sch)
return -ENOMEM;
- memset(new_slow_sch, 0, sizeof(struct slow_subchannel));
new_slow_sch->schid = schid;
spin_lock_irqsave(&slow_subchannel_lock, flags);
list_add_tail(&new_slow_sch->slow_list, &slow_subchannels_head);
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index afc4e88551a..8e3053c2a45 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -826,17 +826,15 @@ io_subchannel_probe (struct subchannel *sch)
get_device(&cdev->dev);
return 0;
}
- cdev = kmalloc (sizeof(*cdev), GFP_KERNEL);
+ cdev = kzalloc (sizeof(*cdev), GFP_KERNEL);
if (!cdev)
return -ENOMEM;
- memset(cdev, 0, sizeof(struct ccw_device));
- cdev->private = kmalloc(sizeof(struct ccw_device_private),
+ cdev->private = kzalloc(sizeof(struct ccw_device_private),
GFP_KERNEL | GFP_DMA);
if (!cdev->private) {
kfree(cdev);
return -ENOMEM;
}
- memset(cdev->private, 0, sizeof(struct ccw_device_private));
atomic_set(&cdev->private->onoff, 0);
cdev->dev = (struct device) {
.parent = &sch->dev,
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 3a50b190328..795abb5a65b 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -359,10 +359,9 @@ read_dev_chars (struct ccw_device *cdev, void **buffer, int length)
CIO_TRACE_EVENT (4, "rddevch");
CIO_TRACE_EVENT (4, sch->dev.bus_id);
- rdc_ccw = kmalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
+ rdc_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
if (!rdc_ccw)
return -ENOMEM;
- memset(rdc_ccw, 0, sizeof(struct ccw1));
rdc_ccw->cmd_code = CCW_CMD_RDC;
rdc_ccw->count = length;
rdc_ccw->flags = CCW_FLAG_SLI;
@@ -426,16 +425,14 @@ read_conf_data_lpm (struct ccw_device *cdev, void **buffer, int *length, __u8 lp
if (!ciw || ciw->cmd == 0)
return -EOPNOTSUPP;
- rcd_ccw = kmalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
+ rcd_ccw = kzalloc(sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
if (!rcd_ccw)
return -ENOMEM;
- memset(rcd_ccw, 0, sizeof(struct ccw1));
- rcd_buf = kmalloc(ciw->count, GFP_KERNEL | GFP_DMA);
+ rcd_buf = kzalloc(ciw->count, GFP_KERNEL | GFP_DMA);
if (!rcd_buf) {
kfree(rcd_ccw);
return -ENOMEM;
}
- memset (rcd_buf, 0, ciw->count);
rcd_ccw->cmd_code = ciw->cmd;
rcd_ccw->cda = (__u32) __pa (rcd_buf);
rcd_ccw->count = ciw->count;
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 9ed37dc9a1b..814f9258ce0 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -1686,16 +1686,14 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr,
int result=-ENOMEM;
for (i=0;i<no_input_qs;i++) {
- q=kmalloc(sizeof(struct qdio_q),GFP_KERNEL);
+ q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL);
if (!q) {
QDIO_PRINT_ERR("kmalloc of q failed!\n");
goto out;
}
- memset(q,0,sizeof(struct qdio_q));
-
- q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL);
+ q->slib = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!q->slib) {
QDIO_PRINT_ERR("kmalloc of slib failed!\n");
goto out;
@@ -1705,14 +1703,12 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr,
}
for (i=0;i<no_output_qs;i++) {
- q=kmalloc(sizeof(struct qdio_q),GFP_KERNEL);
+ q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL);
if (!q) {
goto out;
}
- memset(q,0,sizeof(struct qdio_q));
-
q->slib=kmalloc(PAGE_SIZE,GFP_KERNEL);
if (!q->slib) {
QDIO_PRINT_ERR("kmalloc of slib failed!\n");
@@ -2984,7 +2980,7 @@ qdio_allocate(struct qdio_initialize *init_data)
qdio_allocate_do_dbf(init_data);
/* create irq */
- irq_ptr=kmalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA);
+ irq_ptr = kzalloc(sizeof(struct qdio_irq), GFP_KERNEL | GFP_DMA);
QDIO_DBF_TEXT0(0,setup,"irq_ptr:");
QDIO_DBF_HEX0(0,setup,&irq_ptr,sizeof(void*));
@@ -2994,8 +2990,6 @@ qdio_allocate(struct qdio_initialize *init_data)
return -ENOMEM;
}
- memset(irq_ptr,0,sizeof(struct qdio_irq));
-
init_MUTEX(&irq_ptr->setting_up_sema);
/* QDR must be in DMA area since CCW data address is only 32 bit */
@@ -3686,10 +3680,10 @@ qdio_get_qdio_memory(void)
for (i=1;i<INDICATORS_PER_CACHELINE;i++)
indicator_used[i]=0;
- indicators=(__u32*)kmalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE),
+ indicators = kzalloc(sizeof(__u32)*(INDICATORS_PER_CACHELINE),
GFP_KERNEL);
- if (!indicators) return -ENOMEM;
- memset(indicators,0,sizeof(__u32)*(INDICATORS_PER_CACHELINE));
+ if (!indicators)
+ return -ENOMEM;
return 0;
}