Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614143 > unrolled thread

[PATCH 0/3] iio: health: Clean up

Started bysimran singhal <singhalsimran0@gmail.com>
First post2017-03-31 18:50 +0200
Last post2017-03-31 21:10 +0200
Articles 10 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] iio: health: Clean up simran singhal <singhalsimran0@gmail.com> - 2017-03-31 18:50 +0200
    [PATCH 1/3] iio: health: afe440x: Remove code in comments simran singhal <singhalsimran0@gmail.com> - 2017-03-31 18:50 +0200
      Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments Joe Perches <joe@perches.com> - 2017-03-31 20:40 +0200
        Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments SIMRAN SINGHAL <singhalsimran0@gmail.com> - 2017-03-31 20:50 +0200
          Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments Joe Perches <joe@perches.com> - 2017-03-31 21:00 +0200
            Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments SIMRAN SINGHAL <singhalsimran0@gmail.com> - 2017-03-31 21:20 +0200
      Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments kbuild test robot <lkp@intel.com> - 2017-04-02 07:30 +0200
    [PATCH 2/3] iio: health: afe4404: Remove all unused functions simran singhal <singhalsimran0@gmail.com> - 2017-03-31 18:50 +0200
    [PATCH 3/3] iio: health: afe4403: Remove all unused functions simran singhal <singhalsimran0@gmail.com> - 2017-03-31 18:50 +0200
    Re: [PATCH 0/3] iio: health: Clean up SIMRAN SINGHAL <singhalsimran0@gmail.com> - 2017-03-31 21:10 +0200

#1614143 — [PATCH 0/3] iio: health: Clean up

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-03-31 18:50 +0200
Subject[PATCH 0/3] iio: health: Clean up
Message-ID<tr7Um-76y-5@gated-at.bofh.it>
This patch-series removes commented code in afe440x.h and 
removes unused functions in afe4404.c and afe4403.c.

simran singhal (3):
  iio: health: afe440x: Remove code in comments
  iio: health: afe4404: Remove all unused functions
  iio: health: afe4403: Remove all unused functions

 drivers/iio/health/afe4403.c | 51 --------------------------------------
 drivers/iio/health/afe4404.c | 51 --------------------------------------
 drivers/iio/health/afe440x.h | 58 --------------------------------------------
 3 files changed, 160 deletions(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1614144 — [PATCH 1/3] iio: health: afe440x: Remove code in comments

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-03-31 18:50 +0200
Subject[PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<tr7Ul-76y-3@gated-at.bofh.it>
In reply to#1614143
Commenting out code is a bad idea.
As comments are for explaining what code is about.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/iio/health/afe440x.h | 58 --------------------------------------------
 1 file changed, 58 deletions(-)

diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
index 1a0f247..71e2f0e 100644
--- a/drivers/iio/health/afe440x.h
+++ b/drivers/iio/health/afe440x.h
@@ -88,56 +88,11 @@
 #define AFE440X_CONTROL0_WRITE		0x0
 #define AFE440X_CONTROL0_READ		0x1
 
-#define AFE440X_INTENSITY_CHAN(_index, _mask)			\
-	{							\
-		.type = IIO_INTENSITY,				\
-		.channel = _index,				\
-		.address = _index,				\
-		.scan_index = _index,				\
-		.scan_type = {					\
-				.sign = 's',			\
-				.realbits = 24,			\
-				.storagebits = 32,		\
-				.endianness = IIO_CPU,		\
-		},						\
-		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
-			_mask,					\
-		.indexed = true,				\
-	}
-
-#define AFE440X_CURRENT_CHAN(_index)				\
-	{							\
-		.type = IIO_CURRENT,				\
-		.channel = _index,				\
-		.address = _index,				\
-		.scan_index = -1,				\
-		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
-			BIT(IIO_CHAN_INFO_SCALE),		\
-		.indexed = true,				\
-		.output = true,					\
-	}
-
 struct afe440x_val_table {
 	int integer;
 	int fract;
 };
 
-#define AFE440X_TABLE_ATTR(_name, _table)				\
-static ssize_t _name ## _show(struct device *dev,			\
-			      struct device_attribute *attr, char *buf)	\
-{									\
-	ssize_t len = 0;						\
-	int i;								\
-									\
-	for (i = 0; i < ARRAY_SIZE(_table); i++)			\
-		len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \
-				 _table[i].integer,			\
-				 _table[i].fract);			\
-									\
-	buf[len - 1] = '\n';						\
-									\
-	return len;							\
-}									\
 static DEVICE_ATTR_RO(_name)
 
 struct afe440x_attr {
@@ -147,17 +102,4 @@ struct afe440x_attr {
 	unsigned int table_size;
 };
 
-#define to_afe440x_attr(_dev_attr)				\
-	container_of(_dev_attr, struct afe440x_attr, dev_attr)
-
-#define AFE440X_ATTR(_name, _field, _table)			\
-	struct afe440x_attr afe440x_attr_##_name = {		\
-		.dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR),	\
-				   afe440x_show_register,	\
-				   afe440x_store_register),	\
-		.field = _field,				\
-		.val_table = _table,				\
-		.table_size = ARRAY_SIZE(_table),		\
-	}
-
 #endif /* _AFE440X_H */
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1614243 — Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments

FromJoe Perches <joe@perches.com>
Date2017-03-31 20:40 +0200
SubjectRe: [PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<tr9CO-8h2-11@gated-at.bofh.it>
In reply to#1614144
On Fri, 2017-03-31 at 22:16 +0530, simran singhal wrote:
> Commenting out code is a bad idea.
> As comments are for explaining what code is about.

patch doesn't match commit message.

> Signed-off-by: simran singhal <singhalsimran0@gmail.com>
> ---
>  drivers/iio/health/afe440x.h | 58 --------------------------------------------
>  1 file changed, 58 deletions(-)
> 
> diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
> index 1a0f247..71e2f0e 100644
> --- a/drivers/iio/health/afe440x.h
> +++ b/drivers/iio/health/afe440x.h
> @@ -88,56 +88,11 @@
>  #define AFE440X_CONTROL0_WRITE		0x0
>  #define AFE440X_CONTROL0_READ		0x1
>  
> -#define AFE440X_INTENSITY_CHAN(_index, _mask)			\
> -	{							\
> -		.type = IIO_INTENSITY,				\
> -		.channel = _index,				\
> -		.address = _index,				\
> -		.scan_index = _index,				\
> -		.scan_type = {					\
> -				.sign = 's',			\
> -				.realbits = 24,			\
> -				.storagebits = 32,		\
> -				.endianness = IIO_CPU,		\
> -		},						\
> -		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
> -			_mask,					\
> -		.indexed = true,				\
> -	}
> -
> -#define AFE440X_CURRENT_CHAN(_index)				\
> -	{							\
> -		.type = IIO_CURRENT,				\
> -		.channel = _index,				\
> -		.address = _index,				\
> -		.scan_index = -1,				\
> -		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
> -			BIT(IIO_CHAN_INFO_SCALE),		\
> -		.indexed = true,				\
> -		.output = true,					\
> -	}
> -
>  struct afe440x_val_table {
>  	int integer;
>  	int fract;
>  };
>  
> -#define AFE440X_TABLE_ATTR(_name, _table)				\
> -static ssize_t _name ## _show(struct device *dev,			\
> -			      struct device_attribute *attr, char *buf)	\
> -{									\
> -	ssize_t len = 0;						\
> -	int i;								\
> -									\
> -	for (i = 0; i < ARRAY_SIZE(_table); i++)			\
> -		len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \
> -				 _table[i].integer,			\
> -				 _table[i].fract);			\
> -									\
> -	buf[len - 1] = '\n';						\
> -									\
> -	return len;							\
> -}									\
>  static DEVICE_ATTR_RO(_name)
>  
>  struct afe440x_attr {
> @@ -147,17 +102,4 @@ struct afe440x_attr {
>  	unsigned int table_size;
>  };
>  
> -#define to_afe440x_attr(_dev_attr)				\
> -	container_of(_dev_attr, struct afe440x_attr, dev_attr)
> -
> -#define AFE440X_ATTR(_name, _field, _table)			\
> -	struct afe440x_attr afe440x_attr_##_name = {		\
> -		.dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR),	\
> -				   afe440x_show_register,	\
> -				   afe440x_store_register),	\
> -		.field = _field,				\
> -		.val_table = _table,				\
> -		.table_size = ARRAY_SIZE(_table),		\
> -	}
> -
>  #endif /* _AFE440X_H */

[toc] | [prev] | [next] | [standalone]


#1614245 — Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments

FromSIMRAN SINGHAL <singhalsimran0@gmail.com>
Date2017-03-31 20:50 +0200
SubjectRe: [PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<tr9Mt-8kr-3@gated-at.bofh.it>
In reply to#1614243
On Sat, Apr 1, 2017 at 12:03 AM, Joe Perches <joe@perches.com> wrote:
> On Fri, 2017-03-31 at 22:16 +0530, simran singhal wrote:
>> Commenting out code is a bad idea.
>> As comments are for explaining what code is about.
>
> patch doesn't match commit message.

In commit message I am clearly saying commenting out the code is a bad Idea.
As comments are for explaining what code is about.
And that's what I am doing in the patch deleting the commented codes.

My subject also says "Remove code in comments"

Than what is not matching?

>
>> Signed-off-by: simran singhal <singhalsimran0@gmail.com>
>> ---
>>  drivers/iio/health/afe440x.h | 58 --------------------------------------------
>>  1 file changed, 58 deletions(-)
>>
>> diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
>> index 1a0f247..71e2f0e 100644
>> --- a/drivers/iio/health/afe440x.h
>> +++ b/drivers/iio/health/afe440x.h
>> @@ -88,56 +88,11 @@
>>  #define AFE440X_CONTROL0_WRITE               0x0
>>  #define AFE440X_CONTROL0_READ                0x1
>>
>> -#define AFE440X_INTENSITY_CHAN(_index, _mask)                        \
>> -     {                                                       \
>> -             .type = IIO_INTENSITY,                          \
>> -             .channel = _index,                              \
>> -             .address = _index,                              \
>> -             .scan_index = _index,                           \
>> -             .scan_type = {                                  \
>> -                             .sign = 's',                    \
>> -                             .realbits = 24,                 \
>> -                             .storagebits = 32,              \
>> -                             .endianness = IIO_CPU,          \
>> -             },                                              \
>> -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
>> -                     _mask,                                  \
>> -             .indexed = true,                                \
>> -     }
>> -
>> -#define AFE440X_CURRENT_CHAN(_index)                         \
>> -     {                                                       \
>> -             .type = IIO_CURRENT,                            \
>> -             .channel = _index,                              \
>> -             .address = _index,                              \
>> -             .scan_index = -1,                               \
>> -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
>> -                     BIT(IIO_CHAN_INFO_SCALE),               \
>> -             .indexed = true,                                \
>> -             .output = true,                                 \
>> -     }
>> -
>>  struct afe440x_val_table {
>>       int integer;
>>       int fract;
>>  };
>>
>> -#define AFE440X_TABLE_ATTR(_name, _table)                            \
>> -static ssize_t _name ## _show(struct device *dev,                    \
>> -                           struct device_attribute *attr, char *buf) \
>> -{                                                                    \
>> -     ssize_t len = 0;                                                \
>> -     int i;                                                          \
>> -                                                                     \
>> -     for (i = 0; i < ARRAY_SIZE(_table); i++)                        \
>> -             len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \
>> -                              _table[i].integer,                     \
>> -                              _table[i].fract);                      \
>> -                                                                     \
>> -     buf[len - 1] = '\n';                                            \
>> -                                                                     \
>> -     return len;                                                     \
>> -}                                                                    \
>>  static DEVICE_ATTR_RO(_name)
>>
>>  struct afe440x_attr {
>> @@ -147,17 +102,4 @@ struct afe440x_attr {
>>       unsigned int table_size;
>>  };
>>
>> -#define to_afe440x_attr(_dev_attr)                           \
>> -     container_of(_dev_attr, struct afe440x_attr, dev_attr)
>> -
>> -#define AFE440X_ATTR(_name, _field, _table)                  \
>> -     struct afe440x_attr afe440x_attr_##_name = {            \
>> -             .dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR),  \
>> -                                afe440x_show_register,       \
>> -                                afe440x_store_register),     \
>> -             .field = _field,                                \
>> -             .val_table = _table,                            \
>> -             .table_size = ARRAY_SIZE(_table),               \
>> -     }
>> -
>>  #endif /* _AFE440X_H */

[toc] | [prev] | [next] | [standalone]


#1614257 — Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments

FromJoe Perches <joe@perches.com>
Date2017-03-31 21:00 +0200
SubjectRe: [PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<tr9Wa-8nY-21@gated-at.bofh.it>
In reply to#1614245
On Sat, 2017-04-01 at 00:13 +0530, SIMRAN SINGHAL wrote:
> On Sat, Apr 1, 2017 at 12:03 AM, Joe Perches <joe@perches.com> wrote:
> > On Fri, 2017-03-31 at 22:16 +0530, simran singhal wrote:
> > > Commenting out code is a bad idea.
> > > As comments are for explaining what code is about.
> > 
> > patch doesn't match commit message.
> 
> In commit message I am clearly saying commenting out the code is a bad Idea.
> As comments are for explaining what code is about.
> And that's what I am doing in the patch deleting the commented codes.
> 
> My subject also says "Remove code in comments"
> 
> Than what is not matching?

Read your own patch.

You are removing #defines not comments.

If the whole thing is in comments, then
the #defines immediately above what you
are removing should also be deleted.

> > 
> > > Signed-off-by: simran singhal <singhalsimran0@gmail.com>
> > > ---
> > >  drivers/iio/health/afe440x.h | 58 --------------------------------------------
> > >  1 file changed, 58 deletions(-)
> > > 
> > > diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
> > > index 1a0f247..71e2f0e 100644
> > > --- a/drivers/iio/health/afe440x.h
> > > +++ b/drivers/iio/health/afe440x.h
> > > @@ -88,56 +88,11 @@
> > >  #define AFE440X_CONTROL0_WRITE               0x0
> > >  #define AFE440X_CONTROL0_READ                0x1
> > > 
> > > -#define AFE440X_INTENSITY_CHAN(_index, _mask)                        \
> > > -     {                                                       \
> > > -             .type = IIO_INTENSITY,                          \
> > > -             .channel = _index,                              \
> > > -             .address = _index,                              \
> > > -             .scan_index = _index,                           \
> > > -             .scan_type = {                                  \
> > > -                             .sign = 's',                    \
> > > -                             .realbits = 24,                 \
> > > -                             .storagebits = 32,              \
> > > -                             .endianness = IIO_CPU,          \
> > > -             },                                              \
> > > -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
> > > -                     _mask,                                  \
> > > -             .indexed = true,                                \
> > > -     }
> > > -
> > > -#define AFE440X_CURRENT_CHAN(_index)                         \
> > > -     {                                                       \
> > > -             .type = IIO_CURRENT,                            \
> > > -             .channel = _index,                              \
> > > -             .address = _index,                              \
> > > -             .scan_index = -1,                               \
> > > -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
> > > -                     BIT(IIO_CHAN_INFO_SCALE),               \
> > > -             .indexed = true,                                \
> > > -             .output = true,                                 \
> > > -     }
> > > -
> > >  struct afe440x_val_table {
> > >       int integer;
> > >       int fract;
> > >  };
> > > 
> > > -#define AFE440X_TABLE_ATTR(_name, _table)                            \
> > > -static ssize_t _name ## _show(struct device *dev,                    \
> > > -                           struct device_attribute *attr, char *buf) \
> > > -{                                                                    \
> > > -     ssize_t len = 0;                                                \
> > > -     int i;                                                          \
> > > -                                                                     \
> > > -     for (i = 0; i < ARRAY_SIZE(_table); i++)                        \
> > > -             len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \
> > > -                              _table[i].integer,                     \
> > > -                              _table[i].fract);                      \
> > > -                                                                     \
> > > -     buf[len - 1] = '\n';                                            \
> > > -                                                                     \
> > > -     return len;                                                     \
> > > -}                                                                    \
> > >  static DEVICE_ATTR_RO(_name)
> > > 
> > >  struct afe440x_attr {
> > > @@ -147,17 +102,4 @@ struct afe440x_attr {
> > >       unsigned int table_size;
> > >  };
> > > 
> > > -#define to_afe440x_attr(_dev_attr)                           \
> > > -     container_of(_dev_attr, struct afe440x_attr, dev_attr)
> > > -
> > > -#define AFE440X_ATTR(_name, _field, _table)                  \
> > > -     struct afe440x_attr afe440x_attr_##_name = {            \
> > > -             .dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR),  \
> > > -                                afe440x_show_register,       \
> > > -                                afe440x_store_register),     \
> > > -             .field = _field,                                \
> > > -             .val_table = _table,                            \
> > > -             .table_size = ARRAY_SIZE(_table),               \
> > > -     }
> > > -
> > >  #endif /* _AFE440X_H */

[toc] | [prev] | [next] | [standalone]


#1614267 — Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments

FromSIMRAN SINGHAL <singhalsimran0@gmail.com>
Date2017-03-31 21:20 +0200
SubjectRe: [PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<trafv-iO-15@gated-at.bofh.it>
In reply to#1614257
Please ignore this Patch. This Patch is wrong.

On Sat, Apr 1, 2017 at 12:20 AM, Joe Perches <joe@perches.com> wrote:
> On Sat, 2017-04-01 at 00:13 +0530, SIMRAN SINGHAL wrote:
>> On Sat, Apr 1, 2017 at 12:03 AM, Joe Perches <joe@perches.com> wrote:
>> > On Fri, 2017-03-31 at 22:16 +0530, simran singhal wrote:
>> > > Commenting out code is a bad idea.
>> > > As comments are for explaining what code is about.
>> >
>> > patch doesn't match commit message.
>>
>> In commit message I am clearly saying commenting out the code is a bad Idea.
>> As comments are for explaining what code is about.
>> And that's what I am doing in the patch deleting the commented codes.
>>
>> My subject also says "Remove code in comments"
>>
>> Than what is not matching?
>
> Read your own patch.
>
> You are removing #defines not comments.
>
> If the whole thing is in comments, then
> the #defines immediately above what you
> are removing should also be deleted.
>
>> >
>> > > Signed-off-by: simran singhal <singhalsimran0@gmail.com>
>> > > ---
>> > >  drivers/iio/health/afe440x.h | 58 --------------------------------------------
>> > >  1 file changed, 58 deletions(-)
>> > >
>> > > diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h
>> > > index 1a0f247..71e2f0e 100644
>> > > --- a/drivers/iio/health/afe440x.h
>> > > +++ b/drivers/iio/health/afe440x.h
>> > > @@ -88,56 +88,11 @@
>> > >  #define AFE440X_CONTROL0_WRITE               0x0
>> > >  #define AFE440X_CONTROL0_READ                0x1
>> > >
>> > > -#define AFE440X_INTENSITY_CHAN(_index, _mask)                        \
>> > > -     {                                                       \
>> > > -             .type = IIO_INTENSITY,                          \
>> > > -             .channel = _index,                              \
>> > > -             .address = _index,                              \
>> > > -             .scan_index = _index,                           \
>> > > -             .scan_type = {                                  \
>> > > -                             .sign = 's',                    \
>> > > -                             .realbits = 24,                 \
>> > > -                             .storagebits = 32,              \
>> > > -                             .endianness = IIO_CPU,          \
>> > > -             },                                              \
>> > > -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
>> > > -                     _mask,                                  \
>> > > -             .indexed = true,                                \
>> > > -     }
>> > > -
>> > > -#define AFE440X_CURRENT_CHAN(_index)                         \
>> > > -     {                                                       \
>> > > -             .type = IIO_CURRENT,                            \
>> > > -             .channel = _index,                              \
>> > > -             .address = _index,                              \
>> > > -             .scan_index = -1,                               \
>> > > -             .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |  \
>> > > -                     BIT(IIO_CHAN_INFO_SCALE),               \
>> > > -             .indexed = true,                                \
>> > > -             .output = true,                                 \
>> > > -     }
>> > > -
>> > >  struct afe440x_val_table {
>> > >       int integer;
>> > >       int fract;
>> > >  };
>> > >
>> > > -#define AFE440X_TABLE_ATTR(_name, _table)                            \
>> > > -static ssize_t _name ## _show(struct device *dev,                    \
>> > > -                           struct device_attribute *attr, char *buf) \
>> > > -{                                                                    \
>> > > -     ssize_t len = 0;                                                \
>> > > -     int i;                                                          \
>> > > -                                                                     \
>> > > -     for (i = 0; i < ARRAY_SIZE(_table); i++)                        \
>> > > -             len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \
>> > > -                              _table[i].integer,                     \
>> > > -                              _table[i].fract);                      \
>> > > -                                                                     \
>> > > -     buf[len - 1] = '\n';                                            \
>> > > -                                                                     \
>> > > -     return len;                                                     \
>> > > -}                                                                    \
>> > >  static DEVICE_ATTR_RO(_name)
>> > >
>> > >  struct afe440x_attr {
>> > > @@ -147,17 +102,4 @@ struct afe440x_attr {
>> > >       unsigned int table_size;
>> > >  };
>> > >
>> > > -#define to_afe440x_attr(_dev_attr)                           \
>> > > -     container_of(_dev_attr, struct afe440x_attr, dev_attr)
>> > > -
>> > > -#define AFE440X_ATTR(_name, _field, _table)                  \
>> > > -     struct afe440x_attr afe440x_attr_##_name = {            \
>> > > -             .dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR),  \
>> > > -                                afe440x_show_register,       \
>> > > -                                afe440x_store_register),     \
>> > > -             .field = _field,                                \
>> > > -             .val_table = _table,                            \
>> > > -             .table_size = ARRAY_SIZE(_table),               \
>> > > -     }
>> > > -
>> > >  #endif /* _AFE440X_H */

[toc] | [prev] | [next] | [standalone]


#1614642 — Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments

Fromkbuild test robot <lkp@intel.com>
Date2017-04-02 07:30 +0200
SubjectRe: [PATCH 1/3] iio: health: afe440x: Remove code in comments
Message-ID<trGfn-4Co-3@gated-at.bofh.it>
In reply to#1614144
Hi simran,

[auto build test WARNING on iio/togreg]
[also build test WARNING on v4.11-rc4 next-20170331]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/simran-singhal/iio-health-Clean-up/20170402-095718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:264:8: sparse: attribute 'no_sanitize_address': unknown attribute
   drivers/iio/health/afe440x.h:98:1: sparse: Expected ; at end of declaration
   drivers/iio/health/afe440x.h:98:1: sparse: got struct
   drivers/iio/health/afe440x.h:103:1: sparse: Expected ; at the end of type declaration
   drivers/iio/health/afe440x.h:103:1: sparse: got }
   drivers/iio/health/afe440x.h:96:8: sparse: undefined identifier '_name_show'
   drivers/iio/health/afe4403.c:110:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
>> drivers/iio/health/afe4403.c:110:31: sparse: not a function <noident>
   drivers/iio/health/afe4403.c:111:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4403.c:112:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4403.c:113:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4403.c:114:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4403.c:115:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4403.c:115:31: sparse: not a function <noident>
   drivers/iio/health/afe4403.c:117:9: sparse: undefined identifier 'AFE440X_CURRENT_CHAN'
   drivers/iio/health/afe4403.c:118:9: sparse: undefined identifier 'AFE440X_CURRENT_CHAN'
   drivers/iio/health/afe4403.c:145:45: sparse: undefined identifier 'to_afe440x_attr'
   drivers/iio/health/afe4403.c:150:57: sparse: using member 'field' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:154:36: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:157:31: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:158:31: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:169:45: sparse: undefined identifier 'to_afe440x_attr'
   drivers/iio/health/afe4403.c:176:41: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:177:33: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:180:32: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:183:15: sparse: using member 'field' in incomplete struct afe440x_attr
   drivers/iio/health/afe4403.c:203:10: sparse: undefined identifier 'dev_attr_in_intensity_resistance_available'
   drivers/iio/health/afe4403.c:204:10: sparse: undefined identifier 'dev_attr_in_intensity_capacitance_available'
   drivers/iio/health/afe4403.c:205:10: sparse: undefined identifier 'afe440x_attr_in_intensity1_resistance'
   drivers/iio/health/afe4403.c:206:10: sparse: undefined identifier 'afe440x_attr_in_intensity1_capacitance'
   drivers/iio/health/afe4403.c:207:10: sparse: undefined identifier 'afe440x_attr_in_intensity2_resistance'
   drivers/iio/health/afe4403.c:208:10: sparse: undefined identifier 'afe440x_attr_in_intensity2_capacitance'
   drivers/iio/health/afe4403.c:209:10: sparse: undefined identifier 'afe440x_attr_in_intensity3_resistance'
   drivers/iio/health/afe4403.c:210:10: sparse: undefined identifier 'afe440x_attr_in_intensity3_capacitance'
   drivers/iio/health/afe4403.c:211:10: sparse: undefined identifier 'afe440x_attr_in_intensity4_resistance'
   drivers/iio/health/afe4403.c:212:10: sparse: undefined identifier 'afe440x_attr_in_intensity4_capacitance'
   In file included from include/linux/kobject.h:21:0,
                    from include/linux/device.h:17,
                    from drivers/iio/health/afe4403.c:17:
   drivers/iio/health/afe440x.h:96:23: error: '_name_show' undeclared here (not in a function)
    static DEVICE_ATTR_RO(_name)
                          ^
   include/linux/sysfs.h:116:10: note: in definition of macro '__ATTR_RO'
     .show = _name##_show,      \
             ^~~~~
   drivers/iio/health/afe440x.h:96:8: note: in expansion of macro 'DEVICE_ATTR_RO'
    static DEVICE_ATTR_RO(_name)
           ^~~~~~~~~~~~~~
   In file included from drivers/iio/health/afe4403.c:34:0:
   drivers/iio/health/afe440x.h:98:1: error: expected ',' or ';' before 'struct'
    struct afe440x_attr {
    ^~~~~~
   drivers/iio/health/afe4403.c:110:2: error: implicit declaration of function 'AFE440X_INTENSITY_CHAN' [-Werror=implicit-function-declaration]
     AFE440X_INTENSITY_CHAN(LED2, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:110:2: error: initializer element is not constant
   drivers/iio/health/afe4403.c:110:2: note: (near initialization for 'afe4403_channels[0].type')
   drivers/iio/health/afe4403.c:111:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(ALED2, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:111:2: note: (near initialization for 'afe4403_channels[0].channel')
   drivers/iio/health/afe4403.c:112:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED1, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:112:2: note: (near initialization for 'afe4403_channels[0].channel2')
   drivers/iio/health/afe4403.c:113:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(ALED1, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:113:2: note: (near initialization for 'afe4403_channels[0].address')
   drivers/iio/health/afe4403.c:114:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED2_ALED2, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:114:2: note: (near initialization for 'afe4403_channels[0].scan_index')
   drivers/iio/health/afe4403.c:115:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED1_ALED1, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:115:2: note: (near initialization for 'afe4403_channels[0].scan_type.sign')
   drivers/iio/health/afe4403.c:117:2: error: implicit declaration of function 'AFE440X_CURRENT_CHAN' [-Werror=implicit-function-declaration]
     AFE440X_CURRENT_CHAN(LED2),
     ^~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:117:2: error: initializer element is not constant
   drivers/iio/health/afe4403.c:117:2: note: (near initialization for 'afe4403_channels[0].scan_type.realbits')
   drivers/iio/health/afe4403.c:118:2: error: initializer element is not constant
     AFE440X_CURRENT_CHAN(LED1),
     ^~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:118:2: note: (near initialization for 'afe4403_channels[0].scan_type.storagebits')
   drivers/iio/health/afe4403.c:125:1: warning: data definition has no type or storage class
    AFE440X_TABLE_ATTR(in_intensity_resistance_available, afe4403_res_table);
    ^~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:125:1: error: type defaults to 'int' in declaration of 'AFE440X_TABLE_ATTR' [-Werror=implicit-int]
   drivers/iio/health/afe4403.c:125:1: warning: parameter names (without types) in function declaration
   drivers/iio/health/afe4403.c:137:1: warning: data definition has no type or storage class
    AFE440X_TABLE_ATTR(in_intensity_capacitance_available, afe4403_cap_table);
    ^~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:137:1: error: type defaults to 'int' in declaration of 'AFE440X_TABLE_ATTR' [-Werror=implicit-int]
   drivers/iio/health/afe4403.c:137:1: warning: parameter names (without types) in function declaration
   drivers/iio/health/afe4403.c: In function 'afe440x_show_register':
   drivers/iio/health/afe4403.c:145:38: error: implicit declaration of function 'to_afe440x_attr' [-Werror=implicit-function-declaration]
     struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
                                         ^~~~~~~~~~~~~~~
   drivers/iio/health/afe4403.c:145:38: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/iio/health/afe4403.c:150:50: error: dereferencing pointer to incomplete type 'struct afe440x_attr'
     ret = regmap_field_read(afe->fields[afe440x_attr->field], &reg_val);
                                                     ^~
   drivers/iio/health/afe4403.c:150:50: error: request for member 'field' in something not a structure or union
   drivers/iio/health/afe4403.c:150:37: error: array subscript is not an integer
     ret = regmap_field_read(afe->fields[afe440x_attr->field], &reg_val);
                                        ^
--
   include/linux/compiler.h:264:8: sparse: attribute 'no_sanitize_address': unknown attribute
   drivers/iio/health/afe440x.h:98:1: sparse: Expected ; at end of declaration
   drivers/iio/health/afe440x.h:98:1: sparse: got struct
   drivers/iio/health/afe440x.h:103:1: sparse: Expected ; at the end of type declaration
   drivers/iio/health/afe440x.h:103:1: sparse: got }
   drivers/iio/health/afe440x.h:96:8: sparse: undefined identifier '_name_show'
   drivers/iio/health/afe4404.c:137:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
>> drivers/iio/health/afe4404.c:137:31: sparse: not a function <noident>
   drivers/iio/health/afe4404.c:138:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4404.c:139:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4404.c:140:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4404.c:141:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4404.c:142:9: sparse: undefined identifier 'AFE440X_INTENSITY_CHAN'
   drivers/iio/health/afe4404.c:142:31: sparse: not a function <noident>
   drivers/iio/health/afe4404.c:144:9: sparse: undefined identifier 'AFE440X_CURRENT_CHAN'
   drivers/iio/health/afe4404.c:145:9: sparse: undefined identifier 'AFE440X_CURRENT_CHAN'
   drivers/iio/health/afe4404.c:146:9: sparse: undefined identifier 'AFE440X_CURRENT_CHAN'
   drivers/iio/health/afe4404.c:179:45: sparse: undefined identifier 'to_afe440x_attr'
   drivers/iio/health/afe4404.c:184:57: sparse: using member 'field' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:188:36: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:191:31: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:192:31: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:203:45: sparse: undefined identifier 'to_afe440x_attr'
   drivers/iio/health/afe4404.c:210:41: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:211:33: sparse: using member 'val_table' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:214:32: sparse: using member 'table_size' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:217:15: sparse: using member 'field' in incomplete struct afe440x_attr
   drivers/iio/health/afe4404.c:237:10: sparse: undefined identifier 'dev_attr_in_intensity_resistance_available'
   drivers/iio/health/afe4404.c:238:10: sparse: undefined identifier 'dev_attr_in_intensity_capacitance_available'
   drivers/iio/health/afe4404.c:239:10: sparse: undefined identifier 'afe440x_attr_in_intensity1_resistance'
   drivers/iio/health/afe4404.c:240:10: sparse: undefined identifier 'afe440x_attr_in_intensity1_capacitance'
   drivers/iio/health/afe4404.c:241:10: sparse: undefined identifier 'afe440x_attr_in_intensity2_resistance'
   drivers/iio/health/afe4404.c:242:10: sparse: undefined identifier 'afe440x_attr_in_intensity2_capacitance'
   drivers/iio/health/afe4404.c:243:10: sparse: undefined identifier 'afe440x_attr_in_intensity3_resistance'
   drivers/iio/health/afe4404.c:244:10: sparse: undefined identifier 'afe440x_attr_in_intensity3_capacitance'
   drivers/iio/health/afe4404.c:245:10: sparse: undefined identifier 'afe440x_attr_in_intensity4_resistance'
   drivers/iio/health/afe4404.c:246:10: sparse: undefined identifier 'afe440x_attr_in_intensity4_capacitance'
   In file included from include/linux/kobject.h:21:0,
                    from include/linux/device.h:17,
                    from drivers/iio/health/afe4404.c:17:
   drivers/iio/health/afe440x.h:96:23: error: '_name_show' undeclared here (not in a function)
    static DEVICE_ATTR_RO(_name)
                          ^
   include/linux/sysfs.h:116:10: note: in definition of macro '__ATTR_RO'
     .show = _name##_show,      \
             ^~~~~
   drivers/iio/health/afe440x.h:96:8: note: in expansion of macro 'DEVICE_ATTR_RO'
    static DEVICE_ATTR_RO(_name)
           ^~~~~~~~~~~~~~
   In file included from drivers/iio/health/afe4404.c:34:0:
   drivers/iio/health/afe440x.h:98:1: error: expected ',' or ';' before 'struct'
    struct afe440x_attr {
    ^~~~~~
   drivers/iio/health/afe4404.c:137:2: error: implicit declaration of function 'AFE440X_INTENSITY_CHAN' [-Werror=implicit-function-declaration]
     AFE440X_INTENSITY_CHAN(LED2, BIT(IIO_CHAN_INFO_OFFSET)),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:137:2: error: initializer element is not constant
   drivers/iio/health/afe4404.c:137:2: note: (near initialization for 'afe4404_channels[0].type')
   drivers/iio/health/afe4404.c:138:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(ALED2, BIT(IIO_CHAN_INFO_OFFSET)),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:138:2: note: (near initialization for 'afe4404_channels[0].channel')
   drivers/iio/health/afe4404.c:139:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED1, BIT(IIO_CHAN_INFO_OFFSET)),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:139:2: note: (near initialization for 'afe4404_channels[0].channel2')
   drivers/iio/health/afe4404.c:140:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(ALED1, BIT(IIO_CHAN_INFO_OFFSET)),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:140:2: note: (near initialization for 'afe4404_channels[0].address')
   drivers/iio/health/afe4404.c:141:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED2_ALED2, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:141:2: note: (near initialization for 'afe4404_channels[0].scan_index')
   drivers/iio/health/afe4404.c:142:2: error: initializer element is not constant
     AFE440X_INTENSITY_CHAN(LED1_ALED1, 0),
     ^~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:142:2: note: (near initialization for 'afe4404_channels[0].scan_type.sign')
   drivers/iio/health/afe4404.c:144:2: error: implicit declaration of function 'AFE440X_CURRENT_CHAN' [-Werror=implicit-function-declaration]
     AFE440X_CURRENT_CHAN(LED2),
     ^~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:144:2: error: initializer element is not constant
   drivers/iio/health/afe4404.c:144:2: note: (near initialization for 'afe4404_channels[0].scan_type.realbits')
   drivers/iio/health/afe4404.c:145:2: error: initializer element is not constant
     AFE440X_CURRENT_CHAN(ALED2),
     ^~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:145:2: note: (near initialization for 'afe4404_channels[0].scan_type.storagebits')
   drivers/iio/health/afe4404.c:146:2: error: initializer element is not constant
     AFE440X_CURRENT_CHAN(LED1),
     ^~~~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:146:2: note: (near initialization for 'afe4404_channels[0].scan_type.shift')
   drivers/iio/health/afe4404.c:159:1: warning: data definition has no type or storage class
    AFE440X_TABLE_ATTR(in_intensity_resistance_available, afe4404_res_table);
    ^~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:159:1: error: type defaults to 'int' in declaration of 'AFE440X_TABLE_ATTR' [-Werror=implicit-int]
   drivers/iio/health/afe4404.c:159:1: warning: parameter names (without types) in function declaration
   drivers/iio/health/afe4404.c:171:1: warning: data definition has no type or storage class
    AFE440X_TABLE_ATTR(in_intensity_capacitance_available, afe4404_cap_table);
    ^~~~~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:171:1: error: type defaults to 'int' in declaration of 'AFE440X_TABLE_ATTR' [-Werror=implicit-int]
   drivers/iio/health/afe4404.c:171:1: warning: parameter names (without types) in function declaration
   drivers/iio/health/afe4404.c: In function 'afe440x_show_register':
   drivers/iio/health/afe4404.c:179:38: error: implicit declaration of function 'to_afe440x_attr' [-Werror=implicit-function-declaration]
     struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
                                         ^~~~~~~~~~~~~~~
   drivers/iio/health/afe4404.c:179:38: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
   drivers/iio/health/afe4404.c:184:50: error: dereferencing pointer to incomplete type 'struct afe440x_attr'
     ret = regmap_field_read(afe->fields[afe440x_attr->field], &reg_val);

vim +110 drivers/iio/health/afe4403.c

b36e8257 Andrew F. Davis 2016-05-01   94  static const unsigned int afe4403_channel_values[] = {
b36e8257 Andrew F. Davis 2016-05-01   95  	[LED2] = AFE440X_LED2VAL,
b36e8257 Andrew F. Davis 2016-05-01   96  	[ALED2] = AFE440X_ALED2VAL,
b36e8257 Andrew F. Davis 2016-05-01   97  	[LED1] = AFE440X_LED1VAL,
b36e8257 Andrew F. Davis 2016-05-01   98  	[ALED1] = AFE440X_ALED1VAL,
b36e8257 Andrew F. Davis 2016-05-01   99  	[LED2_ALED2] = AFE440X_LED2_ALED2VAL,
b36e8257 Andrew F. Davis 2016-05-01  100  	[LED1_ALED1] = AFE440X_LED1_ALED1VAL,
b36e8257 Andrew F. Davis 2016-05-01  101  };
b36e8257 Andrew F. Davis 2016-05-01  102  
b36e8257 Andrew F. Davis 2016-05-01  103  static const unsigned int afe4403_channel_leds[] = {
3ff34ee2 Andrew F. Davis 2016-05-01  104  	[LED2] = F_ILED2,
3ff34ee2 Andrew F. Davis 2016-05-01  105  	[LED1] = F_ILED1,
eec96d1e Andrew F. Davis 2016-02-06  106  };
eec96d1e Andrew F. Davis 2016-02-06  107  
eec96d1e Andrew F. Davis 2016-02-06  108  static const struct iio_chan_spec afe4403_channels[] = {
eec96d1e Andrew F. Davis 2016-02-06  109  	/* ADC values */
24b9dea7 Andrew F. Davis 2016-05-01 @110  	AFE440X_INTENSITY_CHAN(LED2, 0),
24b9dea7 Andrew F. Davis 2016-05-01  111  	AFE440X_INTENSITY_CHAN(ALED2, 0),
24b9dea7 Andrew F. Davis 2016-05-01  112  	AFE440X_INTENSITY_CHAN(LED1, 0),
24b9dea7 Andrew F. Davis 2016-05-01  113  	AFE440X_INTENSITY_CHAN(ALED1, 0),
24b9dea7 Andrew F. Davis 2016-05-01  114  	AFE440X_INTENSITY_CHAN(LED2_ALED2, 0),
24b9dea7 Andrew F. Davis 2016-05-01  115  	AFE440X_INTENSITY_CHAN(LED1_ALED1, 0),
eec96d1e Andrew F. Davis 2016-02-06  116  	/* LED current */
3ff34ee2 Andrew F. Davis 2016-05-01  117  	AFE440X_CURRENT_CHAN(LED2),
3ff34ee2 Andrew F. Davis 2016-05-01  118  	AFE440X_CURRENT_CHAN(LED1),

:::::: The code at line 110 was first introduced by commit
:::::: 24b9dea764bdf0de8434fb4567e7f62038ba869e iio: health/afe440x: Remove channel names

:::::: TO: Andrew F. Davis <afd@ti.com>
:::::: CC: Jonathan Cameron <jic23@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1614148 — [PATCH 2/3] iio: health: afe4404: Remove all unused functions

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-03-31 18:50 +0200
Subject[PATCH 2/3] iio: health: afe4404: Remove all unused functions
Message-ID<tr7Um-76y-17@gated-at.bofh.it>
In reply to#1614143
The functions afe440x_show_register and afe440x_store_register are never
used anywhere in the kernel. So, remove their definitions.
Grepped to find occurences.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/iio/health/afe4404.c | 51 --------------------------------------------
 1 file changed, 51 deletions(-)

diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c
index 964f523..168991a 100644
--- a/drivers/iio/health/afe4404.c
+++ b/drivers/iio/health/afe4404.c
@@ -170,57 +170,6 @@ static const struct afe440x_val_table afe4404_cap_table[] = {
 };
 AFE440X_TABLE_ATTR(in_intensity_capacitance_available, afe4404_cap_table);
 
-static ssize_t afe440x_show_register(struct device *dev,
-				     struct device_attribute *attr,
-				     char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct afe4404_data *afe = iio_priv(indio_dev);
-	struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
-	unsigned int reg_val;
-	int vals[2];
-	int ret;
-
-	ret = regmap_field_read(afe->fields[afe440x_attr->field], &reg_val);
-	if (ret)
-		return ret;
-
-	if (reg_val >= afe440x_attr->table_size)
-		return -EINVAL;
-
-	vals[0] = afe440x_attr->val_table[reg_val].integer;
-	vals[1] = afe440x_attr->val_table[reg_val].fract;
-
-	return iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, vals);
-}
-
-static ssize_t afe440x_store_register(struct device *dev,
-				      struct device_attribute *attr,
-				      const char *buf, size_t count)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct afe4404_data *afe = iio_priv(indio_dev);
-	struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
-	int val, integer, fract, ret;
-
-	ret = iio_str_to_fixpoint(buf, 100000, &integer, &fract);
-	if (ret)
-		return ret;
-
-	for (val = 0; val < afe440x_attr->table_size; val++)
-		if (afe440x_attr->val_table[val].integer == integer &&
-		    afe440x_attr->val_table[val].fract == fract)
-			break;
-	if (val == afe440x_attr->table_size)
-		return -EINVAL;
-
-	ret = regmap_field_write(afe->fields[afe440x_attr->field], val);
-	if (ret)
-		return ret;
-
-	return count;
-}
-
 static AFE440X_ATTR(in_intensity1_resistance, F_TIA_GAIN_SEP, afe4404_res_table);
 static AFE440X_ATTR(in_intensity1_capacitance, F_TIA_CF_SEP, afe4404_cap_table);
 
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1614150 — [PATCH 3/3] iio: health: afe4403: Remove all unused functions

Fromsimran singhal <singhalsimran0@gmail.com>
Date2017-03-31 18:50 +0200
Subject[PATCH 3/3] iio: health: afe4403: Remove all unused functions
Message-ID<tr7Um-76y-19@gated-at.bofh.it>
In reply to#1614143
The functions afe440x_show_register and afe440x_store_register are never
used anywhere in the kernel. So, remove their definitions.
Grepped to find occurences.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/iio/health/afe4403.c | 51 --------------------------------------------
 1 file changed, 51 deletions(-)

diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c
index 6bb23a4..3059014 100644
--- a/drivers/iio/health/afe4403.c
+++ b/drivers/iio/health/afe4403.c
@@ -136,57 +136,6 @@ static const struct afe440x_val_table afe4403_cap_table[] = {
 };
 AFE440X_TABLE_ATTR(in_intensity_capacitance_available, afe4403_cap_table);
 
-static ssize_t afe440x_show_register(struct device *dev,
-				     struct device_attribute *attr,
-				     char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct afe4403_data *afe = iio_priv(indio_dev);
-	struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
-	unsigned int reg_val;
-	int vals[2];
-	int ret;
-
-	ret = regmap_field_read(afe->fields[afe440x_attr->field], &reg_val);
-	if (ret)
-		return ret;
-
-	if (reg_val >= afe440x_attr->table_size)
-		return -EINVAL;
-
-	vals[0] = afe440x_attr->val_table[reg_val].integer;
-	vals[1] = afe440x_attr->val_table[reg_val].fract;
-
-	return iio_format_value(buf, IIO_VAL_INT_PLUS_MICRO, 2, vals);
-}
-
-static ssize_t afe440x_store_register(struct device *dev,
-				      struct device_attribute *attr,
-				      const char *buf, size_t count)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct afe4403_data *afe = iio_priv(indio_dev);
-	struct afe440x_attr *afe440x_attr = to_afe440x_attr(attr);
-	int val, integer, fract, ret;
-
-	ret = iio_str_to_fixpoint(buf, 100000, &integer, &fract);
-	if (ret)
-		return ret;
-
-	for (val = 0; val < afe440x_attr->table_size; val++)
-		if (afe440x_attr->val_table[val].integer == integer &&
-		    afe440x_attr->val_table[val].fract == fract)
-			break;
-	if (val == afe440x_attr->table_size)
-		return -EINVAL;
-
-	ret = regmap_field_write(afe->fields[afe440x_attr->field], val);
-	if (ret)
-		return ret;
-
-	return count;
-}
-
 static AFE440X_ATTR(in_intensity1_resistance, F_RF_LED, afe4403_res_table);
 static AFE440X_ATTR(in_intensity1_capacitance, F_CF_LED, afe4403_cap_table);
 
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1614258

FromSIMRAN SINGHAL <singhalsimran0@gmail.com>
Date2017-03-31 21:10 +0200
Message-ID<tra5P-eL-7@gated-at.bofh.it>
In reply to#1614143
Please ignore this Patch. As this patch is completely wrong due to
my lack of understanding.

On Fri, Mar 31, 2017 at 10:16 PM, simran singhal
<singhalsimran0@gmail.com> wrote:
> This patch-series removes commented code in afe440x.h and
> removes unused functions in afe4404.c and afe4403.c.
>
> simran singhal (3):
>   iio: health: afe440x: Remove code in comments
>   iio: health: afe4404: Remove all unused functions
>   iio: health: afe4403: Remove all unused functions
>
>  drivers/iio/health/afe4403.c | 51 --------------------------------------
>  drivers/iio/health/afe4404.c | 51 --------------------------------------
>  drivers/iio/health/afe440x.h | 58 --------------------------------------------
>  3 files changed, 160 deletions(-)
>
> --
> 2.7.4
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web