From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "rrs@researchut.com" <rrs@researchut.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"jic23@kernel.org" <jic23@kernel.org>,
"hadess@hadess.net" <hadess@hadess.net>
Subject: Re: possible odd acceleration scaling
Date: Fri, 16 Sep 2016 22:30:20 +0000 [thread overview]
Message-ID: <1474064901.26681.5.camel@intel.com> (raw)
In-Reply-To: <1474060746.6389.38.camel@hadess.net>
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
On Fri, 2016-09-16 at 23:19 +0200, Bastien Nocera wrote:
> On Fri, 2016-09-16 at 19:40 +0000, Pandruvada, Srinivas wrote:
> >
> > On Fri, 2016-09-16 at 12:31 -0700, Srinivas Pandruvada wrote:
> > On Sat, 2016-09-17 at 00:05 +0530, Ritesh Raj Sarraf wrote:
> > >
> > >
> > > On Fri, 2016-09-16 at 23:56 +0530, Ritesh Raj Sarraf wrote:
> > > >
> > > >
> > > >
> > > > I'll also confirm for 4.7 soon.
> > >
> > > Verified on 4.7 too and it is all good.
> > Thanks.
> > I will send a pull request with this patch.
> >
> > Hi Bastien,
> >
> > My original pull request for issue #99 already had this change.
> > Somehow
> > when merged to main, this change was removed.
> > May be just revert and pull again.
> If you can explain the change, I'd be all for it, because I don't
> understand it.
Please check the attached patch with comments.
Thanks,
Srinivas
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-sorting-of-channels.patch --]
[-- Type: text/x-patch; name="0001-Fix-sorting-of-channels.patch", Size: 1205 bytes --]
From 6406d953fb65a838fe760d86a0b664128a343a03 Mon Sep 17 00:00:00 2001
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date: Fri, 16 Sep 2016 10:31:00 -0700
Subject: [PATCH] Fix sorting of channels
As per the documentation of g_ptr_array_sort
"Note that the comparison function for g_ptr_array_sort() doesn't take the
pointers from the array as arguments, it takes pointers to the pointers in
the array"
So the arguments to the function
compare_channel_index (gconstpointer a, gconstpointer b)
needs to be dereferenced to get pointer to iio_channel_info.
---
src/iio-buffer-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/iio-buffer-utils.c b/src/iio-buffer-utils.c
index 440a8b7..0b24bac 100644
--- a/src/iio-buffer-utils.c
+++ b/src/iio-buffer-utils.c
@@ -200,8 +200,8 @@ channel_info_free (iio_channel_info *ci)
static int
compare_channel_index (gconstpointer a, gconstpointer b)
{
- const iio_channel_info *info_1 = a;
- const iio_channel_info *info_2 = b;
+ const iio_channel_info *info_1 = *(iio_channel_info **) a;
+ const iio_channel_info *info_2 = *(iio_channel_info **) b;
return (int) (info_1->index - info_2->index);
}
--
2.7.4
next prev parent reply other threads:[~2016-09-16 22:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 17:30 possible odd acceleration scaling Ritesh Raj Sarraf
2016-09-13 17:50 ` Jonathan Cameron
2016-09-13 18:01 ` Jonathan Cameron
2016-09-13 19:06 ` Srinivas Pandruvada
2016-09-14 9:05 ` Ritesh Raj Sarraf
2016-09-14 9:28 ` Ritesh Raj Sarraf
2016-09-14 13:50 ` Ritesh Raj Sarraf
2016-09-14 15:28 ` Srinivas Pandruvada
2016-09-14 15:44 ` Bastien Nocera
2016-09-14 16:00 ` Ritesh Raj Sarraf
2016-09-16 17:43 ` Srinivas Pandruvada
2016-09-16 18:26 ` Ritesh Raj Sarraf
2016-09-16 18:35 ` Ritesh Raj Sarraf
2016-09-16 19:31 ` Srinivas Pandruvada
2016-09-16 19:40 ` Pandruvada, Srinivas
2016-09-16 21:19 ` Bastien Nocera
2016-09-16 22:30 ` Pandruvada, Srinivas [this message]
2016-09-16 22:51 ` Bastien Nocera
2016-09-14 11:34 ` Bastien Nocera
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=1474064901.26681.5.camel@intel.com \
--to=srinivas.pandruvada@intel.com \
--cc=hadess@hadess.net \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=rrs@researchut.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is 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).