lkml.org 
[lkml]   [2012]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 03/11] pstore/ram: Factor dmesg przs initialization out of probe()
    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.



    \
     
     \ /
      Last update: 2012-05-29 10:01    [W:0.023 / U:0.556 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site