Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23385
b: refs/heads/master
c: 88abaab
h: refs/heads/master
i:
  23383: 98eeec7
v: v3
  • Loading branch information
Eric Sesterhenn authored and Linus Torvalds committed Mar 24, 2006
1 parent aef87f1 commit d7a6786
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 139 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb630517f0d0736ea73af07d6b357be9ad67e6f1
refs/heads/master: 88abaab4f9b08381e30e737980a1c49d6b524dfc
12 changes: 4 additions & 8 deletions trunk/drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ dasd_alloc_device(void)
{
struct dasd_device *device;

device = kmalloc(sizeof (struct dasd_device), GFP_ATOMIC);
device = kzalloc(sizeof (struct dasd_device), GFP_ATOMIC);
if (device == NULL)
return ERR_PTR(-ENOMEM);
memset(device, 0, sizeof (struct dasd_device));
/* open_count = 0 means device online but not in use */
atomic_set(&device->open_count, -1);

Expand Down Expand Up @@ -547,29 +546,26 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
(cplength*sizeof(struct ccw1)) > PAGE_SIZE)
BUG();

cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
if (cqr == NULL)
return ERR_PTR(-ENOMEM);
memset(cqr, 0, sizeof(struct dasd_ccw_req));
cqr->cpaddr = NULL;
if (cplength > 0) {
cqr->cpaddr = kmalloc(cplength*sizeof(struct ccw1),
cqr->cpaddr = kcalloc(cplength, sizeof(struct ccw1),
GFP_ATOMIC | GFP_DMA);
if (cqr->cpaddr == NULL) {
kfree(cqr);
return ERR_PTR(-ENOMEM);
}
memset(cqr->cpaddr, 0, cplength*sizeof(struct ccw1));
}
cqr->data = NULL;
if (datasize > 0) {
cqr->data = kmalloc(datasize, GFP_ATOMIC | GFP_DMA);
cqr->data = kzalloc(datasize, GFP_ATOMIC | GFP_DMA);
if (cqr->data == NULL) {
kfree(cqr->cpaddr);
kfree(cqr);
return ERR_PTR(-ENOMEM);
}
memset(cqr->data, 0, datasize);
}
strncpy((char *) &cqr->magic, magic, 4);
ASCEBC((char *) &cqr->magic, 4);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/block/dcssblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,11 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
/*
* get a struct dcssblk_dev_info
*/
dev_info = kmalloc(sizeof(struct dcssblk_dev_info), GFP_KERNEL);
dev_info = kzalloc(sizeof(struct dcssblk_dev_info), GFP_KERNEL);
if (dev_info == NULL) {
rc = -ENOMEM;
goto out;
}
memset(dev_info, 0, sizeof(struct dcssblk_dev_info));

strcpy(dev_info->segment_name, local_buf);
strlcpy(dev_info->dev.bus_id, local_buf, BUS_ID_SIZE);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/char/fs3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,9 @@ fs3270_alloc_view(void)
{
struct fs3270 *fp;

fp = (struct fs3270 *) kmalloc(sizeof(struct fs3270),GFP_KERNEL);
fp = kzalloc(sizeof(struct fs3270),GFP_KERNEL);
if (!fp)
return ERR_PTR(-ENOMEM);
memset(fp, 0, sizeof(struct fs3270));
fp->init = raw3270_request_alloc(0);
if (IS_ERR(fp->init)) {
kfree(fp);
Expand Down
12 changes: 4 additions & 8 deletions trunk/drivers/s390/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ kbd_alloc(void) {
struct kbd_data *kbd;
int i, len;

kbd = kmalloc(sizeof(struct kbd_data), GFP_KERNEL);
kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL);
if (!kbd)
goto out;
memset(kbd, 0, sizeof(struct kbd_data));
kbd->key_maps = kmalloc(sizeof(key_maps), GFP_KERNEL);
kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL);
if (!key_maps)
goto out_kbd;
memset(kbd->key_maps, 0, sizeof(key_maps));
for (i = 0; i < ARRAY_SIZE(key_maps); i++) {
if (key_maps[i]) {
kbd->key_maps[i] =
Expand All @@ -68,10 +66,9 @@ kbd_alloc(void) {
sizeof(u_short)*NR_KEYS);
}
}
kbd->func_table = kmalloc(sizeof(func_table), GFP_KERNEL);
kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL);
if (!kbd->func_table)
goto out_maps;
memset(kbd->func_table, 0, sizeof(func_table));
for (i = 0; i < ARRAY_SIZE(func_table); i++) {
if (func_table[i]) {
len = strlen(func_table[i]) + 1;
Expand All @@ -82,10 +79,9 @@ kbd_alloc(void) {
}
}
kbd->fn_handler =
kmalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL);
kzalloc(sizeof(fn_handler_fn *) * NR_FN_HANDLER, GFP_KERNEL);
if (!kbd->fn_handler)
goto out_func;
memset(kbd->fn_handler, 0, sizeof(fn_handler_fn *) * NR_FN_HANDLER);
kbd->accent_table =
kmalloc(sizeof(struct kbdiacr)*MAX_DIACR, GFP_KERNEL);
if (!kbd->accent_table)
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/s390/char/monreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,20 @@ mon_alloc_mem(void)
int i,j;
struct mon_private *monpriv;

monpriv = kmalloc(sizeof(struct mon_private), GFP_KERNEL);
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
if (!monpriv) {
P_ERROR("no memory for monpriv\n");
return NULL;
}
memset(monpriv, 0, sizeof(struct mon_private));
for (i = 0; i < MON_MSGLIM; i++) {
monpriv->msg_array[i] = kmalloc(sizeof(struct mon_msg),
monpriv->msg_array[i] = kzalloc(sizeof(struct mon_msg),
GFP_KERNEL);
if (!monpriv->msg_array[i]) {
P_ERROR("open, no memory for msg_array\n");
for (j = 0; j < i; j++)
kfree(monpriv->msg_array[j]);
return NULL;
}
memset(monpriv->msg_array[i], 0, sizeof(struct mon_msg));
}
return monpriv;
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/char/raw3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ raw3270_request_alloc(size_t size)
struct raw3270_request *rq;

/* Allocate request structure */
rq = kmalloc(sizeof(struct raw3270_request), GFP_KERNEL | GFP_DMA);
rq = kzalloc(sizeof(struct raw3270_request), GFP_KERNEL | GFP_DMA);
if (!rq)
return ERR_PTR(-ENOMEM);
memset(rq, 0, sizeof(struct raw3270_request));

/* alloc output buffer. */
if (size > 0) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/char/tape_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ struct tape_class_device *register_tape_dev(
int rc;
char * s;

tcd = kmalloc(sizeof(struct tape_class_device), GFP_KERNEL);
tcd = kzalloc(sizeof(struct tape_class_device), GFP_KERNEL);
if (!tcd)
return ERR_PTR(-ENOMEM);

memset(tcd, 0, sizeof(struct tape_class_device));
strncpy(tcd->device_name, device_name, TAPECLASS_NAME_LEN);
for (s = strchr(tcd->device_name, '/'); s; s = strchr(s, '/'))
*s = '!';
Expand Down
16 changes: 5 additions & 11 deletions trunk/drivers/s390/char/tape_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,16 +453,14 @@ tape_alloc_device(void)
{
struct tape_device *device;

device = (struct tape_device *)
kmalloc(sizeof(struct tape_device), GFP_KERNEL);
device = kzalloc(sizeof(struct tape_device), GFP_KERNEL);
if (device == NULL) {
DBF_EXCEPTION(2, "ti:no mem\n");
PRINT_INFO ("can't allocate memory for "
"tape info structure\n");
return ERR_PTR(-ENOMEM);
}
memset(device, 0, sizeof(struct tape_device));
device->modeset_byte = (char *) kmalloc(1, GFP_KERNEL | GFP_DMA);
device->modeset_byte = kmalloc(1, GFP_KERNEL | GFP_DMA);
if (device->modeset_byte == NULL) {
DBF_EXCEPTION(2, "ti:no mem\n");
PRINT_INFO("can't allocate memory for modeset byte\n");
Expand Down Expand Up @@ -659,34 +657,30 @@ tape_alloc_request(int cplength, int datasize)

DBF_LH(6, "tape_alloc_request(%d, %d)\n", cplength, datasize);

request = (struct tape_request *) kmalloc(sizeof(struct tape_request),
GFP_KERNEL);
request = kzalloc(sizeof(struct tape_request), GFP_KERNEL);
if (request == NULL) {
DBF_EXCEPTION(1, "cqra nomem\n");
return ERR_PTR(-ENOMEM);
}
memset(request, 0, sizeof(struct tape_request));
/* allocate channel program */
if (cplength > 0) {
request->cpaddr = kmalloc(cplength*sizeof(struct ccw1),
request->cpaddr = kcalloc(cplength, sizeof(struct ccw1),
GFP_ATOMIC | GFP_DMA);
if (request->cpaddr == NULL) {
DBF_EXCEPTION(1, "cqra nomem\n");
kfree(request);
return ERR_PTR(-ENOMEM);
}
memset(request->cpaddr, 0, cplength*sizeof(struct ccw1));
}
/* alloc small kernel buffer */
if (datasize > 0) {
request->cpdata = kmalloc(datasize, GFP_KERNEL | GFP_DMA);
request->cpdata = kzalloc(datasize, GFP_KERNEL | GFP_DMA);
if (request->cpdata == NULL) {
DBF_EXCEPTION(1, "cqra nomem\n");
kfree(request->cpaddr);
kfree(request);
return ERR_PTR(-ENOMEM);
}
memset(request->cpdata, 0, datasize);
}
DBF_LH(6, "New request %p(%p/%p)\n", request, request->cpaddr,
request->cpdata);
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/s390/char/tty3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,9 @@ tty3270_alloc_view(void)
struct tty3270 *tp;
int pages;

tp = kmalloc(sizeof(struct tty3270),GFP_KERNEL);
tp = kzalloc(sizeof(struct tty3270), GFP_KERNEL);
if (!tp)
goto out_err;
memset(tp, 0, sizeof(struct tty3270));
tp->freemem_pages =
kmalloc(sizeof(void *) * TTY3270_STRING_PAGES, GFP_KERNEL);
if (!tp->freemem_pages)
Expand Down Expand Up @@ -767,16 +766,14 @@ tty3270_alloc_screen(struct tty3270 *tp)
int lines;

size = sizeof(struct tty3270_line) * (tp->view.rows - 2);
tp->screen = kmalloc(size, GFP_KERNEL);
tp->screen = kzalloc(size, GFP_KERNEL);
if (!tp->screen)
goto out_err;
memset(tp->screen, 0, size);
for (lines = 0; lines < tp->view.rows - 2; lines++) {
size = sizeof(struct tty3270_cell) * tp->view.cols;
tp->screen[lines].cells = kmalloc(size, GFP_KERNEL);
tp->screen[lines].cells = kzalloc(size, GFP_KERNEL);
if (!tp->screen[lines].cells)
goto out_screen;
memset(tp->screen[lines].cells, 0, size);
}
return 0;
out_screen:
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,9 +759,8 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
struct device *dev;
int ret;

dev = kmalloc(sizeof(struct device), GFP_KERNEL);
dev = kzalloc(sizeof(struct device), GFP_KERNEL);
if (dev) {
memset(dev, 0, sizeof(struct device));
snprintf(dev->bus_id, BUS_ID_SIZE, "%s",
priv->internal_name);
dev->bus = &iucv_bus;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/cio/chsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/cio/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/s390/cio/device_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit d7a6786

Please sign in to comment.