All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/iio: Use correct argument for sizeof
Date: Tue, 22 Jan 2013 11:58:14 +0000	[thread overview]
Message-ID: <50FE7ED6.8070505@kernel.org> (raw)
In-Reply-To: <1358802842-27614-1-git-send-email-peterhuewe@gmx.de>

On 01/21/2013 09:14 PM, Peter Huewe wrote:
> found with coccicheck
> sizeof when applied to a pointer typed expression gives the size of
> the pointer
> 
> The semantic patch that makes this output is available
> in scripts/coccinelle/misc/noderef.cocci.
> 
> More information about semantic patching is available at
> http://coccinelle.lip6.fr/
> 
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Added to togreg branch of iio.git

Thanks,
> ---
>  drivers/staging/iio/iio_hwmon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/iio/iio_hwmon.c b/drivers/staging/iio/iio_hwmon.c
> index c7a5f97..97ad645 100644
> --- a/drivers/staging/iio/iio_hwmon.c
> +++ b/drivers/staging/iio/iio_hwmon.c
> @@ -93,7 +93,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
>  	while (st->channels[st->num_channels].indio_dev)
>  		st->num_channels++;
>  
> -	st->attrs = kzalloc(sizeof(st->attrs) * (st->num_channels + 1),
> +	st->attrs = kzalloc(sizeof(*st->attrs) * (st->num_channels + 1),
>  			    GFP_KERNEL);
>  	if (st->attrs == NULL) {
>  		ret = -ENOMEM;
> 

      parent reply	other threads:[~2013-01-22 11:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 21:14 [PATCH] staging/iio: Use correct argument for sizeof Peter Huewe
2013-01-22  6:43 ` Dan Carpenter
2013-01-22  7:02   ` Dan Carpenter
2013-01-22  8:02   ` Lars-Peter Clausen
2013-01-22  8:05     ` Dan Carpenter
2013-01-22 11:58 ` Jonathan Cameron [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=50FE7ED6.8070505@kernel.org \
    --to=jic23@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.