mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Chase Southwood <chase.southwood@gmail.com>, gregkh@linuxfoundation.org
Cc: hsweeten@visionengravers.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: comedi: das1800: prefer kmalloc_array over kmalloc with multiply
Date: Tue, 20 Jan 2015 11:04:04 +0000	[thread overview]
Message-ID: <54BE3624.5060302@mev.co.uk> (raw)
In-Reply-To: <1421721769-28482-1-git-send-email-chase.southwood@gmail.com>

On 20/01/15 02:42, Chase Southwood wrote:
> Checkpatch doesn't like kmalloc with multiply very much:
> drivers/staging/comedi/drivers/das1800.c:1377: WARNING: Prefer kmalloc_array over kmalloc with multiply
>
> So this patch swaps that use out for kmalloc_array instead.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> ---
>   drivers/staging/comedi/drivers/das1800.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
> index 381ae94..13ed31c 100644
> --- a/drivers/staging/comedi/drivers/das1800.c
> +++ b/drivers/staging/comedi/drivers/das1800.c
> @@ -1374,7 +1374,7 @@ static int das1800_attach(struct comedi_device *dev,
>   	if (dev->irq & it->options[2])
>   		das1800_init_dma(dev, it);
>
> -	devpriv->fifo_buf = kmalloc(FIFO_SIZE * sizeof(uint16_t), GFP_KERNEL);
> +	devpriv->fifo_buf = kmalloc_array(FIFO_SIZE, sizeof(uint16_t), GFP_KERNEL);
>   	if (!devpriv->fifo_buf)
>   		return -ENOMEM;
>
>

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

      reply	other threads:[~2015-01-20 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  2:42 Chase Southwood
2015-01-20 11:04 ` Ian Abbott [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BE3624.5060302@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=chase.southwood@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome