* [PATCH 0/2] staging: iio: accel: Group similar macros into enums
@ 2017-03-05 16:26 Narcisa Ana Maria Vasile
2017-03-05 16:26 ` [PATCH 1/2] staging: iio: adis16209: " Narcisa Ana Maria Vasile
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 16:26 UTC (permalink / raw)
To: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh
Cc: outreachy-kernel, linux-iio, Narcisa Ana Maria Vasile
Group related macros into enums, for clarity.
Narcisa Ana Maria Vasile (2):
staging: iio: adis16209: Group similar macros into enums
staging: iio: adis16240: Group similar macros into enums
drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
2 files changed, 18 insertions(+), 14 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] staging: iio: adis16209: Group similar macros into enums
2017-03-05 16:26 [PATCH 0/2] staging: iio: accel: Group similar macros into enums Narcisa Ana Maria Vasile
@ 2017-03-05 16:26 ` Narcisa Ana Maria Vasile
2017-03-13 20:06 ` Jonathan Cameron
2017-03-05 16:26 ` [PATCH 2/2] staging: iio: adis16240: " Narcisa Ana Maria Vasile
2017-03-05 18:58 ` [Outreachy kernel] [PATCH 0/2] staging: iio: accel: " Alison Schofield
2 siblings, 1 reply; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 16:26 UTC (permalink / raw)
To: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh
Cc: outreachy-kernel, linux-iio, Narcisa Ana Maria Vasile
Group the scan indexes into an enum.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
---
drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c
index 8ff537f..c28a099 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -152,14 +152,16 @@
#define ADIS16209_ERROR_ACTIVE BIT(14)
-#define ADIS16209_SCAN_SUPPLY 0
-#define ADIS16209_SCAN_ACC_X 1
-#define ADIS16209_SCAN_ACC_Y 2
-#define ADIS16209_SCAN_AUX_ADC 3
-#define ADIS16209_SCAN_TEMP 4
-#define ADIS16209_SCAN_INCLI_X 5
-#define ADIS16209_SCAN_INCLI_Y 6
-#define ADIS16209_SCAN_ROT 7
+enum adis16209_scan {
+ ADIS16209_SCAN_SUPPLY,
+ ADIS16209_SCAN_ACC_X,
+ ADIS16209_SCAN_ACC_Y,
+ ADIS16209_SCAN_AUX_ADC,
+ ADIS16209_SCAN_TEMP,
+ ADIS16209_SCAN_INCLI_X,
+ ADIS16209_SCAN_INCLI_Y,
+ ADIS16209_SCAN_ROT,
+};
static const u8 adis16209_addresses[8][1] = {
[ADIS16209_SCAN_SUPPLY] = { },
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] staging: iio: adis16240: Group similar macros into enums
2017-03-05 16:26 [PATCH 0/2] staging: iio: accel: Group similar macros into enums Narcisa Ana Maria Vasile
2017-03-05 16:26 ` [PATCH 1/2] staging: iio: adis16209: " Narcisa Ana Maria Vasile
@ 2017-03-05 16:26 ` Narcisa Ana Maria Vasile
2017-03-13 20:09 ` Jonathan Cameron
2017-03-05 18:58 ` [Outreachy kernel] [PATCH 0/2] staging: iio: accel: " Alison Schofield
2 siblings, 1 reply; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 16:26 UTC (permalink / raw)
To: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh
Cc: outreachy-kernel, linux-iio, Narcisa Ana Maria Vasile
Group the scan indexes into an enum.
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
---
drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c
index 9690e46..4d8ee37 100644
--- a/drivers/staging/iio/accel/adis16240.c
+++ b/drivers/staging/iio/accel/adis16240.c
@@ -192,12 +192,14 @@
* filling. This may change!
*/
-#define ADIS16240_SCAN_ACC_X 0
-#define ADIS16240_SCAN_ACC_Y 1
-#define ADIS16240_SCAN_ACC_Z 2
-#define ADIS16240_SCAN_SUPPLY 3
-#define ADIS16240_SCAN_AUX_ADC 4
-#define ADIS16240_SCAN_TEMP 5
+enum adis16240_scan {
+ ADIS16240_SCAN_ACC_X,
+ ADIS16240_SCAN_ACC_Y,
+ ADIS16240_SCAN_ACC_Z,
+ ADIS16240_SCAN_SUPPLY,
+ ADIS16240_SCAN_AUX_ADC,
+ ADIS16240_SCAN_TEMP,
+};
static ssize_t adis16240_spi_read_signed(struct device *dev,
struct device_attribute *attr,
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 16:26 [PATCH 0/2] staging: iio: accel: Group similar macros into enums Narcisa Ana Maria Vasile
2017-03-05 16:26 ` [PATCH 1/2] staging: iio: adis16209: " Narcisa Ana Maria Vasile
2017-03-05 16:26 ` [PATCH 2/2] staging: iio: adis16240: " Narcisa Ana Maria Vasile
@ 2017-03-05 18:58 ` Alison Schofield
2017-03-05 19:15 ` Narcisa Ana Maria Vasile
2 siblings, 1 reply; 13+ messages in thread
From: Alison Schofield @ 2017-03-05 18:58 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile
Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh,
outreachy-kernel, linux-iio
On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> Group related macros into enums, for clarity.
Hi Narcisa,
Is this enum then used in a type declaration?
BTW - I can see Jonathan is following right along and sweeping these up,
but for future reference, this patch depended on a previous patch sent hours
earlier, that was not yet in staging-testing. When this happens, one option
is to give a note below the --- (as you would for version comments) stating the
dependency. This way someone reviewing the patch doesn't simply reject
it as not applying to my tree.
alisons
> Narcisa Ana Maria Vasile (2):
> staging: iio: adis16209: Group similar macros into enums
> staging: iio: adis16240: Group similar macros into enums
>
> drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> 2 files changed, 18 insertions(+), 14 deletions(-)
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 18:58 ` [Outreachy kernel] [PATCH 0/2] staging: iio: accel: " Alison Schofield
@ 2017-03-05 19:15 ` Narcisa Ana Maria Vasile
2017-03-05 19:17 ` Julia Lawall
0 siblings, 1 reply; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 19:15 UTC (permalink / raw)
To: Alison Schofield
Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh,
outreachy-kernel, linux-iio
On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > Group related macros into enums, for clarity.
>
> Hi Narcisa,
>
> Is this enum then used in a type declaration?
>
> BTW - I can see Jonathan is following right along and sweeping these up,
> but for future reference, this patch depended on a previous patch sent hours
> earlier, that was not yet in staging-testing. When this happens, one option
> is to give a note below the --- (as you would for version comments) stating the
> dependency. This way someone reviewing the patch doesn't simply reject
> it as not applying to my tree.
>
> alisons
>
Hi,
Do you mean whether there are any type declarations where I could
now replace the type with the enum type ? If so, I searched for
these type of situations, but didn't find any. If I missed one of
these cases, please let me know and I'll send a new patch.
Thank you for the note about the patch dependencies. I was just about
to ask about this, cause I realized there might be a problem.
I'll keep in mind to make a note next time.
Narcisa
> > Narcisa Ana Maria Vasile (2):
> > staging: iio: adis16209: Group similar macros into enums
> > staging: iio: adis16240: Group similar macros into enums
> >
> > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > 2 files changed, 18 insertions(+), 14 deletions(-)
> >
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 19:15 ` Narcisa Ana Maria Vasile
@ 2017-03-05 19:17 ` Julia Lawall
2017-03-05 19:28 ` Narcisa Ana Maria Vasile
0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2017-03-05 19:17 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile
Cc: Alison Schofield, lars, Michael.Hennerich, jic23, knaack.h,
pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > Group related macros into enums, for clarity.
> >
> > Hi Narcisa,
> >
> > Is this enum then used in a type declaration?
> >
> > BTW - I can see Jonathan is following right along and sweeping these up,
> > but for future reference, this patch depended on a previous patch sent hours
> > earlier, that was not yet in staging-testing. When this happens, one option
> > is to give a note below the --- (as you would for version comments) stating the
> > dependency. This way someone reviewing the patch doesn't simply reject
> > it as not applying to my tree.
> >
> > alisons
> >
> Hi,
>
> Do you mean whether there are any type declarations where I could
> now replace the type with the enum type ? If so, I searched for
> these type of situations, but didn't find any. If I missed one of
> these cases, please let me know and I'll send a new patch.
Typically the constant would be stored in something, compared to
something, etc. Are these constants not used at all?
julia
>
> Thank you for the note about the patch dependencies. I was just about
> to ask about this, cause I realized there might be a problem.
> I'll keep in mind to make a note next time.
>
> Narcisa
>
> > > Narcisa Ana Maria Vasile (2):
> > > staging: iio: adis16209: Group similar macros into enums
> > > staging: iio: adis16240: Group similar macros into enums
> > >
> > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > >
> > > --
> > > 1.9.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 19:17 ` Julia Lawall
@ 2017-03-05 19:28 ` Narcisa Ana Maria Vasile
2017-03-05 19:31 ` Julia Lawall
0 siblings, 1 reply; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 19:28 UTC (permalink / raw)
To: Julia Lawall
Cc: Alison Schofield, lars, Michael.Hennerich, jic23, knaack.h,
pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, Mar 05, 2017 at 08:17:45PM +0100, Julia Lawall wrote:
>
>
> On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
>
> > On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > > Group related macros into enums, for clarity.
> > >
> > > Hi Narcisa,
> > >
> > > Is this enum then used in a type declaration?
> > >
> > > BTW - I can see Jonathan is following right along and sweeping these up,
> > > but for future reference, this patch depended on a previous patch sent hours
> > > earlier, that was not yet in staging-testing. When this happens, one option
> > > is to give a note below the --- (as you would for version comments) stating the
> > > dependency. This way someone reviewing the patch doesn't simply reject
> > > it as not applying to my tree.
> > >
> > > alisons
> > >
> > Hi,
> >
> > Do you mean whether there are any type declarations where I could
> > now replace the type with the enum type ? If so, I searched for
> > these type of situations, but didn't find any. If I missed one of
> > these cases, please let me know and I'll send a new patch.
>
> Typically the constant would be stored in something, compared to
> something, etc. Are these constants not used at all?
>
> julia
>
>
Yes, they are used, they are stored. I thought she was asking
if I encountered any situations like in adc/ad7280a.h file
where you could define an enum for conversion averaging
macros and replace the 'unsigned int' field in the
ad7280_platform_data with the enum type.
Narcisa
> >
> > Thank you for the note about the patch dependencies. I was just about
> > to ask about this, cause I realized there might be a problem.
> > I'll keep in mind to make a note next time.
> >
> > Narcisa
> >
> > > > Narcisa Ana Maria Vasile (2):
> > > > staging: iio: adis16209: Group similar macros into enums
> > > > staging: iio: adis16240: Group similar macros into enums
> > > >
> > > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > > >
> > > > --
> > > > 1.9.1
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> > For more options, visit https://groups.google.com/d/optout.
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 19:28 ` Narcisa Ana Maria Vasile
@ 2017-03-05 19:31 ` Julia Lawall
2017-03-05 19:48 ` Narcisa Ana Maria Vasile
0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2017-03-05 19:31 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile
Cc: Julia Lawall, Alison Schofield, lars, Michael.Hennerich, jic23,
knaack.h, pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> On Sun, Mar 05, 2017 at 08:17:45PM +0100, Julia Lawall wrote:
> >
> >
> > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> >
> > > On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > > > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > > > Group related macros into enums, for clarity.
> > > >
> > > > Hi Narcisa,
> > > >
> > > > Is this enum then used in a type declaration?
> > > >
> > > > BTW - I can see Jonathan is following right along and sweeping these up,
> > > > but for future reference, this patch depended on a previous patch sent hours
> > > > earlier, that was not yet in staging-testing. When this happens, one option
> > > > is to give a note below the --- (as you would for version comments) stating the
> > > > dependency. This way someone reviewing the patch doesn't simply reject
> > > > it as not applying to my tree.
> > > >
> > > > alisons
> > > >
> > > Hi,
> > >
> > > Do you mean whether there are any type declarations where I could
> > > now replace the type with the enum type ? If so, I searched for
> > > these type of situations, but didn't find any. If I missed one of
> > > these cases, please let me know and I'll send a new patch.
> >
> > Typically the constant would be stored in something, compared to
> > something, etc. Are these constants not used at all?
> >
> > julia
> >
> >
> Yes, they are used, they are stored. I thought she was asking
> if I encountered any situations like in adc/ad7280a.h file
> where you could define an enum for conversion averaging
> macros and replace the 'unsigned int' field in the
> ad7280_platform_data with the enum type.
If they are stored in something, I guess you could change the type of that
thing?
julia
>
> Narcisa
> > >
> > > Thank you for the note about the patch dependencies. I was just about
> > > to ask about this, cause I realized there might be a problem.
> > > I'll keep in mind to make a note next time.
> > >
> > > Narcisa
> > >
> > > > > Narcisa Ana Maria Vasile (2):
> > > > > staging: iio: adis16209: Group similar macros into enums
> > > > > staging: iio: adis16240: Group similar macros into enums
> > > > >
> > > > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > > > >
> > > > > --
> > > > > 1.9.1
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > > > For more options, visit https://groups.google.com/d/optout.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305192840.GA12508%40nati-X550JK.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 19:31 ` Julia Lawall
@ 2017-03-05 19:48 ` Narcisa Ana Maria Vasile
2017-03-05 20:56 ` Julia Lawall
0 siblings, 1 reply; 13+ messages in thread
From: Narcisa Ana Maria Vasile @ 2017-03-05 19:48 UTC (permalink / raw)
To: Julia Lawall
Cc: Alison Schofield, lars, Michael.Hennerich, jic23, knaack.h,
pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, Mar 05, 2017 at 08:31:42PM +0100, Julia Lawall wrote:
>
>
> On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
>
> > On Sun, Mar 05, 2017 at 08:17:45PM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> > >
> > > > On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > > > > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > > > > Group related macros into enums, for clarity.
> > > > >
> > > > > Hi Narcisa,
> > > > >
> > > > > Is this enum then used in a type declaration?
> > > > >
> > > > > BTW - I can see Jonathan is following right along and sweeping these up,
> > > > > but for future reference, this patch depended on a previous patch sent hours
> > > > > earlier, that was not yet in staging-testing. When this happens, one option
> > > > > is to give a note below the --- (as you would for version comments) stating the
> > > > > dependency. This way someone reviewing the patch doesn't simply reject
> > > > > it as not applying to my tree.
> > > > >
> > > > > alisons
> > > > >
> > > > Hi,
> > > >
> > > > Do you mean whether there are any type declarations where I could
> > > > now replace the type with the enum type ? If so, I searched for
> > > > these type of situations, but didn't find any. If I missed one of
> > > > these cases, please let me know and I'll send a new patch.
> > >
> > > Typically the constant would be stored in something, compared to
> > > something, etc. Are these constants not used at all?
> > >
> > > julia
> > >
> > >
> > Yes, they are used, they are stored. I thought she was asking
> > if I encountered any situations like in adc/ad7280a.h file
> > where you could define an enum for conversion averaging
> > macros and replace the 'unsigned int' field in the
> > ad7280_platform_data with the enum type.
>
> If they are stored in something, I guess you could change the type of that
> thing?
>
> julia
>
The scan indexes(si) are given to macros such as:
#define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, info_all, bits) \
ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, info_all, bits)
(defined in the linux/iio/imu/adis.h header).
which are used to initialize the adis162xx_channels[].
Since they are used like this, I don't see anything I can
replace/improve here.
Am I missing something?
Narcisa.
> >
> > Narcisa
> > > >
> > > > Thank you for the note about the patch dependencies. I was just about
> > > > to ask about this, cause I realized there might be a problem.
> > > > I'll keep in mind to make a note next time.
> > > >
> > > > Narcisa
> > > >
> > > > > > Narcisa Ana Maria Vasile (2):
> > > > > > staging: iio: adis16209: Group similar macros into enums
> > > > > > staging: iio: adis16240: Group similar macros into enums
> > > > > >
> > > > > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > > > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > > > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > > > > >
> > > > > > --
> > > > > > 1.9.1
> > > > > >
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305192840.GA12508%40nati-X550JK.
> > For more options, visit https://groups.google.com/d/optout.
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 19:48 ` Narcisa Ana Maria Vasile
@ 2017-03-05 20:56 ` Julia Lawall
2017-03-05 21:57 ` Alison Schofield
0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2017-03-05 20:56 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile
Cc: Alison Schofield, lars, Michael.Hennerich, jic23, knaack.h,
pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> On Sun, Mar 05, 2017 at 08:31:42PM +0100, Julia Lawall wrote:
> >
> >
> > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> >
> > > On Sun, Mar 05, 2017 at 08:17:45PM +0100, Julia Lawall wrote:
> > > >
> > > >
> > > > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> > > >
> > > > > On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > > > > > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > > > > > Group related macros into enums, for clarity.
> > > > > >
> > > > > > Hi Narcisa,
> > > > > >
> > > > > > Is this enum then used in a type declaration?
> > > > > >
> > > > > > BTW - I can see Jonathan is following right along and sweeping these up,
> > > > > > but for future reference, this patch depended on a previous patch sent hours
> > > > > > earlier, that was not yet in staging-testing. When this happens, one option
> > > > > > is to give a note below the --- (as you would for version comments) stating the
> > > > > > dependency. This way someone reviewing the patch doesn't simply reject
> > > > > > it as not applying to my tree.
> > > > > >
> > > > > > alisons
> > > > > >
> > > > > Hi,
> > > > >
> > > > > Do you mean whether there are any type declarations where I could
> > > > > now replace the type with the enum type ? If so, I searched for
> > > > > these type of situations, but didn't find any. If I missed one of
> > > > > these cases, please let me know and I'll send a new patch.
> > > >
> > > > Typically the constant would be stored in something, compared to
> > > > something, etc. Are these constants not used at all?
> > > >
> > > > julia
> > > >
> > > >
> > > Yes, they are used, they are stored. I thought she was asking
> > > if I encountered any situations like in adc/ad7280a.h file
> > > where you could define an enum for conversion averaging
> > > macros and replace the 'unsigned int' field in the
> > > ad7280_platform_data with the enum type.
> >
> > If they are stored in something, I guess you could change the type of that
> > thing?
> >
> > julia
> >
> The scan indexes(si) are given to macros such as:
>
> #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, info_all, bits) \
> ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, info_all, bits)
>
> (defined in the linux/iio/imu/adis.h header).
> which are used to initialize the adis162xx_channels[].
OK, if the values are going in the si argument, then they end up in the
scan_index field of the iio_chan_spec structure. That structure is much
more general then your driver, so indeed, there seems to be no types that
can be improved.
julia
>
> Since they are used like this, I don't see anything I can
> replace/improve here.
> Am I missing something?
>
> Narcisa.
>
>
>
>
> > >
> > > Narcisa
> > > > >
> > > > > Thank you for the note about the patch dependencies. I was just about
> > > > > to ask about this, cause I realized there might be a problem.
> > > > > I'll keep in mind to make a note next time.
> > > > >
> > > > > Narcisa
> > > > >
> > > > > > > Narcisa Ana Maria Vasile (2):
> > > > > > > staging: iio: adis16209: Group similar macros into enums
> > > > > > > staging: iio: adis16240: Group similar macros into enums
> > > > > > >
> > > > > > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > > > > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > > > > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > > > > > >
> > > > > > > --
> > > > > > > 1.9.1
> > > > > > >
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > > > > > For more options, visit https://groups.google.com/d/optout.
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> > > > > For more options, visit https://groups.google.com/d/optout.
> > > > >
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305192840.GA12508%40nati-X550JK.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305194845.GA27902%40nati-X550JK.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/2] staging: iio: accel: Group similar macros into enums
2017-03-05 20:56 ` Julia Lawall
@ 2017-03-05 21:57 ` Alison Schofield
0 siblings, 0 replies; 13+ messages in thread
From: Alison Schofield @ 2017-03-05 21:57 UTC (permalink / raw)
To: Julia Lawall
Cc: Narcisa Ana Maria Vasile, lars, Michael.Hennerich, jic23,
knaack.h, pmeerw, gregkh, outreachy-kernel, linux-iio
On Sun, Mar 05, 2017 at 09:56:22PM +0100, Julia Lawall wrote:
>
>
> On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
>
> > On Sun, Mar 05, 2017 at 08:31:42PM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> > >
> > > > On Sun, Mar 05, 2017 at 08:17:45PM +0100, Julia Lawall wrote:
> > > > >
> > > > >
> > > > > On Sun, 5 Mar 2017, Narcisa Ana Maria Vasile wrote:
> > > > >
> > > > > > On Sun, Mar 05, 2017 at 10:58:29AM -0800, Alison Schofield wrote:
> > > > > > > On Sun, Mar 05, 2017 at 06:26:03PM +0200, Narcisa Ana Maria Vasile wrote:
> > > > > > > > Group related macros into enums, for clarity.
> > > > > > >
> > > > > > > Hi Narcisa,
> > > > > > >
> > > > > > > Is this enum then used in a type declaration?
> > > > > > >
> > > > > > > BTW - I can see Jonathan is following right along and sweeping these up,
> > > > > > > but for future reference, this patch depended on a previous patch sent hours
> > > > > > > earlier, that was not yet in staging-testing. When this happens, one option
> > > > > > > is to give a note below the --- (as you would for version comments) stating the
> > > > > > > dependency. This way someone reviewing the patch doesn't simply reject
> > > > > > > it as not applying to my tree.
> > > > > > >
> > > > > > > alisons
> > > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Do you mean whether there are any type declarations where I could
> > > > > > now replace the type with the enum type ? If so, I searched for
> > > > > > these type of situations, but didn't find any. If I missed one of
> > > > > > these cases, please let me know and I'll send a new patch.
> > > > >
> > > > > Typically the constant would be stored in something, compared to
> > > > > something, etc. Are these constants not used at all?
> > > > >
> > > > > julia
> > > > >
> > > > >
> > > > Yes, they are used, they are stored. I thought she was asking
> > > > if I encountered any situations like in adc/ad7280a.h file
> > > > where you could define an enum for conversion averaging
> > > > macros and replace the 'unsigned int' field in the
> > > > ad7280_platform_data with the enum type.
> > >
> > > If they are stored in something, I guess you could change the type of that
> > > thing?
> > >
> > > julia
> > >
> > The scan indexes(si) are given to macros such as:
> >
> > #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, info_all, bits) \
> > ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, info_all, bits)
> >
> > (defined in the linux/iio/imu/adis.h header).
> > which are used to initialize the adis162xx_channels[].
>
> OK, if the values are going in the si argument, then they end up in the
> scan_index field of the iio_chan_spec structure. That structure is much
> more general then your driver, so indeed, there seems to be no types that
> can be improved.
>
> julia
Hey Narcisa,
Great to see you traced it all the way through!
alisons
>
> >
> > Since they are used like this, I don't see anything I can
> > replace/improve here.
> > Am I missing something?
> >
> > Narcisa.
> >
> >
> >
> >
> > > >
> > > > Narcisa
> > > > > >
> > > > > > Thank you for the note about the patch dependencies. I was just about
> > > > > > to ask about this, cause I realized there might be a problem.
> > > > > > I'll keep in mind to make a note next time.
> > > > > >
> > > > > > Narcisa
> > > > > >
> > > > > > > > Narcisa Ana Maria Vasile (2):
> > > > > > > > staging: iio: adis16209: Group similar macros into enums
> > > > > > > > staging: iio: adis16240: Group similar macros into enums
> > > > > > > >
> > > > > > > > drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> > > > > > > > drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> > > > > > > > 2 files changed, 18 insertions(+), 14 deletions(-)
> > > > > > > >
> > > > > > > > --
> > > > > > > > 1.9.1
> > > > > > > >
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1488730643.git.narcisaanamaria12%40gmail.com.
> > > > > > > > For more options, visit https://groups.google.com/d/optout.
> > > > > >
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305191459.GA20822%40nati-X550JK.
> > > > > > For more options, visit https://groups.google.com/d/optout.
> > > > > >
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305192840.GA12508%40nati-X550JK.
> > > > For more options, visit https://groups.google.com/d/optout.
> > > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170305194845.GA27902%40nati-X550JK.
> > For more options, visit https://groups.google.com/d/optout.
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] staging: iio: adis16209: Group similar macros into enums
2017-03-05 16:26 ` [PATCH 1/2] staging: iio: adis16209: " Narcisa Ana Maria Vasile
@ 2017-03-13 20:06 ` Jonathan Cameron
0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-03-13 20:06 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile, lars, Michael.Hennerich, knaack.h,
pmeerw, gregkh
Cc: outreachy-kernel, linux-iio
On 05/03/17 16:26, Narcisa Ana Maria Vasile wrote:
> Group the scan indexes into an enum.
>
> Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/accel/adis16209.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c
> index 8ff537f..c28a099 100644
> --- a/drivers/staging/iio/accel/adis16209.c
> +++ b/drivers/staging/iio/accel/adis16209.c
> @@ -152,14 +152,16 @@
>
> #define ADIS16209_ERROR_ACTIVE BIT(14)
>
> -#define ADIS16209_SCAN_SUPPLY 0
> -#define ADIS16209_SCAN_ACC_X 1
> -#define ADIS16209_SCAN_ACC_Y 2
> -#define ADIS16209_SCAN_AUX_ADC 3
> -#define ADIS16209_SCAN_TEMP 4
> -#define ADIS16209_SCAN_INCLI_X 5
> -#define ADIS16209_SCAN_INCLI_Y 6
> -#define ADIS16209_SCAN_ROT 7
> +enum adis16209_scan {
> + ADIS16209_SCAN_SUPPLY,
> + ADIS16209_SCAN_ACC_X,
> + ADIS16209_SCAN_ACC_Y,
> + ADIS16209_SCAN_AUX_ADC,
> + ADIS16209_SCAN_TEMP,
> + ADIS16209_SCAN_INCLI_X,
> + ADIS16209_SCAN_INCLI_Y,
> + ADIS16209_SCAN_ROT,
> +};
>
> static const u8 adis16209_addresses[8][1] = {
> [ADIS16209_SCAN_SUPPLY] = { },
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] staging: iio: adis16240: Group similar macros into enums
2017-03-05 16:26 ` [PATCH 2/2] staging: iio: adis16240: " Narcisa Ana Maria Vasile
@ 2017-03-13 20:09 ` Jonathan Cameron
0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-03-13 20:09 UTC (permalink / raw)
To: Narcisa Ana Maria Vasile, lars, Michael.Hennerich, knaack.h,
pmeerw, gregkh
Cc: outreachy-kernel, linux-iio
On 05/03/17 16:26, Narcisa Ana Maria Vasile wrote:
> Group the scan indexes into an enum.
>
> Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Applied.
Busy week / weekend so sorry for delay on these!
Jonathan
> ---
> drivers/staging/iio/accel/adis16240.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c
> index 9690e46..4d8ee37 100644
> --- a/drivers/staging/iio/accel/adis16240.c
> +++ b/drivers/staging/iio/accel/adis16240.c
> @@ -192,12 +192,14 @@
> * filling. This may change!
> */
>
> -#define ADIS16240_SCAN_ACC_X 0
> -#define ADIS16240_SCAN_ACC_Y 1
> -#define ADIS16240_SCAN_ACC_Z 2
> -#define ADIS16240_SCAN_SUPPLY 3
> -#define ADIS16240_SCAN_AUX_ADC 4
> -#define ADIS16240_SCAN_TEMP 5
> +enum adis16240_scan {
> + ADIS16240_SCAN_ACC_X,
> + ADIS16240_SCAN_ACC_Y,
> + ADIS16240_SCAN_ACC_Z,
> + ADIS16240_SCAN_SUPPLY,
> + ADIS16240_SCAN_AUX_ADC,
> + ADIS16240_SCAN_TEMP,
> +};
>
> static ssize_t adis16240_spi_read_signed(struct device *dev,
> struct device_attribute *attr,
>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-03-13 20:09 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-05 16:26 [PATCH 0/2] staging: iio: accel: Group similar macros into enums Narcisa Ana Maria Vasile
2017-03-05 16:26 ` [PATCH 1/2] staging: iio: adis16209: " Narcisa Ana Maria Vasile
2017-03-13 20:06 ` Jonathan Cameron
2017-03-05 16:26 ` [PATCH 2/2] staging: iio: adis16240: " Narcisa Ana Maria Vasile
2017-03-13 20:09 ` Jonathan Cameron
2017-03-05 18:58 ` [Outreachy kernel] [PATCH 0/2] staging: iio: accel: " Alison Schofield
2017-03-05 19:15 ` Narcisa Ana Maria Vasile
2017-03-05 19:17 ` Julia Lawall
2017-03-05 19:28 ` Narcisa Ana Maria Vasile
2017-03-05 19:31 ` Julia Lawall
2017-03-05 19:48 ` Narcisa Ana Maria Vasile
2017-03-05 20:56 ` Julia Lawall
2017-03-05 21:57 ` Alison Schofield
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.