- Subject: Re: [PATCH 03/11] pstore/ram: Factor dmesg przs initialization out of probe()
- From: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
- Date: Tue, 29 May 2012 00:32:08 -0700
- Cc: devel@xxxxxxxxxxxxxxxxxxxx, Tony Luck <tony.luck@xxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, patches@xxxxxxxxxx, Marco Stornelli <marco.stornelli@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, arve@xxxxxxxxxxx, Jesper Juhl <jj@xxxxxxxxxxxxx>, John Stultz <john.stultz@xxxxxxxxxx>, Shuah Khan <shuahkhan@xxxxxxxxx>, Colin Cross <ccross@xxxxxxxxxxx>, Rebecca Schultz Zavin <rebecca@xxxxxxxxxxx>, WANG Cong <xiyou.wangcong@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, kernel-team@xxxxxxxxxxx, linaro-kernel@xxxxxxxxxxxxxxxx, Thomas Meyer <thomas@xxxxxxxx>
- Delivered-to: devel@xxxxxxxxxxxxxxxxxxxx
- In-reply-to: <1338038429-21945-3-git-send-email-anton.vorontsov@linaro.org>
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
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.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
[Video for Linux]
[Mplayer Users]
[Linux USB Devel]
[Linux Audio Users]
[Photos]
[Yosemite Photos]
[Free Singles Community]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Devices]
[Yosemite Backpacking]