summaryrefslogtreecommitdiffstats
path: root/tools/iio
diff options
context:
space:
mode:
authorJoo Aun Saw <jasaw@dius.com.au>2015-07-24 11:23:29 -0400
committerJonathan Cameron <jic23@kernel.org>2015-08-08 14:54:00 -0400
commit95ddd3f4b17e1df20b5e23d7b81614e7c8a643da (patch)
tree5635b52796aa2fd9973c3269b212bd4d54eb8c05 /tools/iio
parent6b20f40679108e3c04e9bdb3d719e364ec29289e (diff)
tools: iio: remove unnecessary double pointer
Remove unnecessary double pointer from channel sorting function. Signed-off-by: Joo Aun Saw <jasaw@dius.com.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio')
-rw-r--r--tools/iio/iio_utils.c12
-rw-r--r--tools/iio/iio_utils.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 8475b832ee39..5eb6793f3972 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -286,17 +286,17 @@ error_free_builtname:
286 * @cnt: the amount of array elements 286 * @cnt: the amount of array elements
287 **/ 287 **/
288 288
289void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt) 289void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt)
290{ 290{
291 struct iio_channel_info temp; 291 struct iio_channel_info temp;
292 int x, y; 292 int x, y;
293 293
294 for (x = 0; x < cnt; x++) 294 for (x = 0; x < cnt; x++)
295 for (y = 0; y < (cnt - 1); y++) 295 for (y = 0; y < (cnt - 1); y++)
296 if ((*ci_array)[y].index > (*ci_array)[y + 1].index) { 296 if (ci_array[y].index > ci_array[y + 1].index) {
297 temp = (*ci_array)[y + 1]; 297 temp = ci_array[y + 1];
298 (*ci_array)[y + 1] = (*ci_array)[y]; 298 ci_array[y + 1] = ci_array[y];
299 (*ci_array)[y] = temp; 299 ci_array[y] = temp;
300 } 300 }
301} 301}
302 302
@@ -516,7 +516,7 @@ int build_channel_array(const char *device_dir,
516 516
517 free(scan_el_dir); 517 free(scan_el_dir);
518 /* reorder so that the array is in index order */ 518 /* reorder so that the array is in index order */
519 bsort_channel_array_by_index(ci_array, *counter); 519 bsort_channel_array_by_index(*ci_array, *counter);
520 520
521 return 0; 521 return 0;
522 522
diff --git a/tools/iio/iio_utils.h b/tools/iio/iio_utils.h
index f30a1091b53e..e3503bfe538b 100644
--- a/tools/iio/iio_utils.h
+++ b/tools/iio/iio_utils.h
@@ -60,7 +60,7 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
60int iioutils_get_param_float(float *output, const char *param_name, 60int iioutils_get_param_float(float *output, const char *param_name,
61 const char *device_dir, const char *name, 61 const char *device_dir, const char *name,
62 const char *generic_name); 62 const char *generic_name);
63void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt); 63void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt);
64int build_channel_array(const char *device_dir, 64int build_channel_array(const char *device_dir,
65 struct iio_channel_info **ci_array, int *counter); 65 struct iio_channel_info **ci_array, int *counter);
66int find_type_by_name(const char *name, const char *type); 66int find_type_by_name(const char *name, const char *type);