linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: buffer: remove attrcount_orig var from sysfs creation
@ 2020-05-11 12:53 Alexandru Ardelean
  2020-05-16 16:57 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2020-05-11 12:53 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

The variable no longer does anything.
It should have been removed with commit 2e036804d773e ("iio: buffer: remove
'scan_el_attrs' attribute group from buffer struct").
That was about the last time this was needed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---

If desired (and still possible) this can be squashed in
commit 2e036804d773e ("iio: buffer: remove 'scan_el_attrs' attribute group
from buffer struct").

 drivers/iio/industrialio-buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index eae39eaf49af..386c9231c2ee 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -1244,7 +1244,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
 	struct iio_dev_attr *p;
 	struct attribute **attr;
 	struct iio_buffer *buffer = indio_dev->buffer;
-	int ret, i, attrn, attrcount, attrcount_orig = 0;
+	int ret, i, attrn, attrcount;
 	const struct iio_chan_spec *channels;
 
 	channels = indio_dev->channels;
@@ -1288,7 +1288,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
 
 	indio_dev->groups[indio_dev->groupcounter++] = &buffer->buffer_group;
 
-	attrcount = attrcount_orig;
+	attrcount = 0;
 	INIT_LIST_HEAD(&buffer->scan_el_dev_attr_list);
 	channels = indio_dev->channels;
 	if (channels) {
@@ -1325,7 +1325,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
 		ret = -ENOMEM;
 		goto error_free_scan_mask;
 	}
-	attrn = attrcount_orig;
+	attrn = 0;
 
 	list_for_each_entry(p, &buffer->scan_el_dev_attr_list, l)
 		buffer->scan_el_group.attrs[attrn++] = &p->dev_attr.attr;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: buffer: remove attrcount_orig var from sysfs creation
  2020-05-11 12:53 [PATCH] iio: buffer: remove attrcount_orig var from sysfs creation Alexandru Ardelean
@ 2020-05-16 16:57 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-05-16 16:57 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Mon, 11 May 2020 15:53:22 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> The variable no longer does anything.
> It should have been removed with commit 2e036804d773e ("iio: buffer: remove
> 'scan_el_attrs' attribute group from buffer struct").
> That was about the last time this was needed.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to hopefully not notice it.

Thanks,

Jonathan

> ---
> 
> If desired (and still possible) this can be squashed in
> commit 2e036804d773e ("iio: buffer: remove 'scan_el_attrs' attribute group
> from buffer struct").
> 
>  drivers/iio/industrialio-buffer.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index eae39eaf49af..386c9231c2ee 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -1244,7 +1244,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
>  	struct iio_dev_attr *p;
>  	struct attribute **attr;
>  	struct iio_buffer *buffer = indio_dev->buffer;
> -	int ret, i, attrn, attrcount, attrcount_orig = 0;
> +	int ret, i, attrn, attrcount;
>  	const struct iio_chan_spec *channels;
>  
>  	channels = indio_dev->channels;
> @@ -1288,7 +1288,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
>  
>  	indio_dev->groups[indio_dev->groupcounter++] = &buffer->buffer_group;
>  
> -	attrcount = attrcount_orig;
> +	attrcount = 0;
>  	INIT_LIST_HEAD(&buffer->scan_el_dev_attr_list);
>  	channels = indio_dev->channels;
>  	if (channels) {
> @@ -1325,7 +1325,7 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
>  		ret = -ENOMEM;
>  		goto error_free_scan_mask;
>  	}
> -	attrn = attrcount_orig;
> +	attrn = 0;
>  
>  	list_for_each_entry(p, &buffer->scan_el_dev_attr_list, l)
>  		buffer->scan_el_group.attrs[attrn++] = &p->dev_attr.attr;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-16 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-11 12:53 [PATCH] iio: buffer: remove attrcount_orig var from sysfs creation Alexandru Ardelean
2020-05-16 16:57 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).