From: Jonathan Cameron <jic23@kernel.org>
To: "Gaurav Gupta (gauragup)" <gauragup@cisco.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
"knaack.h@gmx.de" <knaack.h@gmx.de>,
"lars@metafoo.de" <lars@metafoo.de>,
"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: core: Fix mapping of iio channels to entry numbers
Date: Sat, 15 Jul 2017 13:51:03 +0100 [thread overview]
Message-ID: <20170715135103.4b501824@kernel.org> (raw)
In-Reply-To: <39A26AA9-5143-454A-BF38-95D71BB9F757@cisco.com>
On Fri, 14 Jul 2017 16:51:12 +0000
"Gaurav Gupta (gauragup)" <gauragup@cisco.com> wrote:
> Hi Jonathan,
>
> Just wondering if you foresee any issues with this change or any further changes that need to happen as a side-effect of this?
This still makes me nervous so I'm going to take the cautious route of pushing it
out via the slow path of the next merge window. If no one shouts for a month
or so after that, we can request a backport to stable.
So applied to the togreg branch of iio.git.
Jonathan
>
> Thanks,
> Gaurav
>
> On 7/1/17, 11:46 AM, "linux-iio-owner@vger.kernel.org on behalf of Guenter Roeck" <linux-iio-owner@vger.kernel.org on behalf of linux@roeck-us.net> wrote:
>
> On 07/01/2017 10:40 AM, Jonathan Cameron wrote:
> > On Tue, 27 Jun 2017 09:46:01 -0700
> > Gaurav Gupta <gauragup@cisco.com> wrote:
> >
> >> When adding maps to the list, they were added using list_add, which adds
> >> them in LIFO order. When parsing using iio_channel_get_all(), these
> >> elements are hence returned in reverse order. As a result, the iio_hwmon
> >> mapping maps the first entry to the last channel and so on.
> >>
> >> Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
> > Gah. This is one of those nasty cases where I clearly messed up a
> > long time ago, but unfortunately it's become user space ABI.
> >
> > So looking for general opinions on whether we can fix this one
> > or not. I can't immediately think of a clean way to tidy this up.
> >
> > So do we think people will notice if we fix this?
> >
>
> I would just go for it.
>
> Guenter
>
> > Jonathan
> >> ---
> >> drivers/iio/inkern.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> >> index 7a13535..9b0715c 100644
> >> --- a/drivers/iio/inkern.c
> >> +++ b/drivers/iio/inkern.c
> >> @@ -44,7 +44,7 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
> >> }
> >> mapi->map = &maps[i];
> >> mapi->indio_dev = indio_dev;
> >> - list_add(&mapi->l, &iio_map_list);
> >> + list_add_tail(&mapi->l, &iio_map_list);
> >> i++;
> >> }
> >> error_ret:
> >
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
prev parent reply other threads:[~2017-07-15 12:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 16:46 [PATCH] iio: core: Fix mapping of iio channels to entry numbers Gaurav Gupta
2017-07-01 17:40 ` Jonathan Cameron
2017-07-01 18:46 ` Guenter Roeck
2017-07-14 16:51 ` Gaurav Gupta (gauragup)
2017-07-15 12:51 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170715135103.4b501824@kernel.org \
--to=jic23@kernel.org \
--cc=gauragup@cisco.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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).