Commit 95ddd3f4 authored by Joo Aun Saw's avatar Joo Aun Saw Committed by Jonathan Cameron

tools: iio: remove unnecessary double pointer

Remove unnecessary double pointer from channel sorting function.
Signed-off-by: default avatarJoo Aun Saw <jasaw@dius.com.au>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 6b20f406
...@@ -286,17 +286,17 @@ int iioutils_get_param_float(float *output, const char *param_name, ...@@ -286,17 +286,17 @@ int iioutils_get_param_float(float *output, const char *param_name,
* @cnt: the amount of array elements * @cnt: the amount of array elements
**/ **/
void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt) void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt)
{ {
struct iio_channel_info temp; struct iio_channel_info temp;
int x, y; int x, y;
for (x = 0; x < cnt; x++) for (x = 0; x < cnt; x++)
for (y = 0; y < (cnt - 1); y++) for (y = 0; y < (cnt - 1); y++)
if ((*ci_array)[y].index > (*ci_array)[y + 1].index) { if (ci_array[y].index > ci_array[y + 1].index) {
temp = (*ci_array)[y + 1]; temp = ci_array[y + 1];
(*ci_array)[y + 1] = (*ci_array)[y]; ci_array[y + 1] = ci_array[y];
(*ci_array)[y] = temp; ci_array[y] = temp;
} }
} }
...@@ -516,7 +516,7 @@ int build_channel_array(const char *device_dir, ...@@ -516,7 +516,7 @@ int build_channel_array(const char *device_dir,
free(scan_el_dir); free(scan_el_dir);
/* reorder so that the array is in index order */ /* reorder so that the array is in index order */
bsort_channel_array_by_index(ci_array, *counter); bsort_channel_array_by_index(*ci_array, *counter);
return 0; return 0;
......
...@@ -60,7 +60,7 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used, ...@@ -60,7 +60,7 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
int iioutils_get_param_float(float *output, const char *param_name, int iioutils_get_param_float(float *output, const char *param_name,
const char *device_dir, const char *name, const char *device_dir, const char *name,
const char *generic_name); const char *generic_name);
void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt); void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt);
int build_channel_array(const char *device_dir, int build_channel_array(const char *device_dir,
struct iio_channel_info **ci_array, int *counter); struct iio_channel_info **ci_array, int *counter);
int find_type_by_name(const char *name, const char *type); int find_type_by_name(const char *name, const char *type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment