static int coverage_start(const union decode_item *table)
{
coverage.base = kmalloc_objs(struct coverage_entry,
- MAX_COVERAGE_ENTRIES, GFP_KERNEL);
+ MAX_COVERAGE_ENTRIES);
coverage.num_entries = 0;
coverage.nesting = 0;
return table_iter(table, coverage_start_fn, &coverage);
/* Allocate cluster boot configuration structs */
nclusters = mips_cps_numclusters();
mips_cps_cluster_bootcfg = kzalloc_objs(*mips_cps_cluster_bootcfg,
- nclusters, GFP_KERNEL);
+ nclusters);
if (!mips_cps_cluster_bootcfg)
goto err_out;
int v;
core_vpes = core_vpe_count(cl, c);
core_bootcfg[c].vpe_config = kzalloc_objs(*core_bootcfg[c].vpe_config,
- core_vpes,
- GFP_KERNEL);
+ core_vpes);
for (v = 0; v < core_vpes; v++)
cpumask_set_cpu(nvpe++, &mips_cps_cluster_bootcfg[cl].cpumask);
if (!core_bootcfg[c].vpe_config)
vcpu_e500->gtlb_params[1].sets = 1;
vcpu_e500->gtlb_arch = kmalloc_objs(*vcpu_e500->gtlb_arch,
- KVM_E500_TLB0_SIZE + KVM_E500_TLB1_SIZE,
- GFP_KERNEL);
+ KVM_E500_TLB0_SIZE + KVM_E500_TLB1_SIZE);
if (!vcpu_e500->gtlb_arch)
return -ENOMEM;
vcpu_e500->gtlb_offset[1] = KVM_E500_TLB0_SIZE;
vcpu_e500->gtlb_priv[0] = kzalloc_objs(struct tlbe_ref,
- vcpu_e500->gtlb_params[0].entries,
- GFP_KERNEL);
+ vcpu_e500->gtlb_params[0].entries);
if (!vcpu_e500->gtlb_priv[0])
goto free_vcpu;
vcpu_e500->gtlb_priv[1] = kzalloc_objs(struct tlbe_ref,
- vcpu_e500->gtlb_params[1].entries,
- GFP_KERNEL);
+ vcpu_e500->gtlb_params[1].entries);
if (!vcpu_e500->gtlb_priv[1])
goto free_vcpu;
/* Needed for hotplug/migration */
if (!per_nest_pmu_arr) {
per_nest_pmu_arr = kzalloc_objs(struct imc_pmu *,
- get_max_nest_dev() + 1,
- GFP_KERNEL);
+ get_max_nest_dev() + 1);
if (!per_nest_pmu_arr)
goto err;
}
}
ctx->switch_log = kmalloc_flex(*ctx->switch_log, log,
- SWITCH_LOG_BUFSIZE, GFP_KERNEL);
+ SWITCH_LOG_BUFSIZE);
if (!ctx->switch_log) {
rc = -ENOMEM;
opal_max_async_tokens = be32_to_cpup(async);
opal_async_tokens = kzalloc_objs(*opal_async_tokens,
- opal_max_async_tokens, GFP_KERNEL);
+ opal_max_async_tokens);
if (!opal_async_tokens) {
err = -ENOMEM;
goto out_opal_node;
/* Allocate the groups before registering */
for (idx = 0; idx < num_attrs; idx++) {
papr_groups[idx].pg.attrs = kzalloc_objs(*papr_groups[idx].pg.attrs,
- KOBJ_MAX_ATTRS + 1,
- GFP_KERNEL);
+ KOBJ_MAX_ATTRS + 1);
if (!papr_groups[idx].pg.attrs)
goto out_pgattrs;
/* Number of relocations may be large, so kvmalloc it */
*relocation_hashtable = kvmalloc_objs(**relocation_hashtable,
- hashtable_size, GFP_KERNEL);
+ hashtable_size);
if (!*relocation_hashtable)
return 0;
int i;
fwft->configs = kzalloc_objs(struct kvm_sbi_fwft_config,
- ARRAY_SIZE(features), GFP_KERNEL);
+ ARRAY_SIZE(features));
if (!fwft->configs)
return -ENOMEM;
need_paiext_cb = true;
}
cpump->save = kvmalloc_objs(struct pai_userdata,
- pai_pmu[idx].num_avail + 1,
- GFP_KERNEL);
+ pai_pmu[idx].num_avail + 1);
if (!cpump->area || !cpump->save ||
(need_paiext_cb && !cpump->paiext_cb)) {
pai_free(mp);
return -1;
irq_req_buffer = kmalloc_objs(struct io_thread_req *,
- UBD_REQ_BUFFER_SIZE, GFP_KERNEL);
+ UBD_REQ_BUFFER_SIZE);
irq_remainder = 0;
if (irq_req_buffer == NULL) {
return -ENOMEM;
}
io_req_buffer = kmalloc_objs(struct io_thread_req *,
- UBD_REQ_BUFFER_SIZE, GFP_KERNEL);
+ UBD_REQ_BUFFER_SIZE);
io_remainder = 0;
}
dev->intr_ctx = kmalloc_objs(struct uml_vfio_intr_ctx,
- dev->udev.irq_count, GFP_KERNEL);
+ dev->udev.irq_count);
if (!dev->intr_ctx) {
pr_err("Failed to allocate interrupt context (%s)\n",
dev->name);
x86_pmu.num_hybrid_pmus = hweight_long(pmus_mask);
x86_pmu.hybrid_pmu = kzalloc_objs(struct x86_hybrid_pmu,
- x86_pmu.num_hybrid_pmus, GFP_KERNEL);
+ x86_pmu.num_hybrid_pmus);
if (!x86_pmu.hybrid_pmu)
return -ENOMEM;
int i = 0;
uncores = kzalloc_objs(struct intel_uncore_type *,
- num_discovered_types[type_id] + num_extra + 1,
- GFP_KERNEL);
+ num_discovered_types[type_id] + num_extra + 1);
if (!uncores)
return empty_uncore;
/* TDVPS = TDVPR(4K page) + TDCX(multiple 4K pages), -1 for TDVPR. */
kvm_tdx->td.tdcx_nr_pages = tdx_sysinfo->td_ctrl.tdvps_base_size / PAGE_SIZE - 1;
tdcs_pages = kzalloc_objs(*kvm_tdx->td.tdcs_pages,
- kvm_tdx->td.tdcs_nr_pages, GFP_KERNEL);
+ kvm_tdx->td.tdcs_nr_pages);
if (!tdcs_pages)
goto free_tdr;
goto fail_destroy_profile;
blk_crypto_keyslots = kzalloc_objs(blk_crypto_keyslots[0],
- blk_crypto_num_keyslots, GFP_KERNEL);
+ blk_crypto_num_keyslots);
if (!blk_crypto_keyslots)
goto fail_free_wq;
disk->zone_wplugs_hash =
kzalloc_objs(struct hlist_head,
- disk_zone_wplugs_hash_size(disk), GFP_KERNEL);
+ disk_zone_wplugs_hash_size(disk));
if (!disk->zone_wplugs_hash)
return -ENOMEM;
atomic_set(&ctx->thread_ctx_switch_token, 1);
ctx->thread_ctx_switch_wait_token = 0;
ctx->cs_pending = kzalloc_objs(struct hl_fence *,
- hdev->asic_prop.max_pending_cs,
- GFP_KERNEL);
+ hdev->asic_prop.max_pending_cs);
if (!ctx->cs_pending)
return -ENOMEM;
if (hdev->asic_prop.completion_queues_count) {
hdev->cq_wq = kzalloc_objs(struct workqueue_struct *,
- hdev->asic_prop.completion_queues_count,
- GFP_KERNEL);
+ hdev->asic_prop.completion_queues_count);
if (!hdev->cq_wq) {
rc = -ENOMEM;
goto asid_fini;
if (user_interrupt_cnt) {
hdev->user_interrupt = kzalloc_objs(*hdev->user_interrupt,
- user_interrupt_cnt,
- GFP_KERNEL);
+ user_interrupt_cnt);
if (!hdev->user_interrupt) {
rc = -ENOMEM;
goto early_fini;
*/
if (cq_cnt) {
hdev->completion_queue = kzalloc_objs(*hdev->completion_queue,
- cq_cnt, GFP_KERNEL);
+ cq_cnt);
if (!hdev->completion_queue) {
dev_err(hdev->dev,
}
hdev->shadow_cs_queue = kzalloc_objs(struct hl_cs *,
- hdev->asic_prop.max_pending_cs,
- GFP_KERNEL);
+ hdev->asic_prop.max_pending_cs);
if (!hdev->shadow_cs_queue) {
rc = -ENOMEM;
goto cq_fini;
int i, rc, q_ready_cnt;
hdev->kernel_queues = kzalloc_objs(*hdev->kernel_queues,
- asic->max_queues, GFP_KERNEL);
+ asic->max_queues);
if (!hdev->kernel_queues) {
dev_err(hdev->dev, "Not enough memory for H/W queues\n");
}
channels_info = kzalloc_objs(struct hwmon_channel_info *,
- num_active_sensor_types + 1, GFP_KERNEL);
+ num_active_sensor_types + 1);
if (!channels_info) {
rc = -ENOMEM;
goto channels_info_array_err;
prop->max_queues = GAUDI_QUEUE_ID_SIZE;
prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
- prop->max_queues, GFP_KERNEL);
+ prop->max_queues);
if (!prop->hw_queues_props)
return -ENOMEM;
prop->max_queues = GAUDI2_QUEUE_ID_SIZE;
prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
- prop->max_queues, GFP_KERNEL);
+ prop->max_queues);
if (!prop->hw_queues_props)
return -ENOMEM;
prop->glbl_err_max_cause_num = GAUDI2_GLBL_ERR_MAX_CAUSE_NUM;
prop->num_of_special_blocks = ARRAY_SIZE(gaudi2_special_blocks);
prop->special_blocks = kmalloc_objs(*prop->special_blocks,
- prop->num_of_special_blocks,
- GFP_KERNEL);
+ prop->num_of_special_blocks);
if (!prop->special_blocks)
return -ENOMEM;
if (ARRAY_SIZE(gaudi2_iterator_skip_block_types)) {
prop->skip_special_blocks_cfg.block_types =
kmalloc_objs(gaudi2_iterator_skip_block_types[0],
- ARRAY_SIZE(gaudi2_iterator_skip_block_types),
- GFP_KERNEL);
+ ARRAY_SIZE(gaudi2_iterator_skip_block_types));
if (!prop->skip_special_blocks_cfg.block_types) {
rc = -ENOMEM;
goto free_special_blocks;
if (ARRAY_SIZE(gaudi2_iterator_skip_block_ranges)) {
prop->skip_special_blocks_cfg.block_ranges =
kmalloc_objs(gaudi2_iterator_skip_block_ranges[0],
- ARRAY_SIZE(gaudi2_iterator_skip_block_ranges),
- GFP_KERNEL);
+ ARRAY_SIZE(gaudi2_iterator_skip_block_ranges));
if (!prop->skip_special_blocks_cfg.block_ranges) {
rc = -ENOMEM;
goto free_skip_special_blocks_types;
prop->max_queues = GOYA_QUEUE_ID_SIZE;
prop->hw_queues_props = kzalloc_objs(struct hw_queue_properties,
- prop->max_queues, GFP_KERNEL);
+ prop->max_queues);
if (!prop->hw_queues_props)
return -ENOMEM;
{
struct rocket_device *rdev = rocket_priv->rdev;
struct drm_gpu_scheduler **scheds = kmalloc_objs(*scheds,
- rdev->num_cores,
- GFP_KERNEL);
+ rdev->num_cores);
unsigned int core;
int ret;
* special levels (see below)
*/
br->levels = kmalloc_objs(*br->levels,
- obj->package.count + ACPI_VIDEO_FIRST_LEVEL,
- GFP_KERNEL);
+ obj->package.count + ACPI_VIDEO_FIRST_LEVEL);
if (!br->levels) {
result = -ENOMEM;
goto out_free;
dod->package.count);
active_list = kzalloc_objs(struct acpi_video_enumerated_device,
- 1 + dod->package.count, GFP_KERNEL);
+ 1 + dod->package.count);
if (!active_list) {
status = -ENOMEM;
goto out;
acpi_get_handle(handle, entry->source, &link_handle);
dep_devices.count = 1;
dep_devices.handles = kzalloc_objs(*dep_devices.handles,
- 1, GFP_KERNEL);
+ 1);
if (!dep_devices.handles) {
acpi_handle_err(handle, "failed to allocate memory\n");
continue;
gsi_handle = riscv_acpi_get_gsi_handle(entry->source_index);
dep_devices.count = 1;
dep_devices.handles = kzalloc_objs(*dep_devices.handles,
- 1, GFP_KERNEL);
+ 1);
if (!dep_devices.handles) {
acpi_handle_err(handle, "failed to allocate memory\n");
continue;
}
lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
- package->package.count,
- GFP_KERNEL);
+ package->package.count);
if (!lpi_constraints_table)
goto free_acpi_buffer;
return;
lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
- out_obj->package.count, GFP_KERNEL);
+ out_obj->package.count);
if (!lpi_constraints_table)
goto free_acpi_buffer;
}
target_procs = kzalloc_objs(struct binder_proc *,
- target_procs_count, GFP_KERNEL);
+ target_procs_count);
if (!target_procs) {
mutex_unlock(&binder_procs_lock);
alloc->vm_start = vma->vm_start;
alloc->pages = kvzalloc_objs(alloc->pages[0],
- alloc->buffer_size / PAGE_SIZE, GFP_KERNEL);
+ alloc->buffer_size / PAGE_SIZE);
if (!alloc->pages) {
ret = -ENOMEM;
failure_string = "alloc page array";
buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2;
eni_dev->free_list = kmalloc_objs(*eni_dev->free_list,
- eni_dev->free_list_size + 1,
- GFP_KERNEL);
+ eni_dev->free_list_size + 1);
if (!eni_dev->free_list) {
printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
dev->number);
/* Allocate all required memory */
per_cpu_index_dev(cpu) = kzalloc_objs(struct device *,
- cache_leaves(cpu), GFP_KERNEL);
+ cache_leaves(cpu));
if (unlikely(per_cpu_index_dev(cpu) == NULL))
goto err_out;
* nr_poll_queues: the number of polling queues
*/
dev->hw_queues = kzalloc_objs(*dev->hw_queues,
- nr_cpu_ids + nr_poll_queues, GFP_KERNEL);
+ nr_cpu_ids + nr_poll_queues);
if (!dev->hw_queues) {
ret = -ENOMEM;
goto out_alloc;
rinfo->shadow[i].grants_used =
kvzalloc_objs(rinfo->shadow[i].grants_used[0], grants);
rinfo->shadow[i].sg = kvzalloc_objs(rinfo->shadow[i].sg[0],
- psegs, GFP_KERNEL);
+ psegs);
if (info->max_indirect_segments)
rinfo->shadow[i].indirect_grants =
kvzalloc_objs(rinfo->shadow[i].indirect_grants[0],
- INDIRECT_GREFS(grants),
- GFP_KERNEL);
+ INDIRECT_GREFS(grants));
if ((rinfo->shadow[i].grants_used == NULL) ||
(rinfo->shadow[i].sg == NULL) ||
(info->max_indirect_segments &&
mhi_ep_mmio_init(mhi_cntrl);
mhi_cntrl->mhi_event = kzalloc_objs(*mhi_cntrl->mhi_event,
- mhi_cntrl->event_rings, GFP_KERNEL);
+ mhi_cntrl->event_rings);
if (!mhi_cntrl->mhi_event)
return -ENOMEM;
* only the defined channels
*/
mhi_cntrl->mhi_chan = kzalloc_objs(*mhi_cntrl->mhi_chan,
- mhi_cntrl->max_chan, GFP_KERNEL);
+ mhi_cntrl->max_chan);
if (!mhi_cntrl->mhi_chan)
return -ENOMEM;
/* Allocate ring cache memory for holding the copy of host ring */
ring->ring_cache = kzalloc_objs(struct mhi_ring_element,
- ring->ring_size, GFP_KERNEL);
+ ring->ring_size);
if (!ring->ring_cache)
return -ENOMEM;
soc_rev = (readl(scu_g6_base + ASPEED_G6_SILICON_REV) & CHIP_REVISION_ID) >> 16;
aspeed_g6_clk_data = kzalloc_flex(*aspeed_g6_clk_data, hws,
- ASPEED_G6_NUM_CLKS, GFP_KERNEL);
+ ASPEED_G6_NUM_CLKS);
if (!aspeed_g6_clk_data)
return;
aspeed_g6_clk_data->num = ASPEED_G6_NUM_CLKS;
BUG_ON(!base);
clps711x_clk = kzalloc_flex(*clps711x_clk, clk_data.hws,
- CLPS711X_CLK_MAX, GFP_KERNEL);
+ CLPS711X_CLK_MAX);
BUG_ON(!clps711x_clk);
spin_lock_init(&clps711x_clk->lock);
goto npcm7xx_init_error;
npcm7xx_clk_data = kzalloc_flex(*npcm7xx_clk_data, hws,
- NPCM7XX_NUM_CLOCKS, GFP_KERNEL);
+ NPCM7XX_NUM_CLOCKS);
if (!npcm7xx_clk_data)
goto npcm7xx_init_np_err;
ost->soc_info = id->data;
ost->clocks = kzalloc_flex(*ost->clocks, hws,
- ost->soc_info->num_channels, GFP_KERNEL);
+ ost->soc_info->num_channels);
if (!ost->clocks) {
ret = -ENOMEM;
goto err_clk_disable;
counter_dev->counters = kzalloc_objs(*counter, num_counters);
counter_dev->regs = kzalloc_objs(*counter_dev->regs,
- counter_dev->num_chips, GFP_KERNEL);
+ counter_dev->num_chips);
if (!counter_dev->regs || !counter_dev->counters) {
kfree(counter_dev->regs);
kfree(counter_dev->counters);
goto err_free_tl;
telemetry->regs_hist_buff = kmalloc_objs(*telemetry->regs_hist_buff,
- tl_data->num_hbuff, GFP_KERNEL);
+ tl_data->num_hbuff);
if (!telemetry->regs_hist_buff)
goto err_free_rp_indexes;
if (suof_handle->img_table.num_simgs != 0) {
suof_img_hdr = kzalloc_objs(img_header,
- suof_handle->img_table.num_simgs,
- GFP_KERNEL);
+ suof_handle->img_table.num_simgs);
if (!suof_img_hdr)
return -ENOMEM;
suof_handle->img_table.simg_hdr = suof_img_hdr;
sobj_chunk_num = sobj_hdr->num_chunks;
mobj_hdr = kzalloc_objs(*mobj_hdr,
- size_add(uobj_chunk_num, sobj_chunk_num),
- GFP_KERNEL);
+ size_add(uobj_chunk_num, sobj_chunk_num));
if (!mobj_hdr)
return -ENOMEM;
dev_ctl->instances = dev_inst;
dev_blk = kzalloc_objs(struct edac_device_block,
- nr_instances * nr_blocks, GFP_KERNEL);
+ nr_instances * nr_blocks);
if (!dev_blk)
goto free;
return NULL;
sbridge_dev->pdev = kzalloc_objs(*sbridge_dev->pdev,
- table->n_devs_per_imc, GFP_KERNEL);
+ table->n_devs_per_imc);
if (!sbridge_dev->pdev) {
kfree(sbridge_dev);
return NULL;
return 0;
edev->extcon_dev_type.groups = kzalloc_objs(*edev->extcon_dev_type.groups,
- edev->max_supported + 2,
- GFP_KERNEL);
+ edev->max_supported + 2);
if (!edev->extcon_dev_type.groups)
return -ENOMEM;
int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count)
{
struct page **page_array __free(kfree) = kzalloc_objs(page_array[0],
- page_count,
- GFP_KERNEL);
+ page_count);
if (!page_array)
return -ENOMEM;
enum dma_data_direction direction)
{
dma_addr_t *dma_addrs __free(kfree) = kzalloc_objs(dma_addrs[0],
- buffer->page_count,
- GFP_KERNEL);
+ buffer->page_count);
int i;
if (!dma_addrs)
*/
ip_hw_instance = kzalloc_flex(*ip_hw_instance,
base_addr,
- ip->num_base_address,
- GFP_KERNEL);
+ ip->num_base_address);
if (!ip_hw_instance) {
DRM_ERROR("no memory for ip_hw_instance");
return -ENOMEM;
bool valid;
adev->gmc.mem_partitions = kzalloc_objs(struct amdgpu_mem_partition_info,
- AMDGPU_MAX_MEM_RANGES,
- GFP_KERNEL);
+ AMDGPU_MAX_MEM_RANGES);
if (!adev->gmc.mem_partitions)
return -ENOMEM;
if (!adev->irq.client[client_id].sources) {
adev->irq.client[client_id].sources =
kzalloc_objs(struct amdgpu_irq_src *,
- AMDGPU_MAX_IRQ_SRC_ID, GFP_KERNEL);
+ AMDGPU_MAX_IRQ_SRC_ID);
if (!adev->irq.client[client_id].sources)
return -ENOMEM;
}
return -ENOMEM;
fmt_attr_group->attrs = kzalloc_objs(*fmt_attr_group->attrs,
- config->num_formats + 1,
- GFP_KERNEL);
+ config->num_formats + 1);
if (!fmt_attr_group->attrs)
goto err_fmt_attr_grp;
goto err_evt_attr;
evt_attr_group->attrs = kzalloc_objs(*evt_attr_group->attrs,
- config->num_events + 1, GFP_KERNEL);
+ config->num_events + 1);
if (!evt_attr_group->attrs)
goto err_evt_attr_grp;
if (from_rom) {
err_data.err_addr =
kzalloc_objs(struct eeprom_table_record,
- adev->umc.retire_unit, GFP_KERNEL);
+ adev->umc.retire_unit);
if (!err_data.err_addr) {
dev_warn(adev->dev, "Failed to alloc UMC error address record in mca2pa conversion!\n");
return -ENOMEM;
return 0;
adev->mman.ttm_pools = kzalloc_objs(*adev->mman.ttm_pools,
- adev->gmc.num_mem_partitions,
- GFP_KERNEL);
+ adev->gmc.num_mem_partitions);
if (!adev->mman.ttm_pools)
return -ENOMEM;
err_data.err_addr =
kzalloc_objs(struct eeprom_table_record,
- adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL);
+ adev->umc.max_ras_err_cnt_per_query);
if (!err_data.err_addr) {
dev_warn(adev->dev,
"Failed to alloc memory for umc error record in MCA notifier!\n");
err_data->err_addr =
kzalloc_objs(struct eeprom_table_record,
- adev->umc.max_ras_err_cnt_per_query, GFP_KERNEL);
+ adev->umc.max_ras_err_cnt_per_query);
/* still call query_ras_error_address to clear error status
* even NOMEM error is encountered
adev->umc.max_ras_err_cnt_per_query) {
err_data->err_addr =
kzalloc_objs(struct eeprom_table_record,
- adev->umc.max_ras_err_cnt_per_query,
- GFP_KERNEL);
+ adev->umc.max_ras_err_cnt_per_query);
/* still call query_ras_error_address to clear error status
* even NOMEM error is encountered
adev->umc.max_ras_err_cnt_per_query) {
err_data->err_addr =
kzalloc_objs(struct eeprom_table_record,
- adev->umc.max_ras_err_cnt_per_query,
- GFP_KERNEL);
+ adev->umc.max_ras_err_cnt_per_query);
/* still call query_ras_error_address to clear error status
* even NOMEM error is encountered
struct ras_err_data err_data;
err_data.err_addr = kzalloc_objs(struct eeprom_table_record,
- adev->umc.retire_unit, GFP_KERNEL);
+ adev->umc.retire_unit);
if (!err_data.err_addr) {
dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n");
return 0;
struct amdgpu_device *adev = ip_block->adev;
adev->amdgpu_vkms_output = kzalloc_objs(struct amdgpu_vkms_output,
- adev->mode_info.num_crtc,
- GFP_KERNEL);
+ adev->mode_info.num_crtc);
if (!adev->amdgpu_vkms_output)
return -ENOMEM;
* the amount of memory allocated by user
*/
pa = kzalloc_objs(struct kfd_process_device_apertures,
- args->num_of_nodes, GFP_KERNEL);
+ args->num_of_nodes);
if (!pa)
return -ENOMEM;
int i;
crtc_ctx = kzalloc_objs(struct secure_display_crtc_context,
- adev->mode_info.num_crtc, GFP_KERNEL);
+ adev->mode_info.num_crtc);
if (!crtc_ctx) {
adev->dm.secure_display_ctx.crtc_ctx = NULL;
display_e2e_pipe_params_st *pipes;
pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count, GFP_KERNEL);
+ dc->res_pool->pipe_count);
if (!pipes)
return DC_FAIL_BANDWIDTH_VALIDATE;
display_e2e_pipe_params_st *pipes;
pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count, GFP_KERNEL);
+ dc->res_pool->pipe_count);
if (!pipes)
return DC_FAIL_BANDWIDTH_VALIDATE;
int vlevel = 0;
int pipe_cnt = 0;
display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count,
- GFP_KERNEL);
+ dc->res_pool->pipe_count);
DC_LOGGER_INIT(dc->ctx->logger);
BW_VAL_TRACE_COUNT();
int vlevel = 0;
int pipe_cnt = 0;
display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count,
- GFP_KERNEL);
+ dc->res_pool->pipe_count);
DC_LOGGER_INIT(dc->ctx->logger);
BW_VAL_TRACE_COUNT();
int vlevel = 0;
int pipe_cnt = 0;
display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count,
- GFP_KERNEL);
+ dc->res_pool->pipe_count);
DC_LOGGER_INIT(dc->ctx->logger);
BW_VAL_TRACE_COUNT();
int vlevel = 0;
int pipe_cnt = 0;
display_e2e_pipe_params_st *pipes = kzalloc_objs(display_e2e_pipe_params_st,
- dc->res_pool->pipe_count,
- GFP_KERNEL);
+ dc->res_pool->pipe_count);
/* To handle Freesync properly, setting FreeSync DML parameters
* to its default state for the first stage of validation
if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
rgb_user = kvzalloc_objs(*rgb_user,
- ramp->num_entries + _EXTRA_POINTS,
- GFP_KERNEL);
+ ramp->num_entries + _EXTRA_POINTS);
if (!rgb_user)
goto rgb_user_alloc_fail;
axis_x = kvzalloc_objs(*axis_x,
- ramp->num_entries + _EXTRA_POINTS,
- GFP_KERNEL);
+ ramp->num_entries + _EXTRA_POINTS);
if (!axis_x)
goto axis_x_alloc_fail;
if (ramp && ramp->type != GAMMA_CS_TFM_1D &&
(map_user_ramp || ramp->type != GAMMA_RGB_256)) {
rgb_user = kvzalloc_objs(*rgb_user,
- ramp->num_entries + _EXTRA_POINTS,
- GFP_KERNEL);
+ ramp->num_entries + _EXTRA_POINTS);
if (!rgb_user)
goto rgb_user_alloc_fail;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
adev->pm.dpm.ps = kzalloc_objs(struct amdgpu_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!adev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries =
kzalloc_objs(struct amdgpu_phase_shedding_limits_entry,
- psl->ucNumEntries, GFP_KERNEL);
+ psl->ucNumEntries);
if (!adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries)
return -ENOMEM;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
adev->pm.dpm.ps = kzalloc_objs(struct amdgpu_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!adev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
"Invalid PowerPlay Table!", return -1);
mclk_table = kzalloc_flex(*mclk_table, entries,
- mclk_dep_table->ucNumEntries, GFP_KERNEL);
+ mclk_dep_table->ucNumEntries);
if (!mclk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
sclk_table = kzalloc_flex(*sclk_table, entries,
- tonga_table->ucNumEntries, GFP_KERNEL);
+ tonga_table->ucNumEntries);
if (!sclk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
sclk_table = kzalloc_flex(*sclk_table, entries,
- polaris_table->ucNumEntries,
- GFP_KERNEL);
+ polaris_table->ucNumEntries);
if (!sclk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
pcie_table = kzalloc_flex(*pcie_table, entries,
- atom_pcie_table->ucNumEntries,
- GFP_KERNEL);
+ atom_pcie_table->ucNumEntries);
if (!pcie_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
pcie_table = kzalloc_flex(*pcie_table, entries,
- atom_pcie_table->ucNumEntries,
- GFP_KERNEL);
+ atom_pcie_table->ucNumEntries);
if (!pcie_table)
return -ENOMEM;
PP_ASSERT_WITH_CODE((0 != mm_dependency_table->ucNumEntries),
"Invalid PowerPlay Table!", return -1);
mm_table = kzalloc_flex(*mm_table, entries,
- mm_dependency_table->ucNumEntries, GFP_KERNEL);
+ mm_dependency_table->ucNumEntries);
if (!mm_table)
return -ENOMEM;
return -EINVAL;
cac_leakage_table = kzalloc_flex(*cac_leakage_table, entries,
- table->ucNumEntries, GFP_KERNEL);
+ table->ucNumEntries);
if (!cac_leakage_table)
return -ENOMEM;
table = kzalloc_flex(*table, entries,
- ptable->ucNumEntries, GFP_KERNEL);
+ ptable->ucNumEntries);
if (!table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
mm_table = kzalloc_flex(*mm_table, entries,
- mm_dependency_table->ucNumEntries, GFP_KERNEL);
+ mm_dependency_table->ucNumEntries);
if (!mm_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
clk_table = kzalloc_flex(*clk_table, entries,
- clk_dep_table->ucNumEntries, GFP_KERNEL);
+ clk_dep_table->ucNumEntries);
if (!clk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
mclk_table = kzalloc_flex(*mclk_table, entries,
- mclk_dep_table->ucNumEntries, GFP_KERNEL);
+ mclk_dep_table->ucNumEntries);
if (!mclk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
clk_table = kzalloc_flex(*clk_table, entries,
- clk_dep_table->ucNumEntries, GFP_KERNEL);
+ clk_dep_table->ucNumEntries);
if (!clk_table)
return -ENOMEM;
"Invalid PowerPlay Table!", return -1);
clk_table = kzalloc_flex(*clk_table, entries,
- clk_dep_table->ucNumEntries, GFP_KERNEL);
+ clk_dep_table->ucNumEntries);
if (!clk_table)
return -ENOMEM;
return 0);
pcie_table = kzalloc_flex(*pcie_table, entries,
- atom_pcie_table->ucNumEntries, GFP_KERNEL);
+ atom_pcie_table->ucNumEntries);
if (!pcie_table)
return -ENOMEM;
return -EINVAL;
activity_monitor_external = kzalloc_objs(*activity_monitor_external,
- PP_SMC_POWER_PROFILE_COUNT,
- GFP_KERNEL);
+ PP_SMC_POWER_PROFILE_COUNT);
if (!activity_monitor_external)
return -ENOMEM;
num_commit_deps = hweight32(mst_state->pending_crtc_mask);
mst_state->commit_deps = kmalloc_objs(*mst_state->commit_deps,
- num_commit_deps,
- GFP_KERNEL);
+ num_commit_deps);
if (!mst_state->commit_deps)
return -ENOMEM;
mst_state->num_commit_deps = num_commit_deps;
if (!state->crtcs)
goto fail;
state->planes = kzalloc_objs(*state->planes,
- dev->mode_config.num_total_plane,
- GFP_KERNEL);
+ dev->mode_config.num_total_plane);
if (!state->planes)
goto fail;
state->colorops = kzalloc_objs(*state->colorops,
- dev->mode_config.num_colorop, GFP_KERNEL);
+ dev->mode_config.num_colorop);
if (!state->colorops)
goto fail;
for_each_free_tree(i) {
mm->free_trees[i] = kmalloc_objs(struct rb_root,
- mm->max_order + 1, GFP_KERNEL);
+ mm->max_order + 1);
if (!mm->free_trees[i])
goto out_free_tree;
for (modeset = client->modesets; modeset->crtc; modeset++) {
modeset->connectors = kzalloc_objs(*modeset->connectors,
- max_connector_count,
- GFP_KERNEL);
+ max_connector_count);
if (!modeset->connectors)
goto err_free;
}
}
connector_set = kmalloc_objs(struct drm_connector *,
- crtc_req->count_connectors,
- GFP_KERNEL);
+ crtc_req->count_connectors);
if (!connector_set) {
ret = -ENOMEM;
goto out;
* connector data.
*/
save_encoder_crtcs = kzalloc_objs(struct drm_crtc *,
- dev->mode_config.num_encoder,
- GFP_KERNEL);
+ dev->mode_config.num_encoder);
if (!save_encoder_crtcs)
return -ENOMEM;
save_connector_encoders = kzalloc_objs(struct drm_encoder *,
- dev->mode_config.num_connector,
- GFP_KERNEL);
+ dev->mode_config.num_connector);
if (!save_connector_encoders) {
kfree(save_encoder_crtcs);
return -ENOMEM;
power_domains->power_well_count = power_well_count;
power_domains->power_wells =
kzalloc_objs(*power_domains->power_wells,
- power_well_count, GFP_KERNEL);
+ power_well_count);
if (!power_domains->power_wells)
return -ENOMEM;
if (!data->streams)
data->streams = kzalloc_objs(struct hdcp2_streamid_type,
- INTEL_NUM_PIPES(display),
- GFP_KERNEL);
+ INTEL_NUM_PIPES(display));
if (!data->streams) {
drm_err(display->drm, "Out of Memory\n");
return -ENOMEM;
for (i = 0; i < GUC_CAPTURE_LIST_TYPE_MAX; ++i) {
new->reginfo[i].regs = kzalloc_objs(struct guc_mmio_reg,
- guc->capture->max_mmio_per_node,
- GFP_KERNEL);
+ guc->capture->max_mmio_per_node);
if (!new->reginfo[i].regs) {
while (i)
kfree(new->reginfo[--i].regs);
}
job->out_sync.objs = kzalloc_objs(*job->out_sync.objs,
- job->out_sync.count,
- GFP_KERNEL);
+ job->out_sync.count);
if (!job->out_sync.objs) {
ret = -ENOMEM;
goto err_free_out_sync;
}
job->out_sync.chains = kzalloc_objs(*job->out_sync.chains,
- job->out_sync.count,
- GFP_KERNEL);
+ job->out_sync.count);
if (!job->out_sync.chains) {
ret = -ENOMEM;
goto err_free_objs;
/* alloc engines */
omap_dmm->engines = kzalloc_objs(*omap_dmm->engines,
- omap_dmm->num_engines, GFP_KERNEL);
+ omap_dmm->num_engines);
if (!omap_dmm->engines) {
ret = -ENOMEM;
goto fail;
((ALIGN(va + size, 1ull << 21) - ALIGN_DOWN(va, 1ull << 21)) >> 21);
op_ctx->rsvd_page_tables.pages = kzalloc_objs(*op_ctx->rsvd_page_tables.pages,
- pt_count, GFP_KERNEL);
+ pt_count);
if (!op_ctx->rsvd_page_tables.pages) {
ret = -ENOMEM;
goto err_cleanup;
if (pt_count) {
op_ctx->rsvd_page_tables.pages = kzalloc_objs(*op_ctx->rsvd_page_tables.pages,
- pt_count,
- GFP_KERNEL);
+ pt_count);
if (!op_ctx->rsvd_page_tables.pages) {
ret = -ENOMEM;
goto err_cleanup;
}
if (!qdev->client_monitors_config) {
qdev->client_monitors_config = kzalloc_flex(*qdev->client_monitors_config,
- heads, count,
- GFP_KERNEL);
+ heads, count);
if (!qdev->client_monitors_config)
return -ENOMEM;
}
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- power_info->pplib.ucNumStates,
- GFP_KERNEL);
+ power_info->pplib.ucNumStates);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
ATOM_PPLIB_Clock_Voltage_Dependency_Record *entry;
radeon_table->entries = kzalloc_objs(struct radeon_clock_voltage_dependency_entry,
- atom_table->ucNumEntries,
- GFP_KERNEL);
+ atom_table->ucNumEntries);
if (!radeon_table->entries)
return -ENOMEM;
rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries =
kzalloc_objs(struct radeon_phase_shedding_limits_entry,
- psl->ucNumEntries, GFP_KERNEL);
+ psl->ucNumEntries);
if (!rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries) {
r600_free_extended_power_table(rdev);
return -ENOMEM;
if (num_modes == 0)
return state_index;
rdev->pm.power_state = kzalloc_objs(struct radeon_power_state,
- num_modes, GFP_KERNEL);
+ num_modes);
if (!rdev->pm.power_state)
return state_index;
/* last mode is usually default, array is low to high */
if (power_info->pplib.ucNumStates == 0)
return state_index;
rdev->pm.power_state = kzalloc_objs(struct radeon_power_state,
- power_info->pplib.ucNumStates,
- GFP_KERNEL);
+ power_info->pplib.ucNumStates);
if (!rdev->pm.power_state)
return state_index;
/* first mode is usually default, followed by low to high */
power_info->pplib.ucNonClockSize));
rdev->pm.power_state[i].clock_info =
kzalloc_objs(struct radeon_pm_clock_info,
- (power_info->pplib.ucStateEntrySize - 1) ? (power_info->pplib.ucStateEntrySize - 1) : 1,
- GFP_KERNEL);
+ (power_info->pplib.ucStateEntrySize - 1) ? (power_info->pplib.ucStateEntrySize - 1) : 1);
if (!rdev->pm.power_state[i].clock_info)
return state_index;
if (power_info->pplib.ucStateEntrySize - 1) {
if (state_array->ucNumEntries == 0)
return state_index;
rdev->pm.power_state = kzalloc_objs(struct radeon_power_state,
- state_array->ucNumEntries,
- GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.power_state)
return state_index;
power_state_offset = (u8 *)state_array->states;
&non_clock_info_array->nonClockInfo[non_clock_array_index];
rdev->pm.power_state[i].clock_info =
kzalloc_objs(struct radeon_pm_clock_info,
- power_state->v2.ucNumDPMLevels ? power_state->v2.ucNumDPMLevels : 1,
- GFP_KERNEL);
+ power_state->v2.ucNumDPMLevels ? power_state->v2.ucNumDPMLevels : 1);
if (!rdev->pm.power_state[i].clock_info)
return state_index;
if (power_state->v2.ucNumDPMLevels) {
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- power_info->pplib.ucNumStates,
- GFP_KERNEL);
+ power_info->pplib.ucNumStates);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- power_info->pplib.ucNumStates,
- GFP_KERNEL);
+ power_info->pplib.ucNumStates);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- power_info->pplib.ucNumStates,
- GFP_KERNEL);
+ power_info->pplib.ucNumStates);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
rdev->pm.dpm.ps = kzalloc_objs(struct radeon_ps,
- state_array->ucNumEntries, GFP_KERNEL);
+ state_array->ucNumEntries);
if (!rdev->pm.dpm.ps)
return -ENOMEM;
power_state_offset = (u8 *)state_array->states;
job->job_type = V3D_CPU_JOB_TYPE_TIMESTAMP_QUERY;
query_info->queries = kvmalloc_objs(struct v3d_timestamp_query,
- timestamp.count, GFP_KERNEL);
+ timestamp.count);
if (!query_info->queries)
return -ENOMEM;
job->job_type = V3D_CPU_JOB_TYPE_RESET_TIMESTAMP_QUERY;
query_info->queries = kvmalloc_objs(struct v3d_timestamp_query,
- reset.count, GFP_KERNEL);
+ reset.count);
if (!query_info->queries)
return -ENOMEM;
job->job_type = V3D_CPU_JOB_TYPE_COPY_TIMESTAMP_QUERY;
query_info->queries = kvmalloc_objs(struct v3d_timestamp_query,
- copy.count, GFP_KERNEL);
+ copy.count);
if (!query_info->queries)
return -ENOMEM;
/* Allocate statically-sized temp arrays for pages -- too big to keep in frame */
pages_stat = (struct page **) kmalloc_objs(*pages_stat,
- ARRAY_SIZE(pdesc->statPPNs) + ARRAY_SIZE(pdesc->infoPPNs) + ARRAY_SIZE(pdesc->strsPPNs),
- GFP_KERNEL);
+ ARRAY_SIZE(pdesc->statPPNs) + ARRAY_SIZE(pdesc->infoPPNs) + ARRAY_SIZE(pdesc->strsPPNs));
if (!pages_stat)
goto err_nomem;
front_info->evt_pairs =
kzalloc_objs(struct xen_drm_front_evtchnl_pair,
- cfg->num_connectors, GFP_KERNEL);
+ cfg->num_connectors);
if (!front_info->evt_pairs) {
ret = -ENOMEM;
goto fail;
end = start + size;
device->collection = kzalloc_objs(struct hid_collection,
- HID_DEFAULT_NUM_COLLECTIONS,
- GFP_KERNEL);
+ HID_DEFAULT_NUM_COLLECTIONS);
if (!device->collection) {
ret = -ENOMEM;
goto err;
version >> 16, version & 0xFFFF);
vmbus_connection.channels = kzalloc_objs(struct vmbus_channel *,
- MAX_CHANNEL_RELIDS, GFP_KERNEL);
+ MAX_CHANNEL_RELIDS);
if (vmbus_connection.channels == NULL) {
ret = -ENOMEM;
goto cleanup;
goto end;
resource->domain_devices = kzalloc_objs(struct acpi_device *,
- pss->package.count, GFP_KERNEL);
+ pss->package.count);
if (!resource->domain_devices) {
res = -ENOMEM;
goto end;
*/
pdata->nr_cores = NUM_REAL_CORES;
pdata->core_data = kzalloc_objs(struct temp_data *,
- pdata->nr_cores, GFP_KERNEL);
+ pdata->nr_cores);
if (!pdata->core_data)
return NULL;
}
return -ENOSPC;
struct tsc2046_adc_atom *tx_buf __free(kfree) = kzalloc_objs(*tx_buf,
- max_count,
- GFP_KERNEL);
+ max_count);
if (!tx_buf)
return -ENOMEM;
struct tsc2046_adc_atom *rx_buf __free(kfree) = kzalloc_objs(*rx_buf,
- max_count,
- GFP_KERNEL);
+ max_count);
if (!rx_buf)
return -ENOMEM;
unsigned int i;
channels = kzalloc_objs(struct iio_chan_spec,
- st->chip_info->num_channels, GFP_KERNEL);
+ st->chip_info->num_channels);
if (!channels)
return -ENOMEM;
iio_dev_opaque->chan_attr_group.attrs =
kzalloc_objs(iio_dev_opaque->chan_attr_group.attrs[0],
- attrcount + 1, GFP_KERNEL);
+ attrcount + 1);
if (iio_dev_opaque->chan_attr_group.attrs == NULL) {
ret = -ENOMEM;
goto error_clear_attrs;
ev_int->group.name = iio_event_group_name;
ev_int->group.attrs = kzalloc_objs(ev_int->group.attrs[0],
- attrcount + 1, GFP_KERNEL);
+ attrcount + 1);
if (ev_int->group.attrs == NULL) {
ret = -ENOMEM;
goto error_free_setup_event_lines;
if (update_pkeys) {
pkey_cache = kmalloc_flex(*pkey_cache, table,
- tprops->pkey_tbl_len, GFP_KERNEL);
+ tprops->pkey_tbl_len);
if (!pkey_cache) {
ret = -ENOMEM;
goto err;
cma_dev->device = device;
cma_dev->default_gid_type = kzalloc_objs(*cma_dev->default_gid_type,
- device->phys_port_cnt,
- GFP_KERNEL);
+ device->phys_port_cnt);
if (!cma_dev->default_gid_type) {
ret = -ENOMEM;
goto free_cma_dev;
* empty slots at the beginning.
*/
pdata_rcu = kzalloc_flex(*pdata_rcu, pdata,
- size_add(rdma_end_port(device), 1), GFP_KERNEL);
+ size_add(rdma_end_port(device), 1));
if (!pdata_rcu)
return -ENOMEM;
/*
int iwpm_init(u8 nl_client)
{
iwpm_hash_bucket = kzalloc_objs(struct hlist_head,
- IWPM_MAPINFO_HASH_SIZE, GFP_KERNEL);
+ IWPM_MAPINFO_HASH_SIZE);
if (!iwpm_hash_bucket)
return -ENOMEM;
iwpm_reminfo_bucket = kzalloc_objs(struct hlist_head,
- IWPM_REMINFO_HASH_SIZE, GFP_KERNEL);
+ IWPM_REMINFO_HASH_SIZE);
if (!iwpm_reminfo_bucket) {
kfree(iwpm_hash_bucket);
return -ENOMEM;
if (!data)
goto err_free_stats;
data->group.attrs = kzalloc_objs(*data->group.attrs,
- stats->num_counters + 2, GFP_KERNEL);
+ stats->num_counters + 2);
if (!data->group.attrs)
goto err_free_data;
int ret;
gid_attr_group = kzalloc_flex(*gid_attr_group, attrs_list,
- size_mul(attr->gid_tbl_len, 2),
- GFP_KERNEL);
+ size_mul(attr->gid_tbl_len, 2));
if (!gid_attr_group)
return -ENOMEM;
gid_attr_group->port = port;
int ret;
p = kvzalloc_flex(*p, attrs_list,
- size_add(attr->gid_tbl_len, attr->pkey_tbl_len),
- GFP_KERNEL);
+ size_add(attr->gid_tbl_len, attr->pkey_tbl_len));
if (!p)
return ERR_PTR(-ENOMEM);
p->ibdev = device;
uapi->num_write = max_write + 1;
uapi->num_write_ex = max_write_ex + 1;
data = kmalloc_objs(*uapi->write_methods,
- uapi->num_write + uapi->num_write_ex, GFP_KERNEL);
+ uapi->num_write + uapi->num_write_ex);
if (!data)
return -ENOMEM;
/* Allocate one extra to hold the QP1 entries */
rcfw->qp_tbl_size = max_t(u32, BNXT_RE_MAX_QPC_COUNT + 1, dev_attr->max_qp);
rcfw->qp_tbl = kzalloc_objs(struct bnxt_qplib_qp_node,
- rcfw->qp_tbl_size, GFP_KERNEL);
+ rcfw->qp_tbl_size);
if (!rcfw->qp_tbl)
return -ENOMEM;
if (c4iw_wr_log) {
rdev->wr_log = kzalloc_objs(*rdev->wr_log,
- 1 << c4iw_wr_log_size_order,
- GFP_KERNEL);
+ 1 << c4iw_wr_log_size_order);
if (rdev->wr_log) {
rdev->wr_log_size = 1 << c4iw_wr_log_size_order;
atomic_set(&rdev->wr_log_idx, 0);
if (!wq->sw_rq)
goto err_put_qpid;
wq->pending_wrs = kzalloc_objs(*srq->wq.pending_wrs,
- srq->wq.size, GFP_KERNEL);
+ srq->wq.size);
if (!wq->pending_wrs)
goto err_free_sw_rq;
}
}
dd->comp_vect_mappings = kzalloc_objs(*dd->comp_vect_mappings,
- dd->comp_vect_possible_cpus,
- GFP_KERNEL);
+ dd->comp_vect_possible_cpus);
if (!dd->comp_vect_mappings) {
ret = -ENOMEM;
goto fail;
dd->hw_to_sw = kmalloc_array(TXE_NUM_CONTEXTS, sizeof(u8),
GFP_KERNEL);
dd->send_contexts = kzalloc_objs(struct send_context_info,
- dd->num_send_contexts, GFP_KERNEL);
+ dd->num_send_contexts);
if (!dd->send_contexts || !dd->hw_to_sw) {
kfree(dd->hw_to_sw);
kfree(dd->send_contexts);
int i;
dd->cr_base = kzalloc_objs(struct credit_return_base,
- node_affinity.num_possible_nodes, GFP_KERNEL);
+ node_affinity.num_possible_nodes);
if (!dd->cr_base) {
ret = -ENOMEM;
goto done;
if (!HFI1_CAP_UGET_MASK(uctxt->flags, TID_UNMAP)) {
fd->invalid_tid_idx = 0;
fd->invalid_tids = kzalloc_objs(*fd->invalid_tids,
- uctxt->expected_count,
- GFP_KERNEL);
+ uctxt->expected_count);
if (!fd->invalid_tids) {
kfree(fd->entry_to_rb);
fd->entry_to_rb = NULL;
goto err_kcalloc_bt_l1;
table->bt_l1_dma_addr = kzalloc_objs(*table->bt_l1_dma_addr,
- num_bt_l1,
- GFP_KERNEL);
+ num_bt_l1);
if (!table->bt_l1_dma_addr)
goto err_kcalloc_l1_dma;
goto err_kcalloc_bt_l0;
table->bt_l0_dma_addr = kzalloc_objs(*table->bt_l0_dma_addr,
- num_bt_l0,
- GFP_KERNEL);
+ num_bt_l0);
if (!table->bt_l0_dma_addr)
goto err_kcalloc_l0_dma;
}
mr->npages = 0;
mr->page_list = kvzalloc_objs(dma_addr_t,
- mr->pbl_mtr.hem_cfg.buf_pg_count,
- GFP_KERNEL);
+ mr->pbl_mtr.hem_cfg.buf_pg_count);
if (!mr->page_list)
return sg_num;
return err;
mdev->eqs = kzalloc_objs(struct gdma_queue *,
- mdev->ib_dev.num_comp_vectors, GFP_KERNEL);
+ mdev->ib_dev.num_comp_vectors);
if (!mdev->eqs) {
err = -ENOMEM;
goto destroy_fatal_eq;
int i;
ctx->tun = kzalloc_objs(struct mlx4_ib_demux_pv_ctx *,
- dev->dev->caps.sqp_demux, GFP_KERNEL);
+ dev->dev->caps.sqp_demux);
if (!ctx->tun)
return -ENOMEM;
int i, j, eq = 0, total_eqs = 0;
ibdev->eq_table = kzalloc_objs(ibdev->eq_table[0],
- dev->caps.num_comp_vectors, GFP_KERNEL);
+ dev->caps.num_comp_vectors);
if (!ibdev->eq_table)
return;
max_gids = MLX5_CAP_ROCE(dev->mdev, roce_address_table_size);
for (i = 0; i < dev->num_ports; i++) {
dev->port[i].reserved_gids = kzalloc_objs(*dev->port[i].reserved_gids,
- max_gids, GFP_KERNEL);
+ max_gids);
if (!dev->port[i].reserved_gids)
goto err;
return ERR_PTR(-ENOMEM);
mplane->port = kzalloc_objs(*mplane->port,
- mparent->num_plane * mparent->num_ports,
- GFP_KERNEL);
+ mparent->num_plane * mparent->num_ports);
if (!mplane->port) {
ret = -ENOMEM;
goto fail_kcalloc;
int i;
dev->cmd.context = kmalloc_objs(struct mthca_cmd_context,
- dev->cmd.max_cmds, GFP_KERNEL);
+ dev->cmd.max_cmds);
if (!dev->cmd.context)
return -ENOMEM;
dev->db_tab->min_group2 = dev->db_tab->npages - 1;
dev->db_tab->page = kmalloc_objs(*dev->db_tab->page,
- dev->db_tab->npages, GFP_KERNEL);
+ dev->db_tab->npages);
if (!dev->db_tab->page) {
kfree(dev->db_tab);
return -ENOMEM;
while (ret) {
chunk = kmalloc_flex(*chunk, page_list,
- min_t(int, ret, USNIC_UIOM_PAGE_CHUNK),
- GFP_KERNEL);
+ min_t(int, ret, USNIC_UIOM_PAGE_CHUNK));
if (!chunk) {
ret = -ENOMEM;
goto out;
ib_set_device_ops(&dev->ib_dev, &pvrdma_dev_srq_ops);
dev->srq_tbl = kzalloc_objs(struct pvrdma_srq *,
- dev->dsr->caps.max_srq, GFP_KERNEL);
+ dev->dsr->caps.max_srq);
if (!dev->srq_tbl)
goto err_qp_free;
}
iser_conn->num_rx_descs = session->cmds_max;
iser_conn->rx_descs = kmalloc_objs(struct iser_rx_desc,
- iser_conn->num_rx_descs, GFP_KERNEL);
+ iser_conn->num_rx_descs);
if (!iser_conn->rx_descs)
goto rx_desc_alloc_fail;
int i, j;
isert_conn->rx_descs = kzalloc_objs(struct iser_rx_desc,
- ISERT_QP_MAX_RECV_DTOS, GFP_KERNEL);
+ ISERT_QP_MAX_RECV_DTOS);
if (!isert_conn->rx_descs)
return -ENOMEM;
if (!clt_path->rbufs) {
clt_path->rbufs = kzalloc_objs(*clt_path->rbufs,
- queue_depth, GFP_KERNEL);
+ queue_depth);
if (!clt_path->rbufs)
return -ENOMEM;
}
static inline int __init alloc_rlookup_table(struct amd_iommu_pci_seg *pci_seg)
{
pci_seg->rlookup_table = kvzalloc_objs(*pci_seg->rlookup_table,
- pci_seg->last_bdf + 1,
- GFP_KERNEL);
+ pci_seg->last_bdf + 1);
if (pci_seg->rlookup_table == NULL)
return -ENOMEM;
static inline int __init alloc_irq_lookup_table(struct amd_iommu_pci_seg *pci_seg)
{
pci_seg->irq_lookup_table = kvzalloc_objs(*pci_seg->irq_lookup_table,
- pci_seg->last_bdf + 1,
- GFP_KERNEL);
+ pci_seg->last_bdf + 1);
if (pci_seg->irq_lookup_table == NULL)
return -ENOMEM;
int i;
pci_seg->alias_table = kvmalloc_objs(*pci_seg->alias_table,
- pci_seg->last_bdf + 1, GFP_KERNEL);
+ pci_seg->last_bdf + 1);
if (!pci_seg->alias_table)
return -ENOMEM;
DIV_ROUND_UP(max_contexts, CTXDESC_L2_ENTRIES);
cd_table->l2.l2ptrs = kzalloc_objs(*cd_table->l2.l2ptrs,
- cd_table->l2.num_l1_ents,
- GFP_KERNEL);
+ cd_table->l2.num_l1_ents);
if (!cd_table->l2.l2ptrs)
return -ENOMEM;
vintf->base = cmdqv->base + TEGRA241_VINTF(idx);
vintf->lvcmdqs = kzalloc_objs(*vintf->lvcmdqs,
- cmdqv->num_lvcmdqs_per_vintf, GFP_KERNEL);
+ cmdqv->num_lvcmdqs_per_vintf);
if (!vintf->lvcmdqs) {
ida_free(&cmdqv->vintf_ids, idx);
return -ENOMEM;
int i, ret;
iovad->rcaches = kzalloc_objs(struct iova_rcache,
- IOVA_RANGE_CACHE_MAX_SIZE, GFP_KERNEL);
+ IOVA_RANGE_CACHE_MAX_SIZE);
if (!iovad->rcaches)
return -ENOMEM;
}
chip_data->intpol_bases = kzalloc_objs(*chip_data->intpol_bases,
- nr_intpol_bases, GFP_KERNEL);
+ nr_intpol_bases);
if (!chip_data->intpol_bases) {
ret = -ENOMEM;
goto out_free_intpol_words;
/* Allocate vector array */
lpriv->vectors = kzalloc_objs(*lpriv->vectors,
- global->nr_ids + 1, GFP_KERNEL);
+ global->nr_ids + 1);
if (!lpriv->vectors)
goto fail_local_cleanup;
host_data->drv_data = dd;
host_data->chips_data = kzalloc_objs(struct stm32_exti_chip_data,
- dd->bank_nr, GFP_KERNEL);
+ dd->bank_nr);
if (!host_data->chips_data)
goto free_host_data;
int err;
cc->cipher_tfm.tfms = kzalloc_objs(struct crypto_skcipher *,
- cc->tfms_count, GFP_KERNEL);
+ cc->tfms_count);
if (!cc->cipher_tfm.tfms)
return -ENOMEM;
}
sg = kvmalloc_objs(struct scatterlist,
- ic->journal_pages + 1, GFP_KERNEL);
+ ic->journal_pages + 1);
if (!sg) {
*error = "Unable to allocate sg list";
r = -ENOMEM;
goto bad;
}
ic->bbs = kvmalloc_objs(struct bitmap_block_status,
- ic->n_bitmap_blocks, GFP_KERNEL);
+ ic->n_bitmap_blocks);
if (!ic->bbs) {
ti->error = "Could not allocate memory for bitmap";
r = -ENOMEM;
int ret;
cache->segments = kvzalloc_objs(struct pcache_cache_segment,
- cache_dev->seg_num, GFP_KERNEL);
+ cache_dev->seg_num);
if (!cache->segments) {
ret = -ENOMEM;
goto err;
* an RB tree root and a spinlock for protecting its contents.
*/
cache_tree->subtrees = kvzalloc_objs(struct pcache_cache_subtree,
- cache_tree->n_subtrees, GFP_KERNEL);
+ cache_tree->n_subtrees);
if (!cache_tree->subtrees) {
ret = -ENOMEM;
goto key_pool_exit;
(*n_histogram_entries)++;
*histogram_boundaries = kmalloc_objs(unsigned long long,
- *n_histogram_entries, GFP_KERNEL);
+ *n_histogram_entries);
if (!*histogram_boundaries)
return -ENOMEM;
cinfo->other_bitmap_lockres =
kzalloc_objs(struct dlm_lock_resource *,
- mddev->bitmap_info.nodes - 1, GFP_KERNEL);
+ mddev->bitmap_info.nodes - 1);
if (!cinfo->other_bitmap_lockres) {
pr_err("md: can't alloc mem for other bitmap locks\n");
return 0;
/* FIXME calc properly */
conf->mirrors = kzalloc_objs(struct raid10_info,
- mddev->raid_disks + max(0, -mddev->delta_disks),
- GFP_KERNEL);
+ mddev->raid_disks + max(0, -mddev->delta_disks));
if (!conf->mirrors)
goto out;
/* allocate new 'mirrors' list */
conf->mirrors_new =
kzalloc_objs(struct raid10_info,
- mddev->raid_disks + mddev->delta_disks,
- GFP_KERNEL);
+ mddev->raid_disks + mddev->delta_disks);
if (!conf->mirrors_new)
return -ENOMEM;
}
sprintf(dev->name, "tw%04X", pci_dev->device);
dev->video_channels = kzalloc_objs(*dev->video_channels,
- max_channels(dev), GFP_KERNEL);
+ max_channels(dev));
if (!dev->video_channels) {
err = -ENOMEM;
goto free_dev;
}
dev->audio_channels = kzalloc_objs(*dev->audio_channels,
- max_channels(dev), GFP_KERNEL);
+ max_channels(dev));
if (!dev->audio_channels) {
err = -ENOMEM;
goto free_video;
/* Define and configure additional controls from cx2341x module. */
hdw->mpeg_ctrl_info = kzalloc_objs(*(hdw->mpeg_ctrl_info),
- MPEGDEF_COUNT, GFP_KERNEL);
+ MPEGDEF_COUNT);
if (!hdw->mpeg_ctrl_info) goto fail;
for (idx = 0; idx < MPEGDEF_COUNT; idx++) {
cptr = hdw->controls + idx + CTRLDEF_COUNT;
if (new_configs.num_configs) {
new_configs.configs = kvzalloc_objs(*new_configs.configs,
- new_configs.num_configs,
- GFP_KERNEL);
+ new_configs.num_configs);
if (!new_configs.configs)
return -ENOMEM;
attr_count = attr->count;
msb->attr_group.attrs = kzalloc_objs(*msb->attr_group.attrs,
- attr_count + 1, GFP_KERNEL);
+ attr_count + 1);
if (!msb->attr_group.attrs) {
rc = -ENOMEM;
goto out_free_attr;
port_info->num_phys = buffer->NumPhys;
port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo,
- port_info->num_phys, GFP_KERNEL);
+ port_info->num_phys);
if (!port_info->phy_info) {
error = -ENOMEM;
goto out_free_consistent;
/* save config data */
port_info->num_phys = (buffer->NumPhys) ? buffer->NumPhys : 1;
port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo,
- port_info->num_phys, GFP_KERNEL);
+ port_info->num_phys);
if (!port_info->phy_info) {
error = -ENOMEM;
goto out_free_consistent;
port_info->num_phys = (expander_data->NumPhys) ?
expander_data->NumPhys : 1;
port_info->phy_info = kzalloc_objs(struct mptsas_phyinfo,
- port_info->num_phys, GFP_KERNEL);
+ port_info->num_phys);
BUG_ON(!port_info->phy_info);
memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64));
for (i = 0; i < port_info->num_phys; i++) {
mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd->eraseregions = kzalloc_objs(struct mtd_erase_region_info,
- mtd->numeraseregions, GFP_KERNEL);
+ mtd->numeraseregions);
if (!mtd->eraseregions)
goto setup_err;
mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd->eraseregions = kmalloc_objs(struct mtd_erase_region_info,
- mtd->numeraseregions, GFP_KERNEL);
+ mtd->numeraseregions);
if (!mtd->eraseregions)
goto setup_err;
mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd->eraseregions = kmalloc_objs(struct mtd_erase_region_info,
- mtd->numeraseregions, GFP_KERNEL);
+ mtd->numeraseregions);
if (!mtd->eraseregions) {
kfree(cfi->cmdset_priv);
kfree(mtd);
mtd->numeraseregions = this->dies << 1;
mtd->eraseregions =
kzalloc_objs(struct mtd_erase_region_info,
- this->dies << 1, GFP_KERNEL);
+ this->dies << 1);
if (!mtd->eraseregions)
return -ENOMEM;
}
chip->nr_secure_regions = nr_elem / 2;
chip->secure_regions = kzalloc_objs(*chip->secure_regions,
- chip->nr_secure_regions, GFP_KERNEL);
+ chip->nr_secure_regions);
if (!chip->secure_regions)
return -ENOMEM;
}
sharpsl_nand_parts = kzalloc_objs(*sharpsl_nand_parts,
- SHARPSL_NAND_PARTS, GFP_KERNEL);
+ SHARPSL_NAND_PARTS);
if (!sharpsl_nand_parts)
return -ENOMEM;
ucan_release_context_array(up);
up->context_array = kzalloc_objs(*up->context_array,
- up->device_info.tx_fifo, GFP_KERNEL);
+ up->device_info.tx_fifo);
if (!up->context_array) {
netdev_err(up->netdev,
"Not enough memory to allocate tx contexts\n");
int fid = -1, err = 0, count = 0;
table = kzalloc_objs(struct mv88e6xxx_devlink_atu_entry,
- mv88e6xxx_num_databases(chip), GFP_KERNEL);
+ mv88e6xxx_num_databases(chip));
if (!table)
return -ENOMEM;
int err;
table = kzalloc_objs(struct mv88e6xxx_devlink_vtu_entry,
- mv88e6xxx_max_vid(chip) + 1, GFP_KERNEL);
+ mv88e6xxx_max_vid(chip) + 1);
if (!table)
return -ENOMEM;
int err;
table = kzalloc_objs(struct mv88e6xxx_devlink_stu_entry,
- mv88e6xxx_max_sid(chip) + 1, GFP_KERNEL);
+ mv88e6xxx_max_sid(chip) + 1);
if (!table)
return -ENOMEM;
rule->vl.cycle_time = cycle_time;
rule->vl.num_entries = num_entries;
rule->vl.entries = kzalloc_objs(struct action_gate_entry,
- num_entries, GFP_KERNEL);
+ num_entries);
if (!rule->vl.entries) {
rc = -ENOMEM;
goto out;
enum pds_core_vif_types vt;
pdsc->viftype_status = kzalloc_objs(*pdsc->viftype_status,
- ARRAY_SIZE(pdsc_viftype_defaults),
- GFP_KERNEL);
+ ARRAY_SIZE(pdsc_viftype_defaults));
if (!pdsc->viftype_status)
return -ENOMEM;
index, cos);
txdata->tx_buf_ring = kzalloc_objs(struct sw_tx_bd,
- NUM_TX_BD,
- GFP_KERNEL);
+ NUM_TX_BD);
if (!txdata->tx_buf_ring)
goto alloc_mem_err;
txdata->tx_desc_ring = BNX2X_PCI_ALLOC(&txdata->tx_desc_mapping,
for (i = 0; i < bp->fp_array_size; i++) {
fp[i].tpa_info =
kzalloc_objs(struct bnx2x_agg_info,
- ETH_MAX_AGGREGATION_QUEUES_E1H_E2,
- GFP_KERNEL);
+ ETH_MAX_AGGREGATION_QUEUES_E1H_E2);
if (!(fp[i].tpa_info))
goto alloc_err;
}
/* allocate the queue arrays for all VFs */
bp->vfdb->vfqs = kzalloc_objs(struct bnx2x_vf_queue,
- BNX2X_MAX_NUM_VF_QUEUES, GFP_KERNEL);
+ BNX2X_MAX_NUM_VF_QUEUES);
if (!bp->vfdb->vfqs) {
BNX2X_ERR("failed to allocate vf queue array\n");
if (irq_re_init) {
bp->grp_info = kzalloc_objs(struct bnxt_ring_grp_info,
- bp->cp_nr_rings, GFP_KERNEL);
+ bp->cp_nr_rings);
if (!bp->grp_info)
return -ENOMEM;
}
}
bp->rx_ring = kzalloc_objs(struct bnxt_rx_ring_info,
- bp->rx_nr_rings, GFP_KERNEL);
+ bp->rx_nr_rings);
if (!bp->rx_ring)
return -ENOMEM;
}
bp->tx_ring = kzalloc_objs(struct bnxt_tx_ring_info,
- bp->tx_nr_rings, GFP_KERNEL);
+ bp->tx_nr_rings);
if (!bp->tx_ring)
return -ENOMEM;
pps_info->num_pins = resp->num_pins;
ptp_info->n_pins = pps_info->num_pins;
ptp_info->pin_config = kzalloc_objs(*ptp_info->pin_config,
- ptp_info->n_pins, GFP_KERNEL);
+ ptp_info->n_pins);
if (!ptp_info->pin_config) {
hwrm_req_drop(bp, req);
return -ENOMEM;
d->sbdma_maxdescr = maxdescr;
d->sbdma_dscrtable_unaligned = kzalloc_objs(*d->sbdma_dscrtable,
- d->sbdma_maxdescr + 1,
- GFP_KERNEL);
+ d->sbdma_maxdescr + 1);
/*
* The descriptor table must be aligned to at least 16 bytes or the
for (i = 0; i < tp->txq_cnt; i++, tnapi++) {
tnapi->tx_buffers = kzalloc_objs(struct tg3_tx_ring_info,
- TG3_TX_RING_SIZE, GFP_KERNEL);
+ TG3_TX_RING_SIZE);
if (!tnapi->tx_buffers)
goto err_out;
if (cfg_flags & BNAD_CF_MSIX) {
intr_info->intr_type = BNA_INTR_T_MSIX;
intr_info->idl = kzalloc_objs(struct bna_intr_descr,
- intr_info->num, GFP_KERNEL);
+ intr_info->num);
if (!intr_info->idl)
return -ENOMEM;
intr_info->intr_type = BNA_INTR_T_INTX;
intr_info->num = 1;
intr_info->idl = kzalloc_objs(struct bna_intr_descr,
- intr_info->num, GFP_KERNEL);
+ intr_info->num);
if (!intr_info->idl)
return -ENOMEM;
[IRQ_NAME_OFF(MAX_IOQ_INTERRUPTS_PER_PF)];
oct->msix_entries = kzalloc_objs(struct msix_entry,
- oct->num_msix_irqs, GFP_KERNEL);
+ oct->num_msix_irqs);
if (!oct->msix_entries) {
dev_err(&oct->pci_dev->dev, "Memory Alloc failed...\n");
kfree(oct->irq_name_storage);
}
adap->sge.ingr_map = kzalloc_objs(*adap->sge.ingr_map,
- adap->sge.ingr_sz, GFP_KERNEL);
+ adap->sge.ingr_sz);
if (!adap->sge.ingr_map) {
ret = -ENOMEM;
goto bye;
}
/* Allocate and set up VF Information. */
adap->vfinfo = kzalloc_objs(struct vf_info,
- pci_sriov_get_totalvfs(pdev),
- GFP_KERNEL);
+ pci_sriov_get_totalvfs(pdev));
if (!adap->vfinfo) {
unregister_netdev(adap->port[0]);
free_netdev(adap->port[0]);
/* Allocate ETHOFLD hardware queue structures if not done already */
if (!refcount_read(&adap->tc_mqprio->refcnt)) {
adap->sge.eohw_rxq = kzalloc_objs(struct sge_ofld_rxq,
- adap->sge.eoqsets, GFP_KERNEL);
+ adap->sge.eoqsets);
if (!adap->sge.eohw_rxq)
return -ENOMEM;
adap->sge.eohw_txq = kzalloc_objs(struct sge_eohw_txq,
- adap->sge.eoqsets, GFP_KERNEL);
+ adap->sge.eoqsets);
if (!adap->sge.eohw_txq) {
kfree(adap->sge.eohw_rxq);
return -ENOMEM;
goto free_queues;
enic->napi = kzalloc_objs(struct napi_struct,
- enic->wq_avail + enic->rq_avail, GFP_KERNEL);
+ enic->wq_avail + enic->rq_avail);
if (!enic->napi)
goto free_queues;
return -EOPNOTSUPP;
queue->rx->page_buffer = kzalloc_objs(*queue->rx->page_buffer,
- TSNEP_RING_SIZE, GFP_KERNEL);
+ TSNEP_RING_SIZE);
if (!queue->rx->page_buffer)
return -ENOMEM;
queue->rx->xdp_batch = kzalloc_objs(*queue->rx->xdp_batch,
- TSNEP_RING_SIZE, GFP_KERNEL);
+ TSNEP_RING_SIZE);
if (!queue->rx->xdp_batch) {
kfree(queue->rx->page_buffer);
queue->rx->page_buffer = NULL;
priv->trap_data = dpaa2_eth_trap_data;
dpaa2_eth_trap_data->trap_items_arr = kzalloc_objs(struct dpaa2_eth_trap_item,
- ARRAY_SIZE(dpaa2_eth_traps_arr),
- GFP_KERNEL);
+ ARRAY_SIZE(dpaa2_eth_traps_arr));
if (!dpaa2_eth_trap_data->trap_items_arr) {
err = -ENOMEM;
goto trap_data_free;
}
ethsw->filter_blocks = kzalloc_objs(*ethsw->filter_blocks,
- ethsw->sw_attr.num_ifs, GFP_KERNEL);
+ ethsw->sw_attr.num_ifs);
if (!ethsw->filter_blocks) {
err = -ENOMEM;
goto err_free_fdbs;
pf->total_vfs = pci_sriov_get_totalvfs(pdev);
if (pf->total_vfs) {
pf->vf_state = kzalloc_objs(struct enetc_vf_state,
- pf->total_vfs, GFP_KERNEL);
+ pf->total_vfs);
if (!pf->vf_state)
goto err_alloc_vf_state;
}
tx_queue = priv->tx_queue[i];
tx_queue->tx_skbuff =
kmalloc_objs(*tx_queue->tx_skbuff,
- tx_queue->tx_ring_size, GFP_KERNEL);
+ tx_queue->tx_ring_size);
if (!tx_queue->tx_skbuff)
goto cleanup;
for (i = 0; i < priv->num_rx_queues; i++) {
rx_queue = priv->rx_queue[i];
rx_queue->rx_buff = kzalloc_objs(*rx_queue->rx_buff,
- rx_queue->rx_ring_size,
- GFP_KERNEL);
+ rx_queue->rx_ring_size);
if (!rx_queue->rx_buff)
goto cleanup;
}
/* Setup the skbuff rings */
ugeth->tx_skbuff[j] =
kzalloc_objs(struct sk_buff *,
- ugeth->ug_info->bdRingLenTx[j], GFP_KERNEL);
+ ugeth->ug_info->bdRingLenTx[j]);
if (ugeth->tx_skbuff[j] == NULL) {
if (netif_msg_ifup(ugeth))
/* Setup the skbuff rings */
ugeth->rx_skbuff[j] =
kzalloc_objs(struct sk_buff *,
- ugeth->ug_info->bdRingLenRx[j], GFP_KERNEL);
+ ugeth->ug_info->bdRingLenRx[j]);
if (ugeth->rx_skbuff[j] == NULL) {
if (netif_msg_ifup(ugeth))
flow_rules_cache->rules_cache =
kvzalloc_objs(*flow_rules_cache->rules_cache,
- GVE_FLOW_RULES_CACHE_SIZE, GFP_KERNEL);
+ GVE_FLOW_RULES_CACHE_SIZE);
if (!flow_rules_cache->rules_cache) {
dev_err(&priv->pdev->dev, "Cannot alloc flow rules cache\n");
return -ENOMEM;
int err;
priv->msix_vectors = kvzalloc_objs(*priv->msix_vectors,
- num_vecs_requested, GFP_KERNEL);
+ num_vecs_requested);
if (!priv->msix_vectors)
return -ENOMEM;
for (i = 0; i < num_vecs_requested; i++)
int i;
tx->dqo.tx_qpl_buf_next = kvzalloc_objs(tx->dqo.tx_qpl_buf_next[0],
- num_tx_qpl_bufs, GFP_KERNEL);
+ num_tx_qpl_bufs);
if (!tx->dqo.tx_qpl_buf_next)
return -ENOMEM;
tx->dqo.num_pending_packets = min_t(int, num_pending_packets, S16_MAX);
tx->dqo.pending_packets = kvzalloc_objs(tx->dqo.pending_packets[0],
- tx->dqo.num_pending_packets,
- GFP_KERNEL);
+ tx->dqo.num_pending_packets);
if (!tx->dqo.pending_packets)
goto err;
int i;
tmp_rings = kzalloc_objs(struct hns3_enet_ring,
- handle->kinfo.num_tqps * 2, GFP_KERNEL);
+ handle->kinfo.num_tqps * 2);
if (!tmp_rings)
return NULL;
struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
nic_dev->intr_coalesce = kzalloc_objs(*nic_dev->intr_coalesce,
- nic_dev->max_qps, GFP_KERNEL);
+ nic_dev->max_qps);
if (!nic_dev->intr_coalesce)
return -ENOMEM;
nic_dev->num_qp_irq = 0;
nic_dev->qps_msix_entries = kzalloc_objs(struct msix_entry,
- nic_dev->max_qps, GFP_KERNEL);
+ nic_dev->max_qps);
if (!nic_dev->qps_msix_entries)
return -ENOMEM;
int err;
q_params->txqs_res = kzalloc_objs(*q_params->txqs_res,
- q_params->num_qps, GFP_KERNEL);
+ q_params->num_qps);
if (!q_params->txqs_res)
return -ENOMEM;
q_params->rxqs_res = kzalloc_objs(*q_params->rxqs_res,
- q_params->num_qps, GFP_KERNEL);
+ q_params->num_qps);
if (!q_params->rxqs_res) {
err = -ENOMEM;
goto err_free_txqs_res_arr;
goto err_free_tqres;
tqres->bds = kzalloc_objs(*tqres->bds,
- sq_depth * HINIC3_BDS_PER_SQ_WQEBB + HINIC3_MAX_SQ_SGE,
- GFP_KERNEL);
+ sq_depth * HINIC3_BDS_PER_SQ_WQEBB + HINIC3_MAX_SQ_SGE);
if (!tqres->bds) {
kfree(tqres->tx_info);
goto err_free_tqres;
{
adapter->tx_stats_buffers =
kzalloc_objs(struct ibmvnic_tx_queue_stats,
- IBMVNIC_MAX_QUEUES, GFP_KERNEL);
+ IBMVNIC_MAX_QUEUES);
if (!adapter->tx_stats_buffers)
return -ENOMEM;
adapter->rx_stats_buffers =
kzalloc_objs(struct ibmvnic_rx_queue_stats,
- IBMVNIC_MAX_QUEUES, GFP_KERNEL);
+ IBMVNIC_MAX_QUEUES);
if (!adapter->rx_stats_buffers)
return -ENOMEM;
}
rx_pool->rx_buff = kzalloc_objs(struct ibmvnic_rx_buff,
- rx_pool->size, GFP_KERNEL);
+ rx_pool->size);
if (!rx_pool->rx_buff) {
dev_err(dev, "Couldn't alloc rx buffers\n");
rc = -ENOMEM;
}
adapter->tx_scrq = kzalloc_objs(*adapter->tx_scrq,
- adapter->req_tx_queues, GFP_KERNEL);
+ adapter->req_tx_queues);
if (!adapter->tx_scrq)
goto tx_failed;
}
adapter->rx_scrq = kzalloc_objs(*adapter->rx_scrq,
- adapter->req_rx_queues, GFP_KERNEL);
+ adapter->req_rx_queues);
if (!adapter->rx_scrq)
goto rx_failed;
static int e1000_alloc_queues(struct e1000_adapter *adapter)
{
adapter->tx_ring = kzalloc_objs(struct e1000_tx_ring,
- adapter->num_tx_queues, GFP_KERNEL);
+ adapter->num_tx_queues);
if (!adapter->tx_ring)
return -ENOMEM;
adapter->rx_ring = kzalloc_objs(struct e1000_rx_ring,
- adapter->num_rx_queues, GFP_KERNEL);
+ adapter->num_rx_queues);
if (!adapter->rx_ring) {
kfree(adapter->tx_ring);
return -ENOMEM;
if (adapter->flags & FLAG_HAS_MSIX) {
adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */
adapter->msix_entries = kzalloc_objs(struct msix_entry,
- adapter->num_vectors,
- GFP_KERNEL);
+ adapter->num_vectors);
if (adapter->msix_entries) {
struct e1000_adapter *a = adapter;
for (i = 0; i < rx_ring->count; i++) {
buffer_info = &rx_ring->buffer_info[i];
buffer_info->ps_pages = kzalloc_objs(struct e1000_ps_page,
- PS_PAGE_BUFFERS,
- GFP_KERNEL);
+ PS_PAGE_BUFFERS);
if (!buffer_info->ps_pages)
goto err_pages;
}
u32 v_idx, i, reg_idx, reg;
ldev->qvlist_info = kzalloc_flex(*ldev->qvlist_info, qv_info,
- qvlist_info->num_vectors, GFP_KERNEL);
+ qvlist_info->num_vectors);
if (!ldev->qvlist_info)
return -ENOMEM;
ldev->qvlist_info->num_vectors = qvlist_info->num_vectors;
"Changing Rx descriptor count from %d to %d\n",
vsi->rx_rings[0]->count, new_rx_count);
rx_rings = kzalloc_objs(struct i40e_ring,
- vsi->alloc_queue_pairs, GFP_KERNEL);
+ vsi->alloc_queue_pairs);
if (!rx_rings) {
err = -ENOMEM;
goto free_tx;
pf->ptp_caps.n_per_out = 2;
pf->ptp_caps.pin_config = kzalloc_objs(*pf->ptp_caps.pin_config,
- pf->ptp_caps.n_pins, GFP_KERNEL);
+ pf->ptp_caps.n_pins);
if (!pf->ptp_caps.pin_config)
return -ENOMEM;
int status;
options = kzalloc_objs(*options,
- ICE_AQC_PORT_OPT_MAX * ICE_MAX_PORT_PER_PCI_DEV,
- GFP_KERNEL);
+ ICE_AQC_PORT_OPT_MAX * ICE_MAX_PORT_PER_PCI_DEV);
if (!options)
return;
{
if (pool_present) {
rx_ring->xdp_buf = kzalloc_objs(*rx_ring->xdp_buf,
- rx_ring->count, GFP_KERNEL);
+ rx_ring->count);
if (!rx_ring->xdp_buf)
return -ENOMEM;
} else {
privd->mapped_mem_regions =
kzalloc_objs(struct iidc_rdma_lan_mapped_mem_region,
- adapter->hw.num_lan_regs, GFP_KERNEL);
+ adapter->hw.num_lan_regs);
if (!privd->mapped_mem_regions) {
err = -ENOMEM;
goto err_plug_aux_dev;
}
adapter->rdma_msix_entries = kzalloc_objs(struct msix_entry,
- num_rdma_vecs,
- GFP_KERNEL);
+ num_rdma_vecs);
if (!adapter->rdma_msix_entries) {
err = -ENOMEM;
goto free_irq;
goto config;
q_vector->xsksq = kzalloc_objs(*q_vector->xsksq,
- DIV_ROUND_UP(rsrc->num_rxq_grp, rsrc->num_q_vectors),
- GFP_KERNEL);
+ DIV_ROUND_UP(rsrc->num_rxq_grp, rsrc->num_q_vectors));
if (!q_vector->xsksq)
return -ENOMEM;
continue;
tx_qgrp->complq = kzalloc_objs(*tx_qgrp->complq,
- IDPF_COMPLQ_PER_GROUP,
- GFP_KERNEL);
+ IDPF_COMPLQ_PER_GROUP);
if (!tx_qgrp->complq)
goto err_alloc;
}
rx_qgrp->splitq.bufq_sets = kzalloc_objs(struct idpf_bufq_set,
- rsrc->num_bufqs_per_qgrp,
- GFP_KERNEL);
+ rsrc->num_bufqs_per_qgrp);
if (!rx_qgrp->splitq.bufq_sets) {
err = -ENOMEM;
goto err_alloc;
idpf_queue_set(GEN_CHK, refillq);
idpf_queue_set(RFL_GEN_CHK, refillq);
refillq->ring = kzalloc_objs(*refillq->ring,
- refillq->desc_count,
- GFP_KERNEL);
+ refillq->desc_count);
if (!refillq->ring) {
err = -ENOMEM;
goto err_alloc;
user_config = &vport->adapter->vport_config[idx]->user_config;
rsrc->q_vectors = kzalloc_objs(struct idpf_q_vector,
- rsrc->num_q_vectors, GFP_KERNEL);
+ rsrc->num_q_vectors);
if (!rsrc->q_vectors)
return -ENOMEM;
goto error;
q_vector->complq = kzalloc_objs(*q_vector->complq,
- complqs_per_vector, GFP_KERNEL);
+ complqs_per_vector);
if (!q_vector->complq)
goto error;
continue;
q_vector->xsksq = kzalloc_objs(*q_vector->xsksq,
- rxqs_per_vector, GFP_KERNEL);
+ rxqs_per_vector);
if (!q_vector->xsksq)
goto error;
}
u16 num_max_vports = idpf_get_max_vports(adapter);
adapter->vport_params_reqd = kzalloc_objs(*adapter->vport_params_reqd,
- num_max_vports, GFP_KERNEL);
+ num_max_vports);
if (!adapter->vport_params_reqd)
return -ENOMEM;
adapter->vport_params_recvd = kzalloc_objs(*adapter->vport_params_recvd,
- num_max_vports, GFP_KERNEL);
+ num_max_vports);
if (!adapter->vport_params_recvd)
goto err_mem;
return 0;
adapter->vport_config = kzalloc_objs(*adapter->vport_config,
- num_max_vports, GFP_KERNEL);
+ num_max_vports);
if (!adapter->vport_config)
goto err_mem;
if (!adapter->netdevs) {
adapter->netdevs = kzalloc_objs(struct net_device *,
- num_max_vports, GFP_KERNEL);
+ num_max_vports);
if (!adapter->netdevs) {
err = -ENOMEM;
goto err_netdev_alloc;
adapter->vfs_allocated_count = num_vfs;
adapter->vf_data = kzalloc_objs(struct vf_data_storage,
- adapter->vfs_allocated_count,
- GFP_KERNEL);
+ adapter->vfs_allocated_count);
/* if allocation failed then we do not support SR-IOV */
if (!adapter->vf_data) {
adapter->vfs_allocated_count);
adapter->vf_mac_list = kzalloc_objs(struct vf_mac_filter,
- num_vf_mac_filters, GFP_KERNEL);
+ num_vf_mac_filters);
mac_list = adapter->vf_mac_list;
INIT_LIST_HEAD(&adapter->vf_macs.l);
adapter->flags |= IGB_FLAG_HAS_MSIX;
adapter->mac_table = kzalloc_objs(struct igb_mac_addr,
- hw->mac.rar_entry_count, GFP_KERNEL);
+ hw->mac.rar_entry_count);
if (!adapter->mac_table)
return -ENOMEM;
adapter->jump_tables[i] = NULL;
adapter->mac_table = kzalloc_objs(struct ixgbe_mac_addr,
- hw->mac.num_rar_entries, GFP_KERNEL);
+ hw->mac.num_rar_entries);
if (!adapter->mac_table)
return -ENOMEM;
return status;
fwlog->ring.rings = kzalloc_objs(*fwlog->ring.rings,
- LIBIE_FWLOG_RING_SIZE_DFLT,
- GFP_KERNEL);
+ LIBIE_FWLOG_RING_SIZE_DFLT);
if (!fwlog->ring.rings) {
dev_warn(&fwlog->pdev->dev, "Unable to allocate memory for FW log rings\n");
return -ENOMEM;
goto err_free_mem;
qset->sq = kzalloc_objs(struct otx2_snd_queue,
- otx2_get_total_tx_queues(pf), GFP_KERNEL);
+ otx2_get_total_tx_queues(pf));
if (!qset->sq)
goto err_free_mem;
return -ENOMEM;
trap_data->trap_items_arr = kzalloc_objs(struct prestera_trap_item,
- traps_count, GFP_KERNEL);
+ traps_count);
if (!trap_data->trap_items_arr) {
err = -ENOMEM;
goto err_trap_items_alloc;
priv->mfunc.master.vf_admin =
kzalloc_objs(struct mlx4_vf_admin_state,
- dev->num_slaves, GFP_KERNEL);
+ dev->num_slaves);
if (!priv->mfunc.master.vf_admin)
goto err_comm_admin;
int err = 0;
priv->cmd.context = kmalloc_objs(struct mlx4_cmd_context,
- priv->cmd.max_cmds, GFP_KERNEL);
+ priv->cmd.max_cmds);
if (!priv->cmd.context)
return -ENOMEM;
continue;
dst->tx_ring[t] = kzalloc_objs(struct mlx4_en_tx_ring *,
- MAX_TX_RINGS, GFP_KERNEL);
+ MAX_TX_RINGS);
if (!dst->tx_ring[t])
goto err_free_tx;
continue;
priv->tx_ring[t] = kzalloc_objs(struct mlx4_en_tx_ring *,
- MAX_TX_RINGS, GFP_KERNEL);
+ MAX_TX_RINGS);
if (!priv->tx_ring[t]) {
err = -ENOMEM;
goto out;
struct mlx4_priv *priv = mlx4_priv(dev);
priv->eq_table.eq = kzalloc_objs(*priv->eq_table.eq,
- dev->caps.num_eqs - dev->caps.reserved_eqs,
- GFP_KERNEL);
+ dev->caps.num_eqs - dev->caps.reserved_eqs);
if (!priv->eq_table.eq)
return -ENOMEM;
int i;
priv->eq_table.uar_map = kzalloc_objs(*priv->eq_table.uar_map,
- mlx4_num_eq_uar(dev), GFP_KERNEL);
+ mlx4_num_eq_uar(dev));
if (!priv->eq_table.uar_map) {
err = -ENOMEM;
goto err_out_free;
return priv->adev_idx;
priv->adev = kzalloc_objs(struct mlx4_adev *,
- ARRAY_SIZE(mlx4_adev_devices), GFP_KERNEL);
+ ARRAY_SIZE(mlx4_adev_devices));
if (!priv->adev) {
ida_free(&mlx4_adev_ida, priv->adev_idx);
return -ENOMEM;
/* In mfunc, calculate proxy and tunnel qp offsets for the PF here,
* since the PF does not call mlx4_slave_caps */
dev->caps.spec_qps = kzalloc_objs(*dev->caps.spec_qps,
- dev->caps.num_ports,
- GFP_KERNEL);
+ dev->caps.num_ports);
if (!dev->caps.spec_qps) {
err = -ENOMEM;
goto err_mem;
&priv->mfunc.master.res_tracker.res_alloc[i];
res_alloc->quota = kmalloc_objs(int, dev->persist->num_vfs + 1);
res_alloc->guaranteed = kmalloc_objs(int,
- dev->persist->num_vfs + 1,
- GFP_KERNEL);
+ dev->persist->num_vfs + 1);
if (i == RES_MAC || i == RES_VLAN)
res_alloc->allocated =
kzalloc_objs(int,
- MLX4_MAX_PORTS * (dev->persist->num_vfs + 1),
- GFP_KERNEL);
+ MLX4_MAX_PORTS * (dev->persist->num_vfs + 1));
else
res_alloc->allocated =
kzalloc_objs(int, dev->persist->num_vfs + 1);
struct mlx5_priv *priv = &dev->priv;
priv->adev = kzalloc_objs(struct mlx5_adev *,
- ARRAY_SIZE(mlx5_adev_devices), GFP_KERNEL);
+ ARRAY_SIZE(mlx5_adev_devices));
if (!priv->adev)
return -ENOMEM;
struct mlx5e_sq_stats **stats_list;
stats_list = kvzalloc_objs(*stats_list,
- mlx5e_qos_max_leaf_nodes(priv->mdev),
- GFP_KERNEL);
+ mlx5e_qos_max_leaf_nodes(priv->mdev));
if (!stats_list)
return -ENOMEM;
u32 rate_limit_elem_ix;
vport->qos.sched_nodes = kzalloc_objs(struct mlx5_esw_sched_node *,
- num_tcs, GFP_KERNEL);
+ num_tcs);
if (!vport->qos.sched_nodes) {
NL_SET_ERR_MSG_MOD(extack,
"Allocating the vport TC scheduling elements failed.");
steering->rdma_transport_rx_root_ns =
kzalloc_objs(*steering->rdma_transport_rx_root_ns,
- total_vports, GFP_KERNEL);
+ total_vports);
if (!steering->rdma_transport_rx_root_ns)
return -ENOMEM;
steering->rdma_transport_tx_root_ns =
kzalloc_objs(*steering->rdma_transport_tx_root_ns,
- total_vports, GFP_KERNEL);
+ total_vports);
if (!steering->rdma_transport_tx_root_ns)
return -ENOMEM;
int err;
steering->fdb_sub_ns = kzalloc_objs(*steering->fdb_sub_ns,
- FDB_NUM_CHAINS, GFP_KERNEL);
+ FDB_NUM_CHAINS);
if (!steering->fdb_sub_ns)
return -ENOMEM;
hwmon->module_scount = mon_cap ? 1 : 0;
sensors_count = hwmon->asic_platform_scount + hwmon->module_scount;
hwmon->temp_channel_desc = kzalloc_objs(*hwmon->temp_channel_desc,
- sensors_count, GFP_KERNEL);
+ sensors_count);
if (!hwmon->temp_channel_desc) {
err = -ENOMEM;
goto err_free_hwmon;
clock->ptp_info.pin_config =
kzalloc_objs(*clock->ptp_info.pin_config,
- clock->ptp_info.n_pins, GFP_KERNEL);
+ clock->ptp_info.n_pins);
if (!clock->ptp_info.pin_config)
return;
clock->ptp_info.enable = mlx5_ptp_enable;
bwc_matcher->size_of_at_array = MLX5HWS_BWC_MATCHER_ATTACH_AT_NUM;
bwc_matcher->at = kzalloc_objs(*bwc_matcher->at,
- bwc_matcher->size_of_at_array,
- GFP_KERNEL);
+ bwc_matcher->size_of_at_array);
if (!bwc_matcher->at)
goto free_bwc_matcher_rules;
queue->used_entries = 0;
queue->completed.entries = kzalloc_objs(queue->completed.entries[0],
- queue->num_entries, GFP_KERNEL);
+ queue->num_entries);
if (!queue->completed.entries)
return -ENOMEM;
ctx->queues += bwc_queues;
ctx->bwc_send_queue_locks = kzalloc_objs(*ctx->bwc_send_queue_locks,
- bwc_queues, GFP_KERNEL);
+ bwc_queues);
if (!ctx->bwc_send_queue_locks)
return -ENOMEM;
ctx->bwc_lock_class_keys = kzalloc_objs(*ctx->bwc_lock_class_keys,
- bwc_queues, GFP_KERNEL);
+ bwc_queues);
if (!ctx->bwc_lock_class_keys)
goto err_lock_class_keys;
pool->th = max_hot_size;
pool->hot_chunks_arr = kvzalloc_objs(struct mlx5dr_icm_hot_chunk,
- num_of_chunks, GFP_KERNEL);
+ num_of_chunks);
if (!pool->hot_chunks_arr)
goto free_pool;
}
fs_dr_actions = kzalloc_objs(*fs_dr_actions,
- MLX5_FLOW_CONTEXT_ACTION_MAX, GFP_KERNEL);
+ MLX5_FLOW_CONTEXT_ACTION_MAX);
if (!fs_dr_actions) {
err = -ENOMEM;
goto free_actions_alloc;
mlxsw_core->max_ports = MLXSW_PORT_MAX_PORTS_DEFAULT + 1;
mlxsw_core->ports = kzalloc_objs(struct mlxsw_core_port,
- mlxsw_core->max_ports, GFP_KERNEL);
+ mlxsw_core->max_ports);
if (!mlxsw_core->ports)
return -ENOMEM;
for (i = 0; i < env->num_of_slots; i++) {
env->line_cards[i] = kzalloc_flex(*env->line_cards[i],
module_info,
- env->max_module_count,
- GFP_KERNEL);
+ env->max_module_count);
if (!env->line_cards[i])
goto kzalloc_err;
}
types_info->ini_files = kmalloc_objs(struct mlxsw_linecard_ini_file *,
- types_info->count, GFP_KERNEL);
+ types_info->count);
if (!types_info->ini_files) {
err = -ENOMEM;
goto err_ini_files_alloc;
return 0;
area->tz_module_arr = kzalloc_objs(*area->tz_module_arr,
- area->tz_module_num, GFP_KERNEL);
+ area->tz_module_num);
if (!area->tz_module_arr)
return -ENOMEM;
area->tz_gearbox_num = gbox_num;
area->tz_gearbox_arr = kzalloc_objs(*area->tz_gearbox_arr,
- area->tz_gearbox_num, GFP_KERNEL);
+ area->tz_gearbox_num);
if (!area->tz_gearbox_arr)
return -ENOMEM;
return -ENOMEM;
mlxsw_m->line_cards = kzalloc_objs(*mlxsw_m->line_cards,
- mlxsw_m->num_of_slots, GFP_KERNEL);
+ mlxsw_m->num_of_slots);
if (!mlxsw_m->line_cards) {
err = -ENOMEM;
goto err_kcalloc;
for (i = 0; i < mlxsw_m->num_of_slots; i++) {
mlxsw_m->line_cards[i] =
kzalloc_flex(*mlxsw_m->line_cards[i], module_to_port,
- mlxsw_m->max_modules_per_slot, GFP_KERNEL);
+ mlxsw_m->max_modules_per_slot);
if (!mlxsw_m->line_cards[i]) {
err = -ENOMEM;
goto err_kmalloc_array;
int err;
mlxsw_sp->port_mapping = kzalloc_objs(struct mlxsw_sp_port_mapping,
- max_ports, GFP_KERNEL);
+ max_ports);
if (!mlxsw_sp->port_mapping)
return -ENOMEM;
mr_tcam_region->parman = parman;
parman_prios = kmalloc_objs(*parman_prios,
- MLXSW_SP_MR_ROUTE_PRIO_MAX + 1, GFP_KERNEL);
+ MLXSW_SP_MR_ROUTE_PRIO_MAX + 1);
if (!parman_prios) {
err = -ENOMEM;
goto err_parman_prios_alloc;
if (ops->num_classes) {
mlxsw_sp_qdisc->qdiscs = kzalloc_objs(*mlxsw_sp_qdisc->qdiscs,
- ops->num_classes,
- GFP_KERNEL);
+ ops->num_classes);
if (!mlxsw_sp_qdisc->qdiscs)
return -ENOMEM;
max_trees = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_LPM_TREES);
mlxsw_sp->router->lpm.tree_count = max_trees - MLXSW_SP_LPM_TREE_MIN;
mlxsw_sp->router->lpm.trees = kzalloc_objs(struct mlxsw_sp_lpm_tree,
- mlxsw_sp->router->lpm.tree_count,
- GFP_KERNEL);
+ mlxsw_sp->router->lpm.tree_count);
if (!mlxsw_sp->router->lpm.trees)
return -ENOMEM;
nfp_prog = env->prog->aux->offload->dev_priv;
nfp_prog->subprog_cnt = env->subprog_cnt;
nfp_prog->subprog = kzalloc_objs(nfp_prog->subprog[0],
- nfp_prog->subprog_cnt, GFP_KERNEL);
+ nfp_prog->subprog_cnt);
if (!nfp_prog->subprog)
return -ENOMEM;
/* Init timestamps for mask id*/
priv->mask_ids.last_used =
kmalloc_objs(*priv->mask_ids.last_used,
- NFP_FLOWER_MASK_ENTRY_RS, GFP_KERNEL);
+ NFP_FLOWER_MASK_ENTRY_RS);
if (!priv->mask_ids.last_used)
goto err_free_mask_id;
goto alloc_err;
qm_info->qm_pq_params = kzalloc_objs(*qm_info->qm_pq_params,
- qed_init_qm_get_num_pqs(p_hwfn),
- GFP_KERNEL);
+ qed_init_qm_get_num_pqs(p_hwfn));
if (!qm_info->qm_pq_params)
goto alloc_err;
qm_info->qm_vport_params = kzalloc_objs(*qm_info->qm_vport_params,
- qed_init_qm_get_num_vports(p_hwfn),
- GFP_KERNEL);
+ qed_init_qm_get_num_vports(p_hwfn));
if (!qm_info->qm_vport_params)
goto alloc_err;
qm_info->qm_port_params = kzalloc_objs(*qm_info->qm_port_params,
- p_hwfn->cdev->num_ports_in_engine,
- GFP_KERNEL);
+ p_hwfn->cdev->num_ports_in_engine);
if (!qm_info->qm_port_params)
goto alloc_err;
qm_info->wfq_data = kzalloc_objs(*qm_info->wfq_data,
- qed_init_qm_get_num_vports(p_hwfn),
- GFP_KERNEL);
+ qed_init_qm_get_num_vports(p_hwfn));
if (!qm_info->wfq_data)
goto alloc_err;
goto err;
iwarp_info->partial_fpdus = kzalloc_objs(*iwarp_info->partial_fpdus,
- (u16)p_hwfn->p_rdma_info->num_qps,
- GFP_KERNEL);
+ (u16)p_hwfn->p_rdma_info->num_qps);
if (!iwarp_info->partial_fpdus) {
rc = -ENOMEM;
goto err;
* we allocate enough to take care of all rx packets
*/
iwarp_info->mpa_bufs = kzalloc_objs(*iwarp_info->mpa_bufs,
- data.input.rx_num_desc, GFP_KERNEL);
+ data.input.rx_num_desc);
if (!iwarp_info->mpa_bufs) {
rc = -ENOMEM;
goto err;
/* Allocate LL2's set struct */
p_ll2_connections = kzalloc_objs(struct qed_ll2_info,
- QED_MAX_NUM_OF_LL2_CONNECTIONS,
- GFP_KERNEL);
+ QED_MAX_NUM_OF_LL2_CONNECTIONS);
if (!p_ll2_connections) {
DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_ll2'\n");
return -ENOMEM;
}
nvm_info.image_att = kmalloc_objs(struct bist_nvm_image_att,
- nvm_info.num_images, GFP_KERNEL);
+ nvm_info.num_images);
if (!nvm_info.image_att) {
rc = -ENOMEM;
goto err0;
INIT_LIST_HEAD(&p_ooo_info->free_isles_list);
p_ooo_info->p_isles_mem = kzalloc_objs(struct qed_ooo_isle,
- max_num_isles, GFP_KERNEL);
+ max_num_isles);
if (!p_ooo_info->p_isles_mem)
goto no_isles_mem;
p_ooo_info->p_archipelagos_mem =
kzalloc_objs(struct qed_ooo_archipelago,
- max_num_archipelagos, GFP_KERNEL);
+ max_num_archipelagos);
if (!p_ooo_info->p_archipelagos_mem)
goto no_archipelagos_mem;
p_ooo_info->ooo_history.p_cqes =
kzalloc_objs(struct ooo_opaque,
- QED_MAX_NUM_OOO_HISTORY_ENTRIES,
- GFP_KERNEL);
+ QED_MAX_NUM_OOO_HISTORY_ENTRIES);
if (!p_ooo_info->ooo_history.p_cqes)
goto no_history_mem;
if (!edev->coal_entry) {
edev->coal_entry = kzalloc_objs(*edev->coal_entry,
- QEDE_MAX_RSS_CNT(edev),
- GFP_KERNEL);
+ QEDE_MAX_RSS_CNT(edev));
if (!edev->coal_entry) {
DP_ERR(edev, "coalesce entry allocation failed\n");
goto err;
qdev->lrg_buf_q_alloc_size = qdev->lrg_buf_q_size * 2;
qdev->lrg_buf = kmalloc_objs(struct ql_rcv_buf_cb,
- qdev->num_large_buffers, GFP_KERNEL);
+ qdev->num_large_buffers);
if (qdev->lrg_buf == NULL)
return -ENOMEM;
recv_ctx = adapter->recv_ctx;
rds_ring = kzalloc_objs(struct qlcnic_host_rds_ring,
- adapter->max_rds_rings, GFP_KERNEL);
+ adapter->max_rds_rings);
if (rds_ring == NULL)
goto err_out;
if (!adapter->msix_entries) {
adapter->msix_entries = kzalloc_objs(struct msix_entry,
- num_msix, GFP_KERNEL);
+ num_msix);
if (!adapter->msix_entries)
return -ENOMEM;
}
if (!adapter->msix_entries) {
adapter->msix_entries = kzalloc_objs(struct msix_entry,
- num_msix, GFP_KERNEL);
+ num_msix);
if (!adapter->msix_entries)
return -ENOMEM;
}
}
adapter->eswitch = kzalloc_objs(struct qlcnic_eswitch,
- QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL);
+ QLCNIC_NIU_MAX_XG_PORTS);
if (!adapter->eswitch) {
ret = -ENOMEM;
goto err_npars;
struct qlcnic_cmd_buffer *cmd_buf_arr;
tx_ring = kzalloc_objs(struct qlcnic_host_tx_ring,
- adapter->drv_tx_rings, GFP_KERNEL);
+ adapter->drv_tx_rings);
if (tx_ring == NULL)
return -ENOMEM;
/* Allocate RX buffers */
priv->rx_buffers[q] = kzalloc_objs(*priv->rx_buffers[q],
- priv->num_rx_ring[q], GFP_KERNEL);
+ priv->num_rx_ring[q]);
if (!priv->rx_buffers[q])
goto error;
/* Allocate array for XDP TX queue lookup. */
efx->xdp_tx_queues = kzalloc_objs(*efx->xdp_tx_queues,
- efx->xdp_tx_queue_count,
- GFP_KERNEL);
+ efx->xdp_tx_queue_count);
if (!efx->xdp_tx_queues)
return -ENOMEM;
}
spin_lock_init(&efx->rps_hash_lock);
/* Failure to allocate is not fatal, but may degrade ARFS performance */
efx->rps_hash_table = kzalloc_objs(*efx->rps_hash_table,
- EFX_ARFS_HASH_TABLE_SIZE, GFP_KERNEL);
+ EFX_ARFS_HASH_TABLE_SIZE);
#endif
spin_lock_init(&efx->vf_reps_lock);
INIT_LIST_HEAD(&efx->vf_reps);
return -ENOMEM;
tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0],
- ef4_tx_cb_page_count(tx_queue),
- GFP_KERNEL);
+ ef4_tx_cb_page_count(tx_queue));
if (!tx_queue->cb_page) {
rc = -ENOMEM;
goto fail1;
goto fail;
rc = -ENOMEM;
desc->keys = kzalloc_objs(struct efx_tc_table_field_fmt,
- desc->n_keys, GFP_KERNEL);
+ desc->n_keys);
if (!desc->keys)
goto fail;
desc->resps = kzalloc_objs(struct efx_tc_table_field_fmt,
- desc->n_resps, GFP_KERNEL);
+ desc->n_resps);
if (!desc->resps)
goto fail;
}
/* Allocate array for XDP TX queue lookup. */
efx->xdp_tx_queues = kzalloc_objs(*efx->xdp_tx_queues,
- efx->xdp_tx_queue_count,
- GFP_KERNEL);
+ efx->xdp_tx_queue_count);
if (!efx->xdp_tx_queues)
return -ENOMEM;
}
spin_lock_init(&efx->rps_hash_lock);
/* Failure to allocate is not fatal, but may degrade ARFS performance */
efx->rps_hash_table = kzalloc_objs(*efx->rps_hash_table,
- EFX_ARFS_HASH_TABLE_SIZE, GFP_KERNEL);
+ EFX_ARFS_HASH_TABLE_SIZE);
#endif
efx->mdio.dev = net_dev;
INIT_WORK(&efx->mac_work, efx_mac_work);
return -ENOMEM;
tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0],
- efx_tx_cb_page_count(tx_queue),
- GFP_KERNEL);
+ efx_tx_cb_page_count(tx_queue));
if (!tx_queue->cb_page) {
rc = -ENOMEM;
goto fail1;
return -ENOMEM;
tx_queue->cb_page = kzalloc_objs(tx_queue->cb_page[0],
- efx_tx_cb_page_count(tx_queue),
- GFP_KERNEL);
+ efx_tx_cb_page_count(tx_queue));
if (!tx_queue->cb_page) {
rc = -ENOMEM;
goto fail1;
struct platform_device *pdev = priv->pdev;
tx_ring->tx_desc_buf = kzalloc_objs(*tx_ring->tx_desc_buf,
- tx_ring->total_cnt, GFP_KERNEL);
+ tx_ring->total_cnt);
if (!tx_ring->tx_desc_buf)
return -ENOMEM;
struct platform_device *pdev = priv->pdev;
rx_ring->rx_desc_buf = kzalloc_objs(*rx_ring->rx_desc_buf,
- rx_ring->total_cnt, GFP_KERNEL);
+ rx_ring->total_cnt);
if (!rx_ring->rx_desc_buf)
return -ENOMEM;
tx_q->priv_data = priv;
tx_q->tx_skbuff_dma = kzalloc_objs(*tx_q->tx_skbuff_dma,
- dma_conf->dma_tx_size, GFP_KERNEL);
+ dma_conf->dma_tx_size);
if (!tx_q->tx_skbuff_dma)
return -ENOMEM;
/* Array of descriptor data */
ring->desc_data_head = kzalloc_objs(struct xlgmac_desc_data,
- dma_desc_count, GFP_KERNEL);
+ dma_desc_count);
if (!ring->desc_data_head)
return -ENOMEM;
/* allocate scan list */
wl->networks = kzalloc_objs(struct gelic_wl_scan_info,
- GELIC_WL_BSS_MAX_ENT, GFP_KERNEL);
+ GELIC_WL_BSS_MAX_ENT);
if (!wl->networks)
goto fail_bss;
int ret = -ENOMEM;
vptr->rx.info = kzalloc_objs(struct velocity_rd_info,
- vptr->options.numrx, GFP_KERNEL);
+ vptr->options.numrx);
if (!vptr->rx.info)
goto out;
for (j = 0; j < vptr->tx.numq; j++) {
vptr->tx.infos[j] = kzalloc_objs(struct velocity_td_info,
- vptr->options.numtx,
- GFP_KERNEL);
+ vptr->options.numtx);
if (!vptr->tx.infos[j]) {
while (--j >= 0)
kfree(vptr->tx.infos[j]);
WX_RSS_FIELD_IPV6 | WX_RSS_FIELD_IPV6_TCP;
wx->mac_table = kzalloc_objs(struct wx_mac_addr,
- wx->mac.num_rar_entries, GFP_KERNEL);
+ wx->mac.num_rar_entries);
if (!wx->mac_table) {
wx_err(wx, "mac_table allocation failed\n");
kfree(wx->rss_key);
return -ENOMEM;
nsim_trap_data->trap_items_arr = kzalloc_objs(struct nsim_trap_item,
- ARRAY_SIZE(nsim_traps_arr),
- GFP_KERNEL);
+ ARRAY_SIZE(nsim_traps_arr));
if (!nsim_trap_data->trap_items_arr) {
err = -ENOMEM;
goto err_trap_data_free;
goto out;
clock->caps.pin_config = kzalloc_objs(struct ptp_pin_desc,
- DP83640_N_PINS, GFP_KERNEL);
+ DP83640_N_PINS);
if (!clock->caps.pin_config) {
kfree(clock);
clock = NULL;
goto out_free_link;
phy->phy_led_triggers = kzalloc_objs(struct phy_led_trigger,
- phy->phy_num_led_triggers,
- GFP_KERNEL);
+ phy->phy_num_led_triggers);
if (!phy->phy_led_triggers) {
err = -ENOMEM;
goto out_unreg_link;
pw_table = pd692x0_class_pw_table;
c33_pw_limit_ranges = kzalloc_objs(*c33_pw_limit_ranges,
- PD692X0_CLASS_PW_TABLE_SIZE,
- GFP_KERNEL);
+ PD692X0_CLASS_PW_TABLE_SIZE);
if (!c33_pw_limit_ranges)
return -ENOMEM;
dbr_dbg_data->num_ring_debug_entries = ATH11K_DEBUG_DBR_ENTRIES_MAX;
dbr_dbg_data->dbr_debug_idx = 0;
dbr_dbg_data->entries = kzalloc_objs(struct ath11k_dbg_dbr_entry,
- ATH11K_DEBUG_DBR_ENTRIES_MAX,
- GFP_KERNEL);
+ ATH11K_DEBUG_DBR_ENTRIES_MAX);
if (!dbr_dbg_data->entries)
return -ENOMEM;
dp->num_bank_profiles = num_tcl_banks;
dp->bank_profiles = kmalloc_objs(struct ath12k_dp_tx_bank_profile,
- num_tcl_banks, GFP_KERNEL);
+ num_tcl_banks);
if (!dp->bank_profiles)
return -ENOMEM;
ds, ah->desc_len, (unsigned long long)ah->desc_daddr);
bf = kzalloc_objs(struct ath5k_buf,
- 1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF, GFP_KERNEL);
+ 1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF);
if (bf == NULL) {
ATH5K_ERR(ah, "can't allocate bufptr\n");
ret = -ENOMEM;
/* Allocate pd_curves for this cal pier */
chinfo[pier].pd_curves =
kzalloc_objs(struct ath5k_pdgain_info,
- AR5K_EEPROM_N_PD_CURVES, GFP_KERNEL);
+ AR5K_EEPROM_N_PD_CURVES);
if (!chinfo[pier].pd_curves)
goto err_out;
/* Allocate pd_curves for this cal pier */
chinfo[pier].pd_curves =
kzalloc_objs(struct ath5k_pdgain_info,
- AR5K_EEPROM_N_PD_CURVES,
- GFP_KERNEL);
+ AR5K_EEPROM_N_PD_CURVES);
if (!chinfo[pier].pd_curves)
goto err_out;
/* Allocate pd_curves for this cal pier */
chinfo[pier].pd_curves =
kzalloc_objs(struct ath5k_pdgain_info,
- AR5K_EEPROM_N_PD_CURVES,
- GFP_KERNEL);
+ AR5K_EEPROM_N_PD_CURVES);
if (!chinfo[pier].pd_curves)
goto err_out;
return -ENODEV;
wil->dbg_data.data_arr = kzalloc_objs(struct wil_debugfs_iomem_data,
- dbg_off_count, GFP_KERNEL);
+ dbg_off_count);
if (!wil->dbg_data.data_arr) {
debugfs_remove_recursive(dbg);
wil->debug = NULL;
e->dev = dev;
log = &e->txstatlog;
log->log = kzalloc_objs(struct b43legacy_txstatus,
- B43legacy_NR_LOGGED_TXSTATUS, GFP_KERNEL);
+ B43legacy_NR_LOGGED_TXSTATUS);
if (!log->log) {
b43legacyerr(dev->wl, "debugfs: add device txstatus OOM\n");
kfree(e);
if ((phy->type == B43legacy_PHYTYPE_B) ||
(phy->type == B43legacy_PHYTYPE_G)) {
phy->_lo_pairs = kzalloc_objs(struct b43legacy_lopair,
- B43legacy_LO_COUNT, GFP_KERNEL);
+ B43legacy_LO_COUNT);
if (!phy->_lo_pairs)
return -ENOMEM;
}
msgbuf->max_flowrings = if_msgbuf->max_flowrings;
msgbuf->flowring_dma_handle =
kzalloc_objs(*msgbuf->flowring_dma_handle,
- msgbuf->max_flowrings, GFP_KERNEL);
+ msgbuf->max_flowrings);
if (!msgbuf->flowring_dma_handle)
goto fail;
bg_band->band = NL80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
bg_band->channels = kzalloc_objs(struct ieee80211_channel,
- geo->bg_channels, GFP_KERNEL);
+ geo->bg_channels);
if (!bg_band->channels) {
ipw2100_down(priv);
return -ENOMEM;
}
priv->tx_buffers = kmalloc_objs(struct ipw2100_tx_packet,
- TX_PENDED_QUEUE_LENGTH, GFP_KERNEL);
+ TX_PENDED_QUEUE_LENGTH);
if (!priv->tx_buffers) {
bd_queue_free(priv, &priv->tx_queue);
return -ENOMEM;
* allocate packets
*/
priv->rx_buffers = kmalloc_objs(struct ipw2100_rx_packet,
- RX_QUEUE_LENGTH, GFP_KERNEL);
+ RX_QUEUE_LENGTH);
if (!priv->rx_buffers) {
IPW_DEBUG_INFO("can't allocate rx packet buffer table\n");
bg_band->band = NL80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
bg_band->channels = kzalloc_objs(struct ieee80211_channel,
- geo->bg_channels, GFP_KERNEL);
+ geo->bg_channels);
if (!bg_band->channels) {
rc = -ENOMEM;
goto out;
a_band->band = NL80211_BAND_5GHZ;
a_band->n_channels = geo->a_channels;
a_band->channels = kzalloc_objs(struct ieee80211_channel,
- geo->a_channels, GFP_KERNEL);
+ geo->a_channels);
if (!a_band->channels) {
rc = -ENOMEM;
goto out;
if (priv->lib->adv_thermal_throttle) {
IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n");
tt->restriction = kzalloc_objs(struct iwl_tt_restriction,
- IWL_TI_STATE_MAX, GFP_KERNEL);
+ IWL_TI_STATE_MAX);
tt->transaction = kzalloc_objs(struct iwl_tt_trans,
- IWL_TI_STATE_MAX * (IWL_TI_STATE_MAX - 1),
- GFP_KERNEL);
+ IWL_TI_STATE_MAX * (IWL_TI_STATE_MAX - 1));
if (!tt->restriction || !tt->transaction) {
IWL_ERR(priv, "Fallback to Legacy Throttling\n");
priv->thermal_throttle.advanced_tt = false;
unsigned long ts = jiffies;
ll->pkts_counters = kzalloc_objs(*ll->pkts_counters,
- mld->trans->info.num_rxqs, GFP_KERNEL);
+ mld->trans->info.num_rxqs);
if (!ll->pkts_counters)
return -ENOMEM;
}
mld->channel_survey = kzalloc_flex(*mld->channel_survey,
- channels, n_channels,
- GFP_KERNEL);
+ channels, n_channels);
if (!mld->channel_survey)
return;
return;
mld_sta->mpdu_counters = kzalloc_objs(*mld_sta->mpdu_counters,
- mld->trans->info.num_rxqs,
- GFP_KERNEL);
+ mld->trans->info.num_rxqs);
if (!mld_sta->mpdu_counters)
return;
WARN_ON(rcu_access_pointer(mvmsta->ptk_pn[keyidx]));
ptk_pn = kzalloc_flex(*ptk_pn, q,
- mvm->trans->info.num_rxqs,
- GFP_KERNEL);
+ mvm->trans->info.num_rxqs);
if (!ptk_pn) {
ret = -ENOMEM;
break;
}
mvm->acs_survey = kzalloc_flex(*mvm->acs_survey, channels,
- n_channels, GFP_KERNEL);
+ n_channels);
if (!mvm->acs_survey)
return;
trans_pcie->rxq = kzalloc_objs(struct iwl_rxq, trans->info.num_rxqs);
trans_pcie->rx_pool = kzalloc_objs(trans_pcie->rx_pool[0],
- RX_POOL_SIZE(trans_pcie->num_rx_bufs),
- GFP_KERNEL);
+ RX_POOL_SIZE(trans_pcie->num_rx_bufs));
trans_pcie->global_table =
kzalloc_objs(trans_pcie->global_table[0],
- RX_POOL_SIZE(trans_pcie->num_rx_bufs), GFP_KERNEL);
+ RX_POOL_SIZE(trans_pcie->num_rx_bufs));
if (!trans_pcie->rxq || !trans_pcie->rx_pool ||
!trans_pcie->global_table) {
ret = -ENOMEM;
trans_pcie->txq_memory =
kzalloc_objs(struct iwl_txq,
- trans->mac_cfg->base->num_of_queues, GFP_KERNEL);
+ trans->mac_cfg->base->num_of_queues);
if (!trans_pcie->txq_memory) {
IWL_ERR(trans, "Not enough memory for txq\n");
ret = -ENOMEM;
goto err_out;
tmp->channels = kzalloc_objs(struct ieee80211_channel,
- list->band_channel_num[band], GFP_KERNEL);
+ list->band_channel_num[band]);
if (!tmp->channels)
goto err_out;
*/
adapter->num_in_chan_stats = 2 * (n_channels_bg + n_channels_a);
adapter->chan_stats = kzalloc_objs(*adapter->chan_stats,
- adapter->num_in_chan_stats,
- GFP_KERNEL);
+ adapter->num_in_chan_stats);
if (!adapter->chan_stats)
return -ENOMEM;
/* Allocate and initialize struct cmd_ctrl_node */
cmd_array = kzalloc_objs(struct cmd_ctrl_node,
- MWIFIEX_NUM_OF_CMD_BUFFER, GFP_KERNEL);
+ MWIFIEX_NUM_OF_CMD_BUFFER);
if (!cmd_array)
return -ENOMEM;
}
scan_chan_list = kzalloc_objs(struct mwifiex_chan_scan_param_set,
- MWIFIEX_USER_SCAN_CHAN_MAX, GFP_KERNEL);
+ MWIFIEX_USER_SCAN_CHAN_MAX);
if (!scan_chan_list) {
kfree(scan_cfg_out);
ret = -ENOMEM;
mac_info->n_if_comb = resp_info->n_iface_combinations;
mac_info->if_comb = kzalloc_objs(*mac->macinfo.if_comb,
- mac->macinfo.n_if_comb, GFP_KERNEL);
+ mac->macinfo.n_if_comb);
if (!mac->macinfo.if_comb)
return -ENOMEM;
ret = -ENOMEM;
ctrl->queues = kzalloc_objs(struct nvme_fc_queue,
- ctrl->ctrl.queue_count, GFP_KERNEL);
+ ctrl->ctrl.queue_count);
if (!ctrl->queues)
goto out_free_ida;
static int nvmet_pci_epf_alloc_irq_vectors(struct nvmet_pci_epf_ctrl *ctrl)
{
ctrl->irq_vectors = kzalloc_objs(struct nvmet_pci_epf_irq_vector,
- ctrl->nr_queues, GFP_KERNEL);
+ ctrl->nr_queues);
if (!ctrl->irq_vectors)
return -ENOMEM;
DBG_IRT("iosapic_register: num vectors = %d\n", isi->isi_num_vectors);
vip = isi->isi_vector = kzalloc_objs(struct vector_info,
- isi->isi_num_vectors, GFP_KERNEL);
+ isi->isi_num_vectors);
if (vip == NULL) {
kfree(isi);
return NULL;
num_of_elements = 2 * num_of_ranges + 2;
union acpi_object *tmp __free(kfree) = kzalloc_objs(*tmp,
- num_of_elements,
- GFP_KERNEL);
+ num_of_elements);
if (!tmp)
return -ENOMEM;
}
keymap = kzalloc_objs(struct key_entry,
- dmi_results.keymap_size + ARRAY_SIZE(dell_wmi_keymap_type_0000) + ARRAY_SIZE(dell_wmi_keymap_type_0010) + ARRAY_SIZE(dell_wmi_keymap_type_0011) + ARRAY_SIZE(dell_wmi_keymap_type_0012) + 1,
- GFP_KERNEL);
+ dmi_results.keymap_size + ARRAY_SIZE(dell_wmi_keymap_type_0000) + ARRAY_SIZE(dell_wmi_keymap_type_0010) + ARRAY_SIZE(dell_wmi_keymap_type_0011) + ARRAY_SIZE(dell_wmi_keymap_type_0012) + 1);
if (!keymap) {
kfree(dmi_results.keymap);
err = -ENOMEM;
/* remap the wmi keymap event to new keymap */
keymap = kzalloc_objs(struct key_entry,
- ARRAY_SIZE(dell_wmi_keymap_type_0012), GFP_KERNEL);
+ ARRAY_SIZE(dell_wmi_keymap_type_0012));
if (!keymap)
return -ENOMEM;
wmi_priv.enumeration_instances_count =
get_instance_count(DELL_WMI_BIOS_ENUMERATION_ATTRIBUTE_GUID);
wmi_priv.enumeration_data = kzalloc_objs(struct enumeration_data,
- wmi_priv.enumeration_instances_count,
- GFP_KERNEL);
+ wmi_priv.enumeration_instances_count);
if (!wmi_priv.enumeration_data) {
wmi_priv.enumeration_instances_count = 0;
ret = -ENOMEM;
wmi_priv.integer_instances_count = get_instance_count(DELL_WMI_BIOS_INTEGER_ATTRIBUTE_GUID);
wmi_priv.integer_data = kzalloc_objs(struct integer_data,
- wmi_priv.integer_instances_count,
- GFP_KERNEL);
+ wmi_priv.integer_instances_count);
if (!wmi_priv.integer_data) {
wmi_priv.integer_instances_count = 0;
ret = -ENOMEM;
wmi_priv.po_instances_count = get_instance_count(DELL_WMI_BIOS_PASSOBJ_ATTRIBUTE_GUID);
wmi_priv.po_data = kzalloc_objs(struct po_data,
- wmi_priv.po_instances_count, GFP_KERNEL);
+ wmi_priv.po_instances_count);
if (!wmi_priv.po_data) {
wmi_priv.po_instances_count = 0;
ret = -ENOMEM;
wmi_priv.str_instances_count = get_instance_count(DELL_WMI_BIOS_STRING_ATTRIBUTE_GUID);
wmi_priv.str_data = kzalloc_objs(struct str_data,
- wmi_priv.str_instances_count,
- GFP_KERNEL);
+ wmi_priv.str_instances_count);
if (!wmi_priv.str_data) {
wmi_priv.str_instances_count = 0;
ret = -ENOMEM;
hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID);
bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data,
- bioscfg_drv.enumeration_instances_count,
- GFP_KERNEL);
+ bioscfg_drv.enumeration_instances_count);
if (!bioscfg_drv.enumeration_data) {
bioscfg_drv.enumeration_instances_count = 0;
return -ENOMEM;
{
bioscfg_drv.integer_instances_count = hp_get_instance_count(HP_WMI_BIOS_INTEGER_GUID);
bioscfg_drv.integer_data = kzalloc_objs(*bioscfg_drv.integer_data,
- bioscfg_drv.integer_instances_count,
- GFP_KERNEL);
+ bioscfg_drv.integer_instances_count);
if (!bioscfg_drv.integer_data) {
bioscfg_drv.integer_instances_count = 0;
bioscfg_drv.ordered_list_instances_count =
hp_get_instance_count(HP_WMI_BIOS_ORDERED_LIST_GUID);
bioscfg_drv.ordered_list_data = kzalloc_objs(*bioscfg_drv.ordered_list_data,
- bioscfg_drv.ordered_list_instances_count,
- GFP_KERNEL);
+ bioscfg_drv.ordered_list_instances_count);
if (!bioscfg_drv.ordered_list_data) {
bioscfg_drv.ordered_list_instances_count = 0;
return -ENOMEM;
{
bioscfg_drv.password_instances_count = hp_get_instance_count(HP_WMI_BIOS_PASSWORD_GUID);
bioscfg_drv.password_data = kzalloc_objs(*bioscfg_drv.password_data,
- bioscfg_drv.password_instances_count,
- GFP_KERNEL);
+ bioscfg_drv.password_instances_count);
if (!bioscfg_drv.password_data) {
bioscfg_drv.password_instances_count = 0;
return -ENOMEM;
{
bioscfg_drv.string_instances_count = hp_get_instance_count(HP_WMI_BIOS_STRING_GUID);
bioscfg_drv.string_data = kzalloc_objs(*bioscfg_drv.string_data,
- bioscfg_drv.string_instances_count,
- GFP_KERNEL);
+ bioscfg_drv.string_instances_count);
if (!bioscfg_drv.string_data) {
bioscfg_drv.string_instances_count = 0;
return -ENOMEM;
return AE_ERROR;
data->device_mode_info = kmalloc_objs(struct wwan_device_mode_info,
- data->total_dev_mode, GFP_KERNEL);
+ data->total_dev_mode);
if (!data->device_mode_info)
return AE_ERROR;
}
isst_common.sst_inst = kzalloc_objs(*isst_common.sst_inst,
- topology_max_packages(), GFP_KERNEL);
+ topology_max_packages());
if (!isst_common.sst_inst) {
ret = -ENOMEM;
goto init_done;
return ret;
tpmi_power_domain_mask = kzalloc_objs(*tpmi_power_domain_mask,
- size_mul(topology_max_packages(), MAX_POWER_DOMAINS),
- GFP_KERNEL);
+ size_mul(topology_max_packages(), MAX_POWER_DOMAINS));
if (!tpmi_power_domain_mask)
return -ENOMEM;
}
for (j = 0; j < uv_bios_obj_cnt; j++) {
uv_hubs[j]->ports = kzalloc_objs(*uv_hubs[j]->ports,
- hub_buf[j].ports, GFP_KERNEL);
+ hub_buf[j].ports);
if (!uv_hubs[j]->ports) {
ret = -ENOMEM;
j--;
if (!power_zone->name)
goto err_name_alloc;
power_zone->constraints = kzalloc_objs(*power_zone->constraints,
- nr_constraints, GFP_KERNEL);
+ nr_constraints);
if (!power_zone->constraints)
goto err_const_alloc;
continue;
mbwu_state = kzalloc_objs(*ris->mbwu_state,
- ris->props.num_mbwu_mon,
- GFP_KERNEL);
+ ris->props.num_mbwu_mon);
if (!mbwu_state) {
__destroy_component_cfg(comp);
return -ENOMEM;
* sizeof(struct zcrypt_device_status_ext);
device_status = kvzalloc_objs(struct zcrypt_device_status_ext,
- MAX_ZDEV_ENTRIES_EXT, GFP_KERNEL);
+ MAX_ZDEV_ENTRIES_EXT);
if (!device_status)
return -ENOMEM;
zcrypt_device_status_mask_ext(device_status,
fsa_dev_ptr = dev->fsa_dev;
dev->fsa_dev = kzalloc_objs(*fsa_dev_ptr,
- maximum_num_containers, GFP_KERNEL);
+ maximum_num_containers);
kfree(fsa_dev_ptr);
fsa_dev_ptr = NULL;
/* Allocate memory for wrb_context */
phwi_ctrlr = phba->phwi_ctrlr;
phwi_ctrlr->wrb_context = kzalloc_objs(struct hwi_wrb_context,
- phba->params.cxns_per_ctrl,
- GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phwi_ctrlr->wrb_context) {
kfree(phba->phwi_ctrlr);
return -ENOMEM;
/* Allocate memory for WRBQ */
phwi_ctxt = phwi_ctrlr->phwi_ctxt;
phwi_ctxt->be_wrbq = kzalloc_objs(struct be_queue_info,
- phba->params.cxns_per_ctrl,
- GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phwi_ctxt->be_wrbq) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : WRBQ Mem Alloc Failed\n");
pwrb_context = &phwi_ctrlr->wrb_context[index];
pwrb_context->pwrb_handle_base =
kzalloc_objs(struct wrb_handle *,
- phba->params.wrbs_per_cxn,
- GFP_KERNEL);
+ phba->params.wrbs_per_cxn);
if (!pwrb_context->pwrb_handle_base) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
}
pwrb_context->pwrb_handle_basestd =
kzalloc_objs(struct wrb_handle *,
- phba->params.wrbs_per_cxn,
- GFP_KERNEL);
+ phba->params.wrbs_per_cxn);
if (!pwrb_context->pwrb_handle_basestd) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
mem_descr_sglh += HWI_MEM_SGLH;
if (1 == mem_descr_sglh->num_elements) {
phba->io_sgl_hndl_base = kzalloc_objs(struct sgl_handle *,
- phba->params.ios_per_ctrl,
- GFP_KERNEL);
+ phba->params.ios_per_ctrl);
if (!phba->io_sgl_hndl_base) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Mem Alloc Failed. Failing to load\n");
}
phba->eh_sgl_hndl_base =
kzalloc_objs(struct sgl_handle *,
- phba->params.icds_per_ctrl - phba->params.ios_per_ctrl,
- GFP_KERNEL);
+ phba->params.icds_per_ctrl - phba->params.ios_per_ctrl);
if (!phba->eh_sgl_hndl_base) {
kfree(phba->io_sgl_hndl_base);
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
}
}
phba->ep_array = kzalloc_objs(struct iscsi_endpoint *,
- phba->params.cxns_per_ctrl, GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phba->ep_array) {
ret = -ENOMEM;
}
phba->conn_table = kzalloc_objs(struct beiscsi_conn *,
- phba->params.cxns_per_ctrl, GFP_KERNEL);
+ phba->params.cxns_per_ctrl);
if (!phba->conn_table) {
kfree(phba->ep_array);
phba->ep_array = NULL;
flq = wrm->q_arr[q->un.iq.flq_idx];
flq->un.fl.bufs = kzalloc_objs(struct csio_dma_buf,
- flq->credits, GFP_KERNEL);
+ flq->credits);
if (!flq->un.fl.bufs) {
csio_err(hw,
"Failed to allocate FL queue bufs"
/* allocate the request table */
a->req_table =
kzalloc_objs(struct esas2r_request *,
- num_requests + num_ae_requests + 1, GFP_KERNEL);
+ num_requests + num_ae_requests + 1);
if (a->req_table == NULL) {
esas2r_log(ESAS2R_LOG_CRIT,
for (i = 0; i < h->nr_cmds; i++) {
h->ioaccel2_cmd_sg_list[i] =
kmalloc_objs(*h->ioaccel2_cmd_sg_list[i],
- h->maxsgentries, GFP_KERNEL);
+ h->maxsgentries);
if (!h->ioaccel2_cmd_sg_list[i])
goto clean;
}
for (i = 0; i < h->nr_cmds; i++) {
h->cmd_sg_list[i] = kmalloc_objs(*h->cmd_sg_list[i],
- h->chainsize, GFP_KERNEL);
+ h->chainsize);
if (!h->cmd_sg_list[i])
goto clean;
goto free_login_buffer;
vhost->trace = kzalloc_objs(struct ibmvfc_trace_entry,
- IBMVFC_NUM_TRACE_ENTRIES, GFP_KERNEL);
+ IBMVFC_NUM_TRACE_ENTRIES);
atomic_set(&vhost->trace_index, -1);
if (!vhost->trace)
return -ENOMEM;
ioa_cfg->ipr_cmnd_list = kzalloc_objs(struct ipr_cmnd *,
- IPR_NUM_CMD_BLKS, GFP_KERNEL);
+ IPR_NUM_CMD_BLKS);
ioa_cfg->ipr_cmnd_list_dma = kzalloc_objs(dma_addr_t, IPR_NUM_CMD_BLKS);
if (!ioa_cfg->ipr_cmnd_list || !ioa_cfg->ipr_cmnd_list_dma) {
ENTER;
ioa_cfg->res_entries = kzalloc_objs(struct ipr_resource_entry,
- ioa_cfg->max_devs_supported,
- GFP_KERNEL);
+ ioa_cfg->max_devs_supported);
if (!ioa_cfg->res_entries)
goto out;
}
ioa_cfg->trace = kzalloc_objs(struct ipr_trace_entry,
- IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);
+ IPR_NUM_TRACE_ENTRIES);
if (!ioa_cfg->trace)
goto out_free_hostrcb_dma;
&lpfc_debugfs_op_slow_ring_trc);
if (!phba->slow_ring_trc) {
phba->slow_ring_trc = kzalloc_objs(struct lpfc_debugfs_trc,
- lpfc_debugfs_max_slow_ring_trc,
- GFP_KERNEL);
+ lpfc_debugfs_max_slow_ring_trc);
if (!phba->slow_ring_trc) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
"0416 Cannot create debugfs "
if (!phba->sli.sli3_ring)
phba->sli.sli3_ring = kzalloc_objs(struct lpfc_sli_ring,
- LPFC_SLI3_MAX_RING,
- GFP_KERNEL);
+ LPFC_SLI3_MAX_RING);
if (!phba->sli.sli3_ring)
return -ENOMEM;
}
phba->sli4_hba.hba_eq_hdl = kzalloc_objs(struct lpfc_hba_eq_hdl,
- phba->cfg_irq_chann,
- GFP_KERNEL);
+ phba->cfg_irq_chann);
if (!phba->sli4_hba.hba_eq_hdl) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"2572 Failed allocate memory for "
}
phba->sli4_hba.cpu_map = kzalloc_objs(struct lpfc_vector_map_info,
- phba->sli4_hba.num_possible_cpu,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu);
if (!phba->sli4_hba.cpu_map) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3327 Failed allocate memory for msi-x "
}
phba->sli4_hba.idle_stat = kzalloc_objs(*phba->sli4_hba.idle_stat,
- phba->sli4_hba.num_possible_cpu,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu);
if (!phba->sli4_hba.idle_stat) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3390 Failed allocation for idle_stat\n");
if (!phba->sli4_hba.hdwq) {
phba->sli4_hba.hdwq = kzalloc_objs(struct lpfc_sli4_hdw_queue,
- phba->cfg_hdw_queue,
- GFP_KERNEL);
+ phba->cfg_hdw_queue);
if (!phba->sli4_hba.hdwq) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"6427 Failed allocate memory for "
if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
if (phba->nvmet_support) {
phba->sli4_hba.nvmet_cqset = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_cqset) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3121 Fail allocate memory for "
goto out_error;
}
phba->sli4_hba.nvmet_mrq_hdr = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_mrq_hdr) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3122 Fail allocate memory for "
goto out_error;
}
phba->sli4_hba.nvmet_mrq_data = kzalloc_objs(struct lpfc_queue *,
- phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_mrq_data) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"3124 Fail allocate memory for "
if (phba->sli4_hba.cq_max) {
kfree(phba->sli4_hba.cq_lookup);
phba->sli4_hba.cq_lookup = kzalloc_objs(struct lpfc_queue *,
- (phba->sli4_hba.cq_max + 1),
- GFP_KERNEL);
+ (phba->sli4_hba.cq_max + 1));
if (!phba->sli4_hba.cq_lookup) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"0549 Failed setup of CQ Lookup table: "
phba->sli4_hba.nvmet_xri_cnt);
phba->sli4_hba.nvmet_ctx_info = kzalloc_objs(struct lpfc_nvmet_ctx_info,
- phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq,
- GFP_KERNEL);
+ phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq);
if (!phba->sli4_hba.nvmet_ctx_info) {
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
"6419 Failed allocate memory for "
* XXX FIXME: Use DMA consistent routines
*/
dma_cmd_space = kmalloc_objs(struct dbdma_cmd,
- host->sg_tablesize + 2, GFP_KERNEL);
+ host->sg_tablesize + 2);
if (!dma_cmd_space) {
printk(KERN_ERR "mac53c94: couldn't allocate dma "
"command space for %pOF\n", node);
if (instance->adapter_type >= VENTURA_SERIES) {
fusion->stream_detect_by_ld =
kzalloc_objs(struct LD_STREAM_DETECT *,
- MAX_LOGICAL_DRIVES_EXT, GFP_KERNEL);
+ MAX_LOGICAL_DRIVES_EXT);
if (!fusion->stream_detect_by_ld) {
dev_err(&instance->pdev->dev,
"unable to allocate stream detection for pool of LDs\n");
op_reply_q->segment_qd);
op_reply_q->q_segments = kzalloc_objs(struct segments,
- op_reply_q->num_segments,
- GFP_KERNEL);
+ op_reply_q->num_segments);
if (!op_reply_q->q_segments)
return -ENOMEM;
op_req_q->segment_qd);
op_req_q->q_segments = kzalloc_objs(struct segments,
- op_req_q->num_segments, GFP_KERNEL);
+ op_req_q->num_segments);
if (!op_req_q->q_segments)
return -ENOMEM;
goto out_fail;
}
sas_expander->phy = kzalloc_objs(struct mpi3mr_sas_phy,
- sas_expander->num_phys, GFP_KERNEL);
+ sas_expander->num_phys);
if (!sas_expander->phy) {
rc = -1;
goto out_fail;
if (iopoll_q_count) {
ioc->io_uring_poll_queues = kzalloc_objs(struct io_uring_poll_queue,
- iopoll_q_count,
- GFP_KERNEL);
+ iopoll_q_count);
if (!ioc->io_uring_poll_queues)
iopoll_q_count = 0;
}
* MPT3_SUP_REPLY_POST_HOST_INDEX_REG_OFFSET from previous one.
*/
ioc->replyPostRegisterIndex = kzalloc_objs(resource_size_t *,
- ioc->combined_reply_index_count,
- GFP_KERNEL);
+ ioc->combined_reply_index_count);
if (!ioc->replyPostRegisterIndex) {
ioc_err(ioc,
"allocation for replyPostRegisterIndex failed!\n");
/* initialize hi-priority queue smid's */
ioc->hpr_lookup = kzalloc_objs(struct request_tracker,
- ioc->hi_priority_depth, GFP_KERNEL);
+ ioc->hi_priority_depth);
if (!ioc->hpr_lookup) {
ioc_err(ioc, "hpr_lookup: kcalloc failed\n");
goto out;
/* initialize internal queue smid's */
ioc->internal_lookup = kzalloc_objs(struct request_tracker,
- ioc->internal_depth, GFP_KERNEL);
+ ioc->internal_depth);
if (!ioc->internal_lookup) {
ioc_err(ioc, "internal_lookup: kcalloc failed\n");
goto out;
if (ioc->is_warpdrive) {
ioc->reply_post_host_index = kzalloc_objs(resource_size_t *,
- ioc->cpu_msix_table_sz,
- GFP_KERNEL);
+ ioc->cpu_msix_table_sz);
if (!ioc->reply_post_host_index) {
ioc_info(ioc, "Allocation for reply_post_host_index failed!!!\n");
r = -ENOMEM;
goto out_free_resources;
ioc->pfacts = kzalloc_objs(struct mpt3sas_port_facts,
- ioc->facts.NumberOfPorts, GFP_KERNEL);
+ ioc->facts.NumberOfPorts);
if (!ioc->pfacts) {
r = -ENOMEM;
goto out_free_resources;
ioc->event_context = 0;
ioc->aen_event_read_flag = 0;
ioc->event_log = kzalloc_objs(struct MPT3_IOCTL_EVENTS,
- MPT3SAS_CTL_EVENT_LOG_SIZE, GFP_KERNEL);
+ MPT3SAS_CTL_EVENT_LOG_SIZE);
if (!ioc->event_log) {
pr_err("failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
ioc->sas_hba.nr_phys_allocated = max_t(u8,
MPT_MAX_HBA_NUM_PHYS, num_phys);
ioc->sas_hba.phy = kzalloc_objs(struct _sas_phy,
- ioc->sas_hba.nr_phys_allocated,
- GFP_KERNEL);
+ ioc->sas_hba.nr_phys_allocated);
if (!ioc->sas_hba.phy) {
ioc_err(ioc, "failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
goto out_fail;
}
sas_expander->phy = kzalloc_objs(struct _sas_phy,
- sas_expander->num_phys, GFP_KERNEL);
+ sas_expander->num_phys);
if (!sas_expander->phy) {
ioc_err(ioc, "failure at %s:%d/%s()!\n",
__FILE__, __LINE__, __func__);
pinstance->res_entries =
kzalloc_objs(struct pmcraid_resource_entry,
- PMCRAID_MAX_RESOURCES, GFP_KERNEL);
+ PMCRAID_MAX_RESOURCES);
if (NULL == pinstance->res_entries) {
pmcraid_err("failed to allocate memory for resource table\n");
int ret = 0;
qedi->fp_array = kzalloc_objs(struct qedi_fastpath,
- MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL);
+ MIN_NUM_CPUS_MSIX(qedi));
if (!qedi->fp_array) {
QEDI_ERR(&qedi->dbg_ctx,
"fastpath fp array allocation failed.\n");
}
qedi->sb_array = kzalloc_objs(struct qed_sb_info,
- MIN_NUM_CPUS_MSIX(qedi), GFP_KERNEL);
+ MIN_NUM_CPUS_MSIX(qedi));
if (!qedi->sb_array) {
QEDI_ERR(&qedi->dbg_ctx,
"fastpath sb array allocation failed.\n");
return -ENOMEM;
qedi->cid_que.conn_cid_tbl = kmalloc_objs(struct qedi_conn *,
- qedi->max_active_conns,
- GFP_KERNEL);
+ qedi->max_active_conns);
if (!qedi->cid_que.conn_cid_tbl) {
kfree(qedi->cid_que.cid_que_base);
qedi->cid_que.cid_que_base = NULL;
static int qedi_alloc_itt(struct qedi_ctx *qedi)
{
qedi->itt_map = kzalloc_objs(struct qedi_itt_map,
- MAX_ISCSI_TASK_ENTRIES, GFP_KERNEL);
+ MAX_ISCSI_TASK_ENTRIES);
if (!qedi->itt_map) {
QEDI_ERR(&qedi->dbg_ctx,
"Unable to allocate itt map array memory\n");
*/
req->num_outstanding_cmds = MIN_OUTSTANDING_COMMANDS;
req->outstanding_cmds = kzalloc_objs(srb_t *,
- req->num_outstanding_cmds,
- GFP_KERNEL);
+ req->num_outstanding_cmds);
if (!req->outstanding_cmds) {
ql_log(ql_log_fatal, NULL, 0x0126,
if ((ql2xmqsupport || ql2xnvmeenable) && ha->max_qpairs) {
ha->queue_pair_map = kzalloc_objs(struct qla_qpair *,
- ha->max_qpairs, GFP_KERNEL);
+ ha->max_qpairs);
if (!ha->queue_pair_map) {
ql_log(ql_log_fatal, vha, 0x0180,
"Unable to allocate memory for queue pair ptrs.\n");
if (QLA_TGT_MODE_ENABLED() || EDIF_CAP(ha)) {
ha->vp_map = kzalloc_objs(struct qla_vp_map,
- MAX_MULTI_ID_FABRIC, GFP_KERNEL);
+ MAX_MULTI_ID_FABRIC);
if (!ha->vp_map)
goto fail;
}
/* Allocate memory for NVRAM data for vports */
if (ha->nvram_npiv_size) {
ha->npiv_info = kzalloc_objs(struct qla_npiv_entry,
- ha->nvram_npiv_size, GFP_KERNEL);
+ ha->nvram_npiv_size);
if (!ha->npiv_info) {
ql_log_pci(ql_log_fatal, ha->pdev, 0x002d,
"Failed to allocate memory for npiv_info.\n");
num_physicals = get_unaligned_be32(&rpl_8byte_wwid_list->header.list_length) / sizeof(rpl_8byte_wwid_list->lun_entries[0]);
rpl_16byte_wwid_list = kmalloc_flex(*rpl_16byte_wwid_list, lun_entries,
- num_physicals, GFP_KERNEL);
+ num_physicals);
if (!rpl_16byte_wwid_list) {
rc = -ENOMEM;
goto out_free_rpl_list;
struct pqi_io_request *io_request;
ctrl_info->io_request_pool = kzalloc_objs(ctrl_info->io_request_pool[0],
- ctrl_info->max_io_slots,
- GFP_KERNEL);
+ ctrl_info->max_io_slots);
if (!ctrl_info->io_request_pool) {
dev_err(&ctrl_info->pci_dev->dev,
int maxport, pn, nports = 0;
unsigned int m_port;
struct sdw_port_config *pconfig __free(kfree) = kzalloc_objs(*pconfig,
- ctrl->nports,
- GFP_KERNEL);
+ ctrl->nports);
if (!pconfig)
return -ENOMEM;
}
gbpsy->props_raw = kzalloc_objs(*gbpsy->props_raw,
- gbpsy->properties_count, GFP_KERNEL);
+ gbpsy->properties_count);
if (!gbpsy->props_raw) {
ret = -ENOMEM;
goto out_put_operation;
goto out;
supplies->supply = kzalloc_objs(struct gb_power_supply,
- supplies->supplies_count, GFP_KERNEL);
+ supplies->supplies_count);
if (!supplies->supply) {
ret = -ENOMEM;
/* Max num GPIOs we've seen plus a terminator */
int3472 = kzalloc_flex(*int3472, gpios.table,
- INT3472_MAX_SENSOR_GPIOS + 1, GFP_KERNEL);
+ INT3472_MAX_SENSOR_GPIOS + 1);
if (!int3472)
return -ENOMEM;
return err;
mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->yuv_scaler_binary) {
mycs->num_yuv_scaler = 0;
err = -ENOMEM;
return err;
}
mycs->is_output_stage = kzalloc_objs(bool,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->is_output_stage) {
err = -ENOMEM;
return err;
}
mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->yuv_scaler_binary) {
err = -ENOMEM;
IA_CSS_LEAVE_ERR_PRIVATE(err);
return err;
}
mycs->is_output_stage = kzalloc_objs(bool,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->is_output_stage) {
err = -ENOMEM;
IA_CSS_LEAVE_ERR_PRIVATE(err);
descr->num_stage = num_stages;
descr->in_info = kmalloc_objs(struct ia_css_frame_info,
- descr->num_stage, GFP_KERNEL);
+ descr->num_stage);
if (!descr->in_info) {
err = -ENOMEM;
goto ERR;
mycs->num_output = cas_scaler_descr.num_output_stage;
mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
mycs->yuv_scaler_binary = kzalloc_objs(struct ia_css_binary,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->yuv_scaler_binary) {
err = -ENOMEM;
goto ERR;
}
mycs->is_output_stage = kzalloc_objs(bool,
- cas_scaler_descr.num_stage,
- GFP_KERNEL);
+ cas_scaler_descr.num_stage);
if (!mycs->is_output_stage) {
err = -ENOMEM;
goto ERR;
/* +1 for ending QCOMTEE_ARG_TYPE_INV. */
struct qcomtee_arg *u __free(kfree) = kzalloc_objs(*u,
- arg->num_params + 1,
- GFP_KERNEL);
+ arg->num_params + 1);
if (!u)
return -ENOMEM;
unsigned int num_cpus = cpumask_weight(cpufreq_cdev->policy->related_cpus);
cpufreq_cdev->idle_time = kzalloc_objs(*cpufreq_cdev->idle_time,
- num_cpus, GFP_KERNEL);
+ num_cpus);
if (!cpufreq_cdev->idle_time)
return -ENOMEM;
if (priv->odvp_attrs == NULL) {
priv->odvp_attrs = kzalloc_objs(struct odvp_attr,
- priv->odvp_count, GFP_KERNEL);
+ priv->odvp_count);
if (!priv->odvp_attrs) {
ret = -ENOMEM;
goto out_err;
int34x_zone->aux_trip_nr = trip_cnt;
zone_trips = kzalloc_objs(*zone_trips,
- trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT,
- GFP_KERNEL);
+ trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT);
if (!zone_trips) {
ret = -ENOMEM;
goto err_trips_alloc;
return -EINVAL;
struct thermal_trip *trips __free(kfree) = kzalloc_objs(*trips,
- tt_zone->num_trips,
- GFP_KERNEL);
+ tt_zone->num_trips);
if (!trips)
return -ENOMEM;
if (num_channels) {
sunsab_ports = kzalloc_objs(struct uart_sunsab_port,
- num_channels, GFP_KERNEL);
+ num_channels);
if (!sunsab_ports)
return -ENOMEM;
if (!nlangs)
return NULL;
- gadget_strings = kzalloc_objs(struct usb_gadget_strings *, nlangs + 1,
- GFP_KERNEL)/* including NULL terminator */;
+ gadget_strings = kzalloc_objs(struct usb_gadget_strings *, nlangs + 1)/* including NULL terminator */;
if (!gadget_strings)
return ERR_PTR(-ENOMEM);
}
stringtab = kzalloc_objs(struct usb_string,
- language->nstrings + 1, GFP_KERNEL);
+ language->nstrings + 1);
if (!stringtab) {
us = ERR_PTR(-ENOMEM);
goto cleanup;
}
midi2->string_defs = kzalloc_objs(*midi2->string_defs,
- midi2->total_blocks + 1, GFP_KERNEL);
+ midi2->total_blocks + 1);
if (!midi2->string_defs) {
do_f_midi2_free(midi2, opts);
return ERR_PTR(-ENOMEM);
prm->srate = params->c_srates[0];
prm->reqs = kzalloc_objs(struct usb_request *,
- params->req_number, GFP_KERNEL);
+ params->req_number);
if (!prm->reqs) {
err = -ENOMEM;
goto fail;
prm->srate = params->p_srates[0];
prm->reqs = kzalloc_objs(struct usb_request *,
- params->req_number, GFP_KERNEL);
+ params->req_number);
if (!prm->reqs) {
err = -ENOMEM;
goto fail;
priv->hcd = hcd;
priv->atl_slots = kzalloc_objs(struct isp1760_slotinfo,
- mem_layout->slot_num, GFP_KERNEL);
+ mem_layout->slot_num);
if (!priv->atl_slots) {
ret = -ENOMEM;
goto put_hcd;
}
priv->int_slots = kzalloc_objs(struct isp1760_slotinfo,
- mem_layout->slot_num, GFP_KERNEL);
+ mem_layout->slot_num);
if (!priv->int_slots) {
ret = -ENOMEM;
goto free_atl_slots;
info->MS_Lib.BytesPerSector,
GFP_KERNEL);
info->MS_Lib.blkext = kmalloc_objs(struct ms_lib_type_extdat,
- info->MS_Lib.PagesPerBlock,
- GFP_KERNEL);
+ info->MS_Lib.PagesPerBlock);
if ((info->MS_Lib.blkpag == NULL) || (info->MS_Lib.blkext == NULL)) {
ms_lib_free_writebuf(us);
return;
ndev->irqp.entries = kzalloc_objs(*ndev->irqp.entries,
- ndev->mvdev.max_vqs, GFP_KERNEL);
+ ndev->mvdev.max_vqs);
if (!ndev->irqp.entries)
return;
goto err_iommu;
vdpasim->iommu_pt = kmalloc_objs(*vdpasim->iommu_pt,
- vdpasim->dev_attr.nas, GFP_KERNEL);
+ vdpasim->dev_attr.nas);
if (!vdpasim->iommu_pt)
goto err_iommu;
if (vs->inline_sg_cnt) {
tv_cmd->sgl = kzalloc_objs(struct scatterlist,
- vs->inline_sg_cnt,
- GFP_KERNEL);
+ vs->inline_sg_cnt);
if (!tv_cmd->sgl) {
pr_err("Unable to allocate tv_cmd->sgl\n");
goto out;
if (vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI) &&
vs->inline_sg_cnt) {
tv_cmd->prot_sgl = kzalloc_objs(struct scatterlist,
- vs->inline_sg_cnt,
- GFP_KERNEL);
+ vs->inline_sg_cnt);
if (!tv_cmd->prot_sgl) {
pr_err("Unable to allocate tv_cmd->prot_sgl\n");
goto out;
ne_cpu_pool.nr_parent_vm_cores = nr_cpu_ids / ne_cpu_pool.nr_threads_per_core;
ne_cpu_pool.avail_threads_per_core = kzalloc_objs(*ne_cpu_pool.avail_threads_per_core,
- ne_cpu_pool.nr_parent_vm_cores,
- GFP_KERNEL);
+ ne_cpu_pool.nr_parent_vm_cores);
if (!ne_cpu_pool.avail_threads_per_core) {
rc = -ENOMEM;
}
phys_contig_mem_regions.regions = kzalloc_objs(*phys_contig_mem_regions.regions,
- max_nr_pages, GFP_KERNEL);
+ max_nr_pages);
if (!phys_contig_mem_regions.regions) {
rc = -ENOMEM;
mutex_unlock(&ne_cpu_pool.mutex);
ne_enclave->threads_per_core = kzalloc_objs(*ne_enclave->threads_per_core,
- ne_enclave->nr_parent_vm_cores,
- GFP_KERNEL);
+ ne_enclave->nr_parent_vm_cores);
if (!ne_enclave->threads_per_core) {
rc = -ENOMEM;
xen_evtchn_cpu_prepare, xen_evtchn_cpu_dead);
evtchn_to_irq = kzalloc_objs(*evtchn_to_irq,
- EVTCHN_ROW(xen_evtchn_max_channels()),
- GFP_KERNEL);
+ EVTCHN_ROW(xen_evtchn_max_channels()));
BUG_ON(!evtchn_to_irq);
/* No event channels are 'live' right now. */
goto fail_no_free;
gntdev_dmabuf->u.imp.refs = kzalloc_objs(gntdev_dmabuf->u.imp.refs[0],
- count, GFP_KERNEL);
+ count);
if (!gntdev_dmabuf->u.imp.refs)
goto fail;
sizeof(struct acpi_processor_px));
dst_states = kzalloc_objs(struct xen_processor_px,
- _pr->performance->state_count, GFP_KERNEL);
+ _pr->performance->state_count);
if (!dst_states)
return ERR_PTR(-ENOMEM);
return -ENOMEM;
buf->backend_map_handles = kzalloc_objs(*buf->backend_map_handles,
- buf->num_pages, GFP_KERNEL);
+ buf->num_pages);
if (!buf->backend_map_handles) {
kfree(map_ops);
return -ENOMEM;
_debug("unmarshall FID array");
call->request = kzalloc_objs(struct afs_callback_break,
- call->count, GFP_KERNEL);
+ call->count);
if (!call->request)
return -ENOMEM;
_debug("unmarshall FID array");
call->request = kzalloc_objs(struct afs_callback_break,
- call->count, GFP_KERNEL);
+ call->count);
if (!call->request)
return -ENOMEM;
/* Need space for examining all the selected files */
if (op->nr_files > 2) {
op->more_files = kvzalloc_objs(struct afs_vnode_param,
- op->nr_files - 2, GFP_KERNEL);
+ op->nr_files - 2);
if (!op->more_files) {
afs_op_nomem(op);
goto out_op;
read_unlock(&op->volume->servers_lock);
op->server_states = kzalloc_objs(op->server_states[0],
- op->server_list->nr_servers,
- GFP_KERNEL);
+ op->server_list->nr_servers);
if (!op->server_states) {
afs_op_nomem(op);
trace_afs_rotate(op, afs_rotate_trace_nomem, 0);
cache.entries_size = PAGE_SIZE / sizeof(struct btrfs_fiemap_entry);
cache.entries = kmalloc_objs(struct btrfs_fiemap_entry,
- cache.entries_size, GFP_KERNEL);
+ cache.entries_size);
backref_ctx = btrfs_alloc_backref_share_check_ctx();
path = btrfs_alloc_path();
if (!cache.entries || !backref_ctx || !path) {
goto error;
stripe->sectors = kzalloc_objs(struct scrub_sector_verification,
- stripe->nr_sectors, GFP_KERNEL);
+ stripe->nr_sectors);
if (!stripe->sectors)
goto error;
ASSERT(sctx->raid56_data_stripes == NULL);
sctx->raid56_data_stripes = kzalloc_objs(struct scrub_stripe,
- nr_data_stripes(map),
- GFP_KERNEL);
+ nr_data_stripes(map));
if (!sctx->raid56_data_stripes) {
ret = -ENOMEM;
goto out;
}
send_buf_num_pages = sctx->send_max_size >> PAGE_SHIFT;
sctx->send_buf_pages = kzalloc_objs(*sctx->send_buf_pages,
- send_buf_num_pages,
- GFP_KERNEL);
+ send_buf_num_pages);
if (!sctx->send_buf_pages) {
ret = -ENOMEM;
goto out;
}
sctx->clone_roots = kvzalloc_objs(*sctx->clone_roots,
- arg->clone_sources_count + 1,
- GFP_KERNEL);
+ arg->clone_sources_count + 1);
if (!sctx->clone_roots) {
ret = -ENOMEM;
goto out;
}
cap_auths = kzalloc_objs(struct ceph_mds_cap_auth,
- cap_auths_num, GFP_KERNEL);
+ cap_auths_num);
if (!cap_auths) {
pr_err_client(cl, "No memory for cap_auths\n");
return;
if (z_erofs_rsv_nrpages) {
z_erofs_rsvbuf = &z_erofs_gbufpool[total - 1];
z_erofs_rsvbuf->pages = kzalloc_objs(*z_erofs_rsvbuf->pages,
- z_erofs_rsv_nrpages,
- GFP_KERNEL);
+ z_erofs_rsv_nrpages);
if (!z_erofs_rsvbuf->pages) {
z_erofs_rsvbuf = NULL;
z_erofs_rsv_nrpages = 0;
sbi->s_mb_nr_global_goals = umin(num_possible_cpus(),
DIV_ROUND_UP(sbi->s_groups_count, 4));
sbi->s_mb_last_groups = kzalloc_objs(ext4_group_t,
- sbi->s_mb_nr_global_goals,
- GFP_KERNEL);
+ sbi->s_mb_nr_global_goals);
if (sbi->s_mb_last_groups == NULL) {
ret = -ENOMEM;
goto out;
pcount = 1;
}
pages = kzalloc_objs(*pages,
- max_t(unsigned int, zisofs_pages_per_cblock, 1),
- GFP_KERNEL);
+ max_t(unsigned int, zisofs_pages_per_cblock, 1));
if (!pages) {
folio_unlock(folio);
return -ENOMEM;
c->inocache_hashsize = calculate_inocache_hashsize(c->flash_size);
c->inocache_list = kzalloc_objs(struct jffs2_inode_cache *,
- c->inocache_hashsize, GFP_KERNEL);
+ c->inocache_hashsize);
if (!c->inocache_list) {
ret = -ENOMEM;
goto out_wbuf;
if (unlikely(p == NULL))
goto out;
rc_list->rcl_refcalls = kmalloc_objs(*rc_list->rcl_refcalls,
- rc_list->rcl_nrefcalls,
- GFP_KERNEL);
+ rc_list->rcl_nrefcalls);
if (unlikely(rc_list->rcl_refcalls == NULL))
goto out;
for (i = 0; i < rc_list->rcl_nrefcalls; i++) {
args->csa_rclists = NULL;
if (args->csa_nrclists) {
args->csa_rclists = kmalloc_objs(*args->csa_rclists,
- args->csa_nrclists, GFP_KERNEL);
+ args->csa_nrclists);
if (unlikely(args->csa_rclists == NULL))
return htonl(NFS4ERR_RESOURCE);
delegation_buckets = roundup_pow_of_two(nfs_delegation_watermark / 16);
server->delegation_hash_mask = delegation_buckets - 1;
server->delegation_hash_table = kmalloc_objs(*server->delegation_hash_table,
- delegation_buckets,
- GFP_KERNEL);
+ delegation_buckets);
if (!server->delegation_hash_table)
return -ENOMEM;
for (i = 0; i < delegation_buckets; i++)
return 0;
fsloc->locations = kzalloc_objs(struct nfsd4_fs_location,
- fsloc->locations_count, GFP_KERNEL);
+ fsloc->locations_count);
if (!fsloc->locations)
return -ENOMEM;
for (i=0; i < fsloc->locations_count; i++) {
int i;
nn->reclaim_str_hashtbl = kmalloc_objs(struct list_head,
- CLIENT_HASH_SIZE, GFP_KERNEL);
+ CLIENT_HASH_SIZE);
if (!nn->reclaim_str_hashtbl)
return -ENOMEM;
int i;
nn->reclaim_str_hashtbl = kmalloc_objs(struct list_head,
- CLIENT_HASH_SIZE, GFP_KERNEL);
+ CLIENT_HASH_SIZE);
if (!nn->reclaim_str_hashtbl)
return -ENOMEM;
if (clp->cl_name.data == NULL)
goto err_no_name;
clp->cl_ownerstr_hashtbl = kmalloc_objs(struct list_head,
- OWNER_HASH_SIZE, GFP_KERNEL);
+ OWNER_HASH_SIZE);
if (!clp->cl_ownerstr_hashtbl)
goto err_no_hashtbl;
clp->cl_callback_wq = alloc_ordered_workqueue("nfsd4_callbacks", 0);
if (!nn->unconf_id_hashtbl)
goto err_unconf_id;
nn->sessionid_hashtbl = kmalloc_objs(struct list_head,
- SESSION_HASH_SIZE, GFP_KERNEL);
+ SESSION_HASH_SIZE);
if (!nn->sessionid_hashtbl)
goto err_sessionid;
/* allocate workspace instead of using stack VLA */
prz->ecc_info.par = kmalloc_objs(*prz->ecc_info.par,
- prz->ecc_info.ecc_size, GFP_KERNEL);
+ prz->ecc_info.ecc_size);
if (!prz->ecc_info.par) {
pr_err("cannot allocate ECC parity workspace\n");
return -ENOMEM;
}
mr->sgt.sgl = kzalloc_objs(struct scatterlist,
- sp->max_frmr_depth, GFP_KERNEL);
+ sp->max_frmr_depth);
if (!mr->sgt.sgl) {
ret = -ENOMEM;
log_rdma_mr(ERR, "failed to allocate sgl\n");
* if a 'large' file is read.
*/
msblk->meta_index = kzalloc_objs(*(msblk->meta_index),
- SQUASHFS_META_SLOTS,
- GFP_KERNEL);
+ SQUASHFS_META_SLOTS);
if (msblk->meta_index == NULL) {
ERROR("Failed to allocate meta_index\n");
goto failed;
data.size_part_descs = PART_DESC_ALLOC_STEP;
data.num_part_descs = 0;
data.part_descs_loc = kzalloc_objs(*data.part_descs_loc,
- data.size_part_descs, GFP_KERNEL);
+ data.size_part_descs);
if (!data.part_descs_loc)
return -ENOMEM;
}
used_maps_new = kmalloc_objs(used_maps_new[0],
- prog->aux->used_map_cnt + 1, GFP_KERNEL);
+ prog->aux->used_map_cnt + 1);
if (!used_maps_new) {
ret = -ENOMEM;
goto out_unlock;
bp_slots_histogram_alloc(struct bp_slots_histogram *hist, enum bp_type_idx type)
{
hist->count = kzalloc_objs(*hist->count,
- hw_breakpoint_slots_cached(type), GFP_KERNEL);
+ hw_breakpoint_slots_cached(type));
return hist->count;
}
ww_mutex_init(&torture_ww_mutex_2, &torture_ww_class);
ww_acquire_ctxs = kmalloc_objs(*ww_acquire_ctxs,
- cxt.nrealwriters_stress, GFP_KERNEL);
+ cxt.nrealwriters_stress);
if (!ww_acquire_ctxs)
VERBOSE_TOROUT_STRING("ww_acquire_ctx: Out of memory");
}
if (call_rcu_chains <= 0)
return 0;
call_rcu_chain_list = kzalloc_objs(*call_rcu_chain_list,
- call_rcu_chains, GFP_KERNEL);
+ call_rcu_chains);
if (!call_rcu_chain_list)
return -ENOMEM;
for (i = 0; i < call_rcu_chains; i++) {
if (nreaders_stress) {
cxt.lrsa = kmalloc_objs(*cxt.lrsa,
- cxt.nrealreaders_stress,
- GFP_KERNEL);
+ cxt.nrealreaders_stress);
if (cxt.lrsa == NULL) {
VERBOSE_TOROUT_STRING("cxt.lrsa: Out of memory");
firsterr = -ENOMEM;
if (nwriters_stress) {
writer_tasks = kzalloc_objs(writer_tasks[0],
- cxt.nrealwriters_stress, GFP_KERNEL);
+ cxt.nrealwriters_stress);
if (writer_tasks == NULL) {
TOROUT_ERRSTRING("writer_tasks: Out of memory");
firsterr = -ENOMEM;
if (cxt.cur_ops->readlock) {
reader_tasks = kzalloc_objs(reader_tasks[0],
- cxt.nrealreaders_stress, GFP_KERNEL);
+ cxt.nrealreaders_stress);
if (reader_tasks == NULL) {
TOROUT_ERRSTRING("reader_tasks: Out of memory");
kfree(writer_tasks);
kfree_by_call_rcu);
kfree_reader_tasks = kzalloc_objs(kfree_reader_tasks[0],
- kfree_nrealthreads, GFP_KERNEL);
+ kfree_nrealthreads);
if (kfree_reader_tasks == NULL) {
firsterr = -ENOMEM;
goto unwind;
goto unwind;
}
writer_freelists = kzalloc_objs(writer_freelists[0],
- nrealwriters, GFP_KERNEL);
+ nrealwriters);
}
if (!writer_tasks || !writer_durations || !writer_n_durations || !writer_done ||
(gp_async && !writer_freelists)) {
init_llist_head(&wflp->ws_lhg);
init_llist_head(&wflp->ws_lhp);
wflp->ws_mblocks = kzalloc_objs(wflp->ws_mblocks[0],
- gp_async_max,
- GFP_KERNEL);
+ gp_async_max);
if (!wflp->ws_mblocks) {
firsterr = -ENOMEM;
goto unwind;
rcu_torture_write_types();
if (nrealfakewriters > 0) {
fakewriter_tasks = kzalloc_objs(fakewriter_tasks[0],
- nrealfakewriters, GFP_KERNEL);
+ nrealfakewriters);
if (fakewriter_tasks == NULL) {
TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
}
reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders);
rcu_torture_reader_mbchk = kzalloc_objs(*rcu_torture_reader_mbchk,
- nrealreaders, GFP_KERNEL);
+ nrealreaders);
if (!reader_tasks || !rcu_torture_reader_mbchk) {
TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
lim = rcu_task_enqueue_lim;
rtp->rtpcp_array = kzalloc_objs(struct rcu_tasks_percpu *,
- num_possible_cpus(), GFP_KERNEL);
+ num_possible_cpus());
BUG_ON(!rtp->rtpcp_array);
for_each_possible_cpu(cpu) {
/* Allocate per-node idle cpumasks */
scx_idle_node_masks = kzalloc_objs(*scx_idle_node_masks,
- num_possible_nodes(), GFP_KERNEL);
+ num_possible_nodes());
BUG_ON(!scx_idle_node_masks);
for_each_node(i) {
tmigr_crossnode_level = cpulvl;
tmigr_level_list = kzalloc_objs(struct list_head,
- tmigr_hierarchy_levels, GFP_KERNEL);
+ tmigr_hierarchy_levels);
if (!tmigr_level_list)
goto err;
if (n_dynamic_fields) {
event->dynamic_fields = kzalloc_objs(*event->dynamic_fields,
- n_dynamic_fields,
- GFP_KERNEL);
+ n_dynamic_fields);
if (!event->dynamic_fields) {
free_synth_event(event);
event = ERR_PTR(-ENOMEM);
if (!IS_ENABLED(CONFIG_HAVE_SPARSE_SYSCALL_NR)) {
syscalls_metadata = kzalloc_objs(*syscalls_metadata,
- NR_syscalls, GFP_KERNEL);
+ NR_syscalls);
if (!syscalls_metadata) {
WARN_ON(1);
return;
/* Allocate memory for 340 mappings. */
forward = kmalloc_objs(struct uid_gid_extent,
- UID_GID_MAP_MAX_EXTENTS, GFP_KERNEL);
+ UID_GID_MAP_MAX_EXTENTS);
if (!forward)
return -ENOMEM;
int i;
objagg_stats = kzalloc_flex(*objagg_stats, stats_info,
- objagg->obj_count, GFP_KERNEL);
+ objagg->obj_count);
if (!objagg_stats)
return ERR_PTR(-ENOMEM);
int i;
objagg_stats = kzalloc_flex(*objagg_stats, stats_info,
- objagg_hints->node_count, GFP_KERNEL);
+ objagg_hints->node_count);
if (!objagg_stats)
return ERR_PTR(-ENOMEM);
damon_for_each_target(t, c) {
/* there is only one target */
region_pointers = kmalloc_objs(*region_pointers,
- damon_nr_regions(t), GFP_KERNEL);
+ damon_nr_regions(t));
if (!region_pointers)
return -ENOMEM;
damon_for_each_region(r, t) {
kunit_skip(test, "sysfs_targets alloc fail");
sysfs_targets->nr = 1;
sysfs_targets->targets_arr = kmalloc_objs(*sysfs_targets->targets_arr,
- 1, GFP_KERNEL);
+ 1);
if (!sysfs_targets->targets_arr) {
kfree(sysfs_targets);
kunit_skip(test, "targets_arr alloc fail");
}
cfg->src_entries = kzalloc_objs(struct br_mdb_src_entry,
- cfg->num_src_entries, GFP_KERNEL);
+ cfg->num_src_entries);
if (!cfg->src_entries)
return -ENOMEM;
if (direction == DMA_TO_DEVICE) {
binding->tx_vec = kvmalloc_objs(struct net_iov *,
- dmabuf->size / PAGE_SIZE,
- GFP_KERNEL);
+ dmabuf->size / PAGE_SIZE);
if (!binding->tx_vec) {
err = -ENOMEM;
goto err_unmap;
}
owner->area.niovs = kvmalloc_objs(*owner->area.niovs,
- owner->area.num_niovs,
- GFP_KERNEL);
+ owner->area.num_niovs);
if (!owner->area.niovs) {
err = -ENOMEM;
goto err_free_chunks;
u32 iter;
cipso_v4_cache = kzalloc_objs(struct cipso_v4_map_cache_bkt,
- CIPSO_V4_CACHE_BUCKETS, GFP_KERNEL);
+ CIPSO_V4_CACHE_BUCKETS);
if (!cipso_v4_cache)
return -ENOMEM;
err = -ENOMEM;
net->ipv4.inet_addr_lst = kmalloc_objs(struct hlist_head,
- IN4_ADDR_HSIZE, GFP_KERNEL);
+ IN4_ADDR_HSIZE);
if (!net->ipv4.inet_addr_lst)
goto err_alloc_hash;
info->id = nh->id;
info->type = NH_NOTIFIER_INFO_TYPE_GRP_HW_STATS;
info->nh_grp_hw_stats = kzalloc_flex(*info->nh_grp_hw_stats, stats,
- nhg->num_nh, GFP_KERNEL);
+ nhg->num_nh);
if (!info->nh_grp_hw_stats)
return -ENOMEM;
for (i = 0; i < n_tables; i++) {
utn->entries[i] = kzalloc_objs(*utn->entries[i],
- info->tables[i].n_entries,
- GFP_KERNEL);
+ info->tables[i].n_entries);
if (!utn->entries[i])
goto err_free_prev_entries;
}
spin_lock_init(&net->ipv6.addrconf_hash_lock);
INIT_DEFERRABLE_WORK(&net->ipv6.addr_chk_work, addrconf_verify_work);
net->ipv6.inet6_addr_lst = kzalloc_objs(struct hlist_head,
- IN6_ADDR_HSIZE, GFP_KERNEL);
+ IN6_ADDR_HSIZE);
if (!net->ipv6.inet6_addr_lst)
goto err_alloc_addr;
u32 iter;
calipso_cache = kzalloc_objs(struct calipso_map_cache_bkt,
- CALIPSO_CACHE_BUCKETS, GFP_KERNEL);
+ CALIPSO_CACHE_BUCKETS);
if (!calipso_cache)
return -ENOMEM;
if (beacon->mbssid_ies && beacon->mbssid_ies->cnt) {
new_beacon->mbssid_ies =
kzalloc_flex(*new_beacon->mbssid_ies, elem,
- beacon->mbssid_ies->cnt, GFP_KERNEL);
+ beacon->mbssid_ies->cnt);
if (!new_beacon->mbssid_ies) {
kfree(new_beacon);
return NULL;
if (beacon->rnr_ies && beacon->rnr_ies->cnt) {
new_beacon->rnr_ies =
kzalloc_flex(*new_beacon->rnr_ies, elem,
- beacon->rnr_ies->cnt, GFP_KERNEL);
+ beacon->rnr_ies->cnt);
if (!new_beacon->rnr_ies) {
kfree(new_beacon->mbssid_ies);
kfree(new_beacon);
local->int_scan_req = kzalloc_flex(*local->int_scan_req, channels,
- channels, GFP_KERNEL);
+ channels);
if (!local->int_scan_req)
return -ENOMEM;
if (svc->num_dests >= 1) {
s->dest_setup = kzalloc_objs(struct ip_vs_mh_dest_setup,
- svc->num_dests, GFP_KERNEL);
+ svc->num_dests);
if (!s->dest_setup)
return -ENOMEM;
}
size = 0;
if (nla[NFTA_RULE_EXPRESSIONS]) {
expr_info = kvmalloc_objs(struct nft_expr_info,
- NFT_RULE_MAXEXPRS, GFP_KERNEL);
+ NFT_RULE_MAXEXPRS);
if (!expr_info)
return -ENOMEM;
return -EOVERFLOW;
expect_policy = kzalloc_objs(struct nf_conntrack_expect_policy,
- class_max, GFP_KERNEL);
+ class_max);
if (expect_policy == NULL)
return -ENOMEM;
q->num_direct_qdiscs = dev->real_num_tx_queues;
q->direct_qdiscs = kzalloc_objs(*q->direct_qdiscs,
- q->num_direct_qdiscs,
- GFP_KERNEL);
+ q->num_direct_qdiscs);
if (!q->direct_qdiscs)
return -ENOMEM;
}
if (!link->wr_rx_ibs)
goto no_mem_wr_tx_ibs;
link->wr_tx_rdmas = kzalloc_objs(link->wr_tx_rdmas[0],
- link->max_send_wr, GFP_KERNEL);
+ link->max_send_wr);
if (!link->wr_tx_rdmas)
goto no_mem_wr_rx_ibs;
link->wr_tx_rdma_sges = kzalloc_objs(link->wr_tx_rdma_sges[0],
- link->max_send_wr, GFP_KERNEL);
+ link->max_send_wr);
if (!link->wr_tx_rdma_sges)
goto no_mem_wr_tx_rdmas;
link->wr_tx_sges = kzalloc_objs(link->wr_tx_sges[0], link->max_send_wr);
if (!link->wr_tx_mask)
goto no_mem_wr_rx_sges;
link->wr_tx_pends = kzalloc_objs(link->wr_tx_pends[0],
- link->max_send_wr, GFP_KERNEL);
+ link->max_send_wr);
if (!link->wr_tx_pends)
goto no_mem_wr_tx_mask;
link->wr_tx_compl = kzalloc_objs(link->wr_tx_compl[0],
- link->max_send_wr, GFP_KERNEL);
+ link->max_send_wr);
if (!link->wr_tx_compl)
goto no_mem_wr_tx_pends;
goto err_proc;
net->unx.table.buckets = kvmalloc_objs(struct hlist_head,
- UNIX_HASH_SIZE, GFP_KERNEL);
+ UNIX_HASH_SIZE);
if (!net->unx.table.buckets)
goto free_locks;
int idx;
wiphy->radio_cfg = kzalloc_objs(*wiphy->radio_cfg,
- wiphy->n_radio, GFP_KERNEL);
+ wiphy->n_radio);
if (!wiphy->radio_cfg)
return -ENOMEM;
/*
if (n_thresholds) {
cqm_config = kzalloc_flex(*cqm_config, rssi_thresholds,
- n_thresholds, GFP_KERNEL);
+ n_thresholds);
if (!cqm_config)
return -ENOMEM;
return -EINVAL;
new_triggers.patterns = kzalloc_objs(new_triggers.patterns[0],
- n_patterns, GFP_KERNEL);
+ n_patterns);
if (!new_triggers.patterns)
return -ENOMEM;
}
pool->dma_pages = kvzalloc_objs(*pool->dma_pages,
- dma_map->dma_pages_cnt, GFP_KERNEL);
+ dma_map->dma_pages_cnt);
if (!pool->dma_pages)
return -ENOMEM;
/* saved array is for saving 1..N seq nums from wantseq */
if (xc->reorder_win_size) {
xtfs->w_saved = kzalloc_objs(*xtfs->w_saved,
- xc->reorder_win_size, GFP_KERNEL);
+ xc->reorder_win_size);
if (!xtfs->w_saved) {
NL_SET_ERR_MSG(extack, "Cannot alloc reorder window");
return -ENOMEM;
xtfs->ra_newskb = NULL;
if (xtfs->cfg.reorder_win_size) {
xtfs->w_saved = kzalloc_objs(*xtfs->w_saved,
- xtfs->cfg.reorder_win_size,
- GFP_KERNEL);
+ xtfs->cfg.reorder_win_size);
if (!xtfs->w_saved) {
kfree_sensitive(xtfs);
return -ENOMEM;
ima_hash_algo_idx = NR_BANKS(ima_tpm_chip) + ima_extra_slots++;
ima_algo_array = kzalloc_objs(*ima_algo_array,
- NR_BANKS(ima_tpm_chip) + ima_extra_slots,
- GFP_KERNEL);
+ NR_BANKS(ima_tpm_chip) + ima_extra_slots);
if (!ima_algo_array) {
rc = -ENOMEM;
goto out;
{
kfree(p->bool_val_to_struct);
p->bool_val_to_struct = kmalloc_objs(*p->bool_val_to_struct,
- p->p_bools.nprim, GFP_KERNEL);
+ p->p_bools.nprim);
if (!p->bool_val_to_struct)
return -ENOMEM;
int rc;
cond_bool_array = kmalloc_objs(*orig->bool_val_to_struct,
- orig->p_bools.nprim, GFP_KERNEL);
+ orig->p_bools.nprim);
if (!cond_bool_array)
return -ENOMEM;
symtab_hash_eval(p->symtab);
p->class_val_to_struct = kzalloc_objs(*p->class_val_to_struct,
- p->p_classes.nprim, GFP_KERNEL);
+ p->p_classes.nprim);
if (!p->class_val_to_struct)
return -ENOMEM;
p->role_val_to_struct = kzalloc_objs(*p->role_val_to_struct,
- p->p_roles.nprim, GFP_KERNEL);
+ p->p_roles.nprim);
if (!p->role_val_to_struct)
return -ENOMEM;
p->user_val_to_struct = kzalloc_objs(*p->user_val_to_struct,
- p->p_users.nprim, GFP_KERNEL);
+ p->p_users.nprim);
if (!p->user_val_to_struct)
return -ENOMEM;
p->type_val_to_struct = kvzalloc_objs(*p->type_val_to_struct,
- p->p_types.nprim, GFP_KERNEL);
+ p->p_types.nprim);
if (!p->type_val_to_struct)
return -ENOMEM;
rc = -ENOMEM;
p->type_attr_map_array = kvzalloc_objs(*p->type_attr_map_array,
- p->p_types.nprim, GFP_KERNEL);
+ p->p_types.nprim);
if (!p->type_attr_map_array)
goto bad;
info->nr_voices = rec->nr_voices;
if (info->nr_voices > 0) {
info->ch = kzalloc_objs(struct seq_oss_chinfo,
- info->nr_voices, GFP_KERNEL);
+ info->nr_voices);
if (!info->ch) {
rec->oper.close(&info->arg);
module_put(rec->oper.owner);
queue_size * 3 / 2);
s->ctx_data.tx.cache.pos = 0;
s->ctx_data.tx.cache.descs = kzalloc_objs(*s->ctx_data.tx.cache.descs,
- s->ctx_data.tx.cache.size,
- GFP_KERNEL);
+ s->ctx_data.tx.cache.size);
if (!s->ctx_data.tx.cache.descs) {
err = -ENOMEM;
goto err_context;
};
s->ctx_data.rx.seq.descs = kzalloc_objs(*s->ctx_data.rx.seq.descs,
- queue_size, GFP_KERNEL);
+ queue_size);
if (!s->ctx_data.rx.seq.descs) {
err = -ENOMEM;
goto err_context;
goto __err_gpr;
controls = kzalloc_objs(struct snd_emu10k1_fx8010_control_gpr,
- SND_EMU10K1_GPR_CONTROLS, GFP_KERNEL);
+ SND_EMU10K1_GPR_CONTROLS);
if (!controls)
goto __err_ctrls;
config_offset += 4;
bk_da = cfg_info->blk_data = kzalloc_objs(struct pcmdevice_block_data *,
- cfg_info->nblocks, GFP_KERNEL);
+ cfg_info->nblocks);
if (!bk_da) {
*status = -ENOMEM;
goto out;
* these firmwares.
*/
bk_da = cfg_info->blk_data = kzalloc_objs(struct tasdev_blk_data *,
- cfg_info->nblocks, GFP_KERNEL);
+ cfg_info->nblocks);
if (!bk_da) {
*status = -ENOMEM;
goto out;
}
tas_fmw->programs = kzalloc_objs(struct tasdevice_prog,
- tas_fmw->nr_programs, GFP_KERNEL);
+ tas_fmw->nr_programs);
if (!tas_fmw->programs) {
offset = -ENOMEM;
goto out;
}
tas_fmw->configs = kzalloc_objs(struct tasdevice_config,
- tas_fmw->nr_configurations, GFP_KERNEL);
+ tas_fmw->nr_configurations);
if (!tas_fmw->configs) {
offset = -ENOMEM;
goto out;
goto out;
}
tas_fmw->configs = kzalloc_objs(struct tasdevice_config,
- tas_fmw->nr_configurations, GFP_KERNEL);
+ tas_fmw->nr_configurations);
if (!tas_fmw->configs) {
offset = -ENOMEM;
goto out;
}
tas_fmw->calibrations = kzalloc_objs(struct tasdevice_calibration,
- tas_fmw->nr_calibrations,
- GFP_KERNEL);
+ tas_fmw->nr_calibrations);
if (!tas_fmw->calibrations) {
offset = -ENOMEM;
goto out;
struct audioreach_module_priv_data *pdata;
pdata = kzalloc_flex(*pdata, data,
- le32_to_cpu(mod_array->size),
- GFP_KERNEL);
+ le32_to_cpu(mod_array->size));
if (!pdata)
return ERR_PTR(-ENOMEM);
if (w->num_kcontrols) {
w->kcontrols = kzalloc_objs(struct snd_kcontrol *,
- w->num_kcontrols,
- GFP_KERNEL);
+ w->num_kcontrols);
if (!w->kcontrols) {
snd_soc_dapm_mutex_unlock(card);
return -ENOMEM;
/* allocate memory for the pipeline data */
trigger_list = kzalloc_flex(*trigger_list, pipeline_instance_ids,
- pipeline_list->count, GFP_KERNEL);
+ pipeline_list->count);
if (!trigger_list)
return -ENOMEM;
/* allocate memory for max number of pipeline IDs */
pipeline_list->pipelines = kzalloc_objs(*pipeline_list->pipelines,
- ipc4_data->max_num_pipelines,
- GFP_KERNEL);
+ ipc4_data->max_num_pipelines);
if (!pipeline_list->pipelines) {
sof_ipc4_pcm_free(sdev, spcm);
return -ENOMEM;
if (available_fmt->num_input_formats) {
in_format = kzalloc_objs(*in_format,
- available_fmt->num_input_formats,
- GFP_KERNEL);
+ available_fmt->num_input_formats);
if (!in_format)
return -ENOMEM;
available_fmt->input_pin_fmts = in_format;
if (available_fmt->num_output_formats) {
out_format = kzalloc_objs(*out_format,
- available_fmt->num_output_formats,
- GFP_KERNEL);
+ available_fmt->num_output_formats);
if (!out_format) {
ret = -ENOMEM;
goto err_in;
{
int i;
p->effect = kzalloc_objs(struct snd_emux_effect_table,
- p->chset.max_channels, GFP_KERNEL);
+ p->chset.max_channels);
if (p->effect) {
for (i = 0; i < p->chset.max_channels; i++)
p->chset.channels[i].private = p->effect + i;
uadev[card_num].num_intf =
subs->dev->config->desc.bNumInterfaces;
uadev[card_num].info = kzalloc_objs(struct intf_info,
- uadev[card_num].num_intf,
- GFP_KERNEL);
+ uadev[card_num].num_intf);
if (!uadev[card_num].info) {
ret = -ENOMEM;
goto unmap_er;
front_info->evt_pairs =
kzalloc_objs(struct xen_snd_front_evtchnl_pair,
- num_streams, GFP_KERNEL);
+ num_streams);
if (!front_info->evt_pairs)
return -ENOMEM;