All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Alison Schofield <amsfield22@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 2/3] staging: iio: dummy: add the timestamp buffer to the scan index enum
Date: Tue, 27 Oct 2015 14:48:58 +0900	[thread overview]
Message-ID: <20151027054858.GA4490@kroah.com> (raw)
In-Reply-To: <9ba0ccaa230b9f32a76b8b5437d2cde8246ab69c.1445891339.git.amsfield22@gmail.com>

On Mon, Oct 26, 2015 at 01:49:35PM -0700, Alison Schofield wrote:
> Replace the hard coded buffer index for IIO_CHAN SOFT_TIMESTAMP with
> an entry in the scan index enum.
> 
> Signed-off-by: Alison Schofield <amsfield22@gmail.com>
> ---
>  drivers/staging/iio/iio_simple_dummy.c        | 6 +++---
>  drivers/staging/iio/iio_simple_dummy.h        | 2 ++
>  drivers/staging/iio/iio_simple_dummy_buffer.c | 1 +
>  3 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c
> index 70a82cd..2749746 100644
> --- a/drivers/staging/iio/iio_simple_dummy.c
> +++ b/drivers/staging/iio/iio_simple_dummy.c
> @@ -230,10 +230,10 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
>  		},
>  	},
>  	/*
> -	 * Convenience macro for timestamps. 4 is the index in
> -	 * the buffer.
> +	 * Convenience macro for timestamps.
> +	 * DUMMY_INDEX_TIMESTAMP is the index in the buffer.
>  	 */
> -	IIO_CHAN_SOFT_TIMESTAMP(4),
> +	IIO_CHAN_SOFT_TIMESTAMP(DUMMY_INDEX_TIMESTAMP),
>  	/* DAC channel out_voltage0_raw */
>  	{
>  		.type = IIO_VOLTAGE,
> diff --git a/drivers/staging/iio/iio_simple_dummy.h b/drivers/staging/iio/iio_simple_dummy.h
> index b9069a1..89fb650 100644
> --- a/drivers/staging/iio/iio_simple_dummy.h
> +++ b/drivers/staging/iio/iio_simple_dummy.h
> @@ -102,6 +102,7 @@ iio_simple_dummy_events_unregister(struct iio_dev *indio_dev)
>   * @DUMMY_INDEX_DIFFVOLTAGE_1M2:   first differential channel
>   * @DUMMY_INDEX_DIFFVOLTAGE_3M4:   second differential channel
>   * @DUMMY_INDEX_ACCELX:            acceleration channel
> + * @DUMMY_INDEX_TIMESTAMP:         timestamp channel
>   *
>   * Enum provides convenient numbering for the scan index.
>   */
> @@ -110,6 +111,7 @@ enum iio_simple_dummy_scan_elements {
>  	DUMMY_INDEX_DIFFVOLTAGE_1M2,
>  	DUMMY_INDEX_DIFFVOLTAGE_3M4,
>  	DUMMY_INDEX_ACCELX,
> +	DUMMY_INDEX_TIMESTAMP,
>  };
>  
>  #ifdef CONFIG_IIO_SIMPLE_DUMMY_BUFFER
> diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c
> index cf44a6f..eea3e76 100644
> --- a/drivers/staging/iio/iio_simple_dummy_buffer.c
> +++ b/drivers/staging/iio/iio_simple_dummy_buffer.c
> @@ -31,6 +31,7 @@ static const s16 fakedata[] = {
>  	[DUMMY_INDEX_DIFFVOLTAGE_1M2] = -33,
>  	[DUMMY_INDEX_DIFFVOLTAGE_3M4] = -2,
>  	[DUMMY_INDEX_ACCELX] = 344,
> +	[DUMMY_INDEX_TIMESTAMP] = 50,

You just increased the size of this structure, why?



  reply	other threads:[~2015-10-27  5:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 16:54 [PATCH] staging: iio: dummy: clean up the define and usage of dummy_scan_elements Alison Schofield
2015-10-25  2:33 ` [Outreachy kernel] " Greg KH
2015-10-25 10:54 ` Jonathan Cameron
2015-10-26  3:29   ` Alison Schofield
2015-10-26  7:21     ` Jonathan Cameron
2015-10-26  8:11 ` Daniel Baluta
2015-10-26 17:20   ` Alison Schofield
2015-10-26 17:32     ` Jonathan Cameron
2015-10-26 20:46 ` [PATCH 0/3] iio: dummy: scan index enum update and clean up Alison Schofield
2015-10-26 20:48   ` [PATCH 1/3] staging: iio: dummy: use uppercase descriptors for enum names Alison Schofield
2015-10-26 20:49   ` [PATCH 2/3] staging: iio: dummy: add the timestamp buffer to the scan index enum Alison Schofield
2015-10-27  5:48     ` Greg KH [this message]
2015-10-26 20:50   ` [PATCH 3/3] staging: iio: dummy: replace block comment with single line comment Alison Schofield

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=20151027054858.GA4490@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=amsfield22@gmail.com \
    --cc=outreachy-kernel@googlegroups.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 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.