lkml.org 
[lkml]   [2016]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-sunxi] [RFC PATCH 1/5] mailbox: introduce ARM SMC based mailbox
Hello

Just a minor comment below

> +static int smc_mbox_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct mbox_controller *mbox;
> + int ret = 0;
> + int i;
> +
> + ret = of_property_count_elems_of_size(dev->of_node, "identifiers",
> + sizeof(u32));
> + if (ret < 0)
> + return ret;
> +
> + mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> + if (mbox == NULL)
> + return -ENOMEM;

checkpatch prefer !mbox

> +
> + mbox->num_chans = ret;
> + mbox->chans = devm_kmalloc_array(dev, mbox->num_chans,
> + sizeof(*mbox->chans),
> + GFP_KERNEL | __GFP_ZERO);

devm_kcalloc seems to do the same

Regards

LABBE Corentin

\
 
 \ /
  Last update: 2016-08-10 21:01    [W:0.087 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site