From: Jonathan Cameron <jic23@cam.ac.uk>
To: michael.hennerich@analog.com
Cc: linux-iio@vger.kernel.org, drivers@analog.com,
device-drivers-devel@blackfin.uclinux.org
Subject: Re: [PATCH] IIO: Documentation: iio_utils: Fix typo
Date: Tue, 22 Feb 2011 19:11:12 +0000 [thread overview]
Message-ID: <4D640A50.9020700@cam.ac.uk> (raw)
In-Reply-To: <1297781180-5071-3-git-send-email-michael.hennerich@analog.com>
On 02/15/11 14:46, michael.hennerich@analog.com wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
>
>
It's not an actual bug, but your version is certainly easier to read,
hence the ack. Not worth pushing to stable though and might want to have
a description that makes it clear that it is for readability.
Thanks to helpful denizen of another list for providing the following
succinct argument. As he put it when I queried a**b...
Reference: http://www.cs.man.ac.uk/~pjj/bnf/c_syntax.bnf
There's no "**" token, so "a**d" has to be parsed as "a" "*" "*" "d".
And there's no postfix "*" operator, so "a" "*" ... can only be a
mult_exp. Given it's a mult_exp, the "*" "d" is parsed as a cast_exp,
which inevitably means treating it as a unary_exp consisting of a
unary_operator ("*") followed by an id which, all by itself, qualifies
as a primary_exp, a postfix_exp, a unary_exp and a cast_exp, and is
therefore legal as the rhs of a multi_exp.
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
> drivers/staging/iio/Documentation/iio_utils.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h
> index 3cf01a5..4b023aa 100644
> --- a/drivers/staging/iio/Documentation/iio_utils.h
> +++ b/drivers/staging/iio/Documentation/iio_utils.h
> @@ -374,7 +374,7 @@ inline int build_channel_array(const char *device_dir,
> }
> }
> /* reorder so that the array is in index order*/
> - current = malloc(sizeof(**ci_array)**counter);
> + current = malloc(sizeof(**ci_array)*(*counter));
> if (current == NULL) {
> ret = -ENOMEM;
> goto error_cleanup_array;
next prev parent reply other threads:[~2011-02-22 19:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 14:46 [PATCH] IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference michael.hennerich
2011-02-15 14:46 ` [PATCH] IIO: Documentation: iio_utils: Avoid double free() michael.hennerich
2011-02-22 15:09 ` Jonathan Cameron
2011-02-15 14:46 ` [PATCH] IIO: Documentation: iio_utils: Fix typo michael.hennerich
2011-02-22 19:11 ` Jonathan Cameron [this message]
2011-02-15 14:46 ` [PATCH] IIO: Documentation: generic_buffer example: scan_size must be bytes_per_datum michael.hennerich
2011-02-22 18:48 ` Jonathan Cameron
2011-02-22 20:21 ` Michael Hennerich
2011-02-22 20:45 ` Jonathan Cameron
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=4D640A50.9020700@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=drivers@analog.com \
--cc=linux-iio@vger.kernel.org \
--cc=michael.hennerich@analog.com \
/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