Re: [PATCH 03/11] pstore/ram: Factor dmesg przs initialization outof probe()

From: Stephen Boyd
Date: Tue May 29 2012 - 03:32:08 EST


On 5/26/2012 6:20 AM, Anton Vorontsov wrote:
> +static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
> + phys_addr_t *paddr, size_t dump_mem_sz)
> +{
> + int err = -ENOMEM;
> + int i;
> +
> + if (!cxt->record_size)
> + return 0;
> +
> + cxt->max_dump_cnt = dump_mem_sz / cxt->record_size;
> + if (!cxt->max_dump_cnt)
> + return -ENOMEM;
> +
> + cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_dump_cnt,
> + GFP_KERNEL);

kcalloc would be better but I see you're just moving code here so it
doesn't need to be changed in this patch.

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/