diff options
Diffstat (limited to 'drivers/memstick')
| -rw-r--r-- | drivers/memstick/core/memstick.c | 3 | ||||
| -rw-r--r-- | drivers/memstick/core/ms_block.c | 7 | ||||
| -rw-r--r-- | drivers/memstick/core/mspro_block.c | 11 | ||||
| -rw-r--r-- | drivers/memstick/host/jmb38x_ms.c | 2 |
4 files changed, 10 insertions, 13 deletions
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index acafc910bbac..e03989c4e99e 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c @@ -380,8 +380,7 @@ EXPORT_SYMBOL(memstick_set_rw_addr); static struct memstick_dev *memstick_alloc_card(struct memstick_host *host) { - struct memstick_dev *card = kzalloc(sizeof(struct memstick_dev), - GFP_KERNEL); + struct memstick_dev *card = kzalloc_obj(struct memstick_dev); struct memstick_dev *old_card = host->card; struct ms_id_register id_reg; diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index 1af157ce0a63..a01fe313558e 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -1203,8 +1203,7 @@ static int msb_read_boot_blocks(struct msb_data *msb) dbg_verbose("Start of a scan for the boot blocks"); if (!msb->boot_page) { - page = kmalloc_array(2, sizeof(struct ms_boot_page), - GFP_KERNEL); + page = kmalloc_objs(struct ms_boot_page, 2); if (!page) return -ENOMEM; @@ -2151,7 +2150,7 @@ static int msb_probe(struct memstick_dev *card) struct msb_data *msb; int rc = 0; - msb = kzalloc(sizeof(struct msb_data), GFP_KERNEL); + msb = kzalloc_obj(struct msb_data); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -2225,7 +2224,7 @@ static int msb_resume(struct memstick_dev *card) #endif mutex_lock(&card->host->lock); - new_msb = kzalloc(sizeof(struct msb_data), GFP_KERNEL); + new_msb = kzalloc_obj(struct msb_data); if (!new_msb) goto out; diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index e507bb11c802..4a52830026c5 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -939,9 +939,8 @@ static int mspro_block_read_attributes(struct memstick_dev *card) } else attr_count = attr->count; - msb->attr_group.attrs = kcalloc(attr_count + 1, - sizeof(*msb->attr_group.attrs), - GFP_KERNEL); + msb->attr_group.attrs = kzalloc_objs(*msb->attr_group.attrs, + attr_count + 1); if (!msb->attr_group.attrs) { rc = -ENOMEM; goto out_free_attr; @@ -955,7 +954,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card) } for (cnt = 0; cnt < attr_count; ++cnt) { - s_attr = kzalloc(sizeof(struct mspro_sys_attr), GFP_KERNEL); + s_attr = kzalloc_obj(struct mspro_sys_attr); if (!s_attr) { rc = -ENOMEM; goto out_free_buffer; @@ -1211,7 +1210,7 @@ static int mspro_block_probe(struct memstick_dev *card) struct mspro_block_data *msb; int rc = 0; - msb = kzalloc(sizeof(struct mspro_block_data), GFP_KERNEL); + msb = kzalloc_obj(struct mspro_block_data); if (!msb) return -ENOMEM; memstick_set_drvdata(card, msb); @@ -1298,7 +1297,7 @@ static int mspro_block_resume(struct memstick_dev *card) unsigned char cnt; mutex_lock(&host->lock); - new_msb = kzalloc(sizeof(struct mspro_block_data), GFP_KERNEL); + new_msb = kzalloc_obj(struct mspro_block_data); if (!new_msb) { rc = -ENOMEM; goto out_unlock; diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c index 79e66e30417c..d93ba5e8662c 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -926,7 +926,7 @@ static int jmb38x_ms_probe(struct pci_dev *pdev, goto err_out_int; } - jm = kzalloc(struct_size(jm, hosts, cnt), GFP_KERNEL); + jm = kzalloc_flex(*jm, hosts, cnt); if (!jm) { rc = -ENOMEM; goto err_out_int; |
