All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <amsfield22@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH 1/3] staging: iio: dummy: use uppercase descriptors for enum names
Date: Mon, 26 Oct 2015 13:48:23 -0700	[thread overview]
Message-ID: <1d0c9afcc8747c7b0b4f4c7241b06ee489cf079a.1445891339.git.amsfield22@gmail.com> (raw)
In-Reply-To: <cover.1445891339.git.amsfield22@gmail.com>

Replace lower case names in the enum dummy_scan_elements with
uppercase names and a descriptive prefix: DUMMY_INDEX_

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/iio/iio_simple_dummy.c        |  8 ++++----
 drivers/staging/iio/iio_simple_dummy.h        | 16 ++++++++--------
 drivers/staging/iio/iio_simple_dummy_buffer.c |  8 ++++----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/iio/iio_simple_dummy.c b/drivers/staging/iio/iio_simple_dummy.c
index 381f90f..70a82cd 100644
--- a/drivers/staging/iio/iio_simple_dummy.c
+++ b/drivers/staging/iio/iio_simple_dummy.c
@@ -137,7 +137,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
 		 */
 		.info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ),
 		/* The ordering of elements in the buffer via an enum */
-		.scan_index = voltage0,
+		.scan_index = DUMMY_INDEX_VOLTAGE_0,
 		.scan_type = { /* Description of storage in buffer */
 			.sign = 'u', /* unsigned */
 			.realbits = 13, /* 13 bits */
@@ -176,7 +176,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
 		 * sampling_frequency
 		 * The frequency in Hz at which the channels are sampled
 		 */
-		.scan_index = diffvoltage1m2,
+		.scan_index = DUMMY_INDEX_DIFFVOLTAGE_1M2,
 		.scan_type = { /* Description of storage in buffer */
 			.sign = 's', /* signed */
 			.realbits = 12, /* 12 bits */
@@ -194,7 +194,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
 		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 		.info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ),
-		.scan_index = diffvoltage3m4,
+		.scan_index = DUMMY_INDEX_DIFFVOLTAGE_3M4,
 		.scan_type = {
 			.sign = 's',
 			.realbits = 11,
@@ -221,7 +221,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
 		BIT(IIO_CHAN_INFO_CALIBSCALE) |
 		BIT(IIO_CHAN_INFO_CALIBBIAS),
 		.info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ),
-		.scan_index = accelx,
+		.scan_index = DUMMY_INDEX_ACCELX,
 		.scan_type = { /* Description of storage in buffer */
 			.sign = 's', /* signed */
 			.realbits = 16, /* 16 bits */
diff --git a/drivers/staging/iio/iio_simple_dummy.h b/drivers/staging/iio/iio_simple_dummy.h
index 5c2f4d0..b9069a1 100644
--- a/drivers/staging/iio/iio_simple_dummy.h
+++ b/drivers/staging/iio/iio_simple_dummy.h
@@ -98,18 +98,18 @@ iio_simple_dummy_events_unregister(struct iio_dev *indio_dev)
 
 /**
  * enum iio_simple_dummy_scan_elements - scan index enum
- * @voltage0:		the single ended voltage channel
- * @diffvoltage1m2:	first differential channel
- * @diffvoltage3m4:	second differenial channel
- * @accelx:		acceleration channel
+ * @DUMMY_INDEX_VOLTAGE_0:         the single ended voltage channel
+ * @DUMMY_INDEX_DIFFVOLTAGE_1M2:   first differential channel
+ * @DUMMY_INDEX_DIFFVOLTAGE_3M4:   second differential channel
+ * @DUMMY_INDEX_ACCELX:            acceleration channel
  *
  * Enum provides convenient numbering for the scan index.
  */
 enum iio_simple_dummy_scan_elements {
-	voltage0,
-	diffvoltage1m2,
-	diffvoltage3m4,
-	accelx,
+	DUMMY_INDEX_VOLTAGE_0,
+	DUMMY_INDEX_DIFFVOLTAGE_1M2,
+	DUMMY_INDEX_DIFFVOLTAGE_3M4,
+	DUMMY_INDEX_ACCELX,
 };
 
 #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 00ed774..cf44a6f 100644
--- a/drivers/staging/iio/iio_simple_dummy_buffer.c
+++ b/drivers/staging/iio/iio_simple_dummy_buffer.c
@@ -27,10 +27,10 @@
 /* Some fake data */
 
 static const s16 fakedata[] = {
-	[voltage0] = 7,
-	[diffvoltage1m2] = -33,
-	[diffvoltage3m4] = -2,
-	[accelx] = 344,
+	[DUMMY_INDEX_VOLTAGE_0] = 7,
+	[DUMMY_INDEX_DIFFVOLTAGE_1M2] = -33,
+	[DUMMY_INDEX_DIFFVOLTAGE_3M4] = -2,
+	[DUMMY_INDEX_ACCELX] = 344,
 };
 
 /**
-- 
2.1.4



  reply	other threads:[~2015-10-26 20:48 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   ` Alison Schofield [this message]
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     ` [Outreachy kernel] " Greg KH
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=1d0c9afcc8747c7b0b4f4c7241b06ee489cf079a.1445891339.git.amsfield22@gmail.com \
    --to=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.