From: Joo Aun Saw Date: Fri, 24 Jul 2015 15:23:29 +0000 (+1000) Subject: tools: iio: remove unnecessary double pointer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95ddd3f4b17e1df20b5e23d7b81614e7c8a643da;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tools: iio: remove unnecessary double pointer Remove unnecessary double pointer from channel sorting function. Signed-off-by: Joo Aun Saw Signed-off-by: Jonathan Cameron --- 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: * @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; int x, y; for (x = 0; x < cnt; x++) for (y = 0; y < (cnt - 1); y++) - if ((*ci_array)[y].index > (*ci_array)[y + 1].index) { - temp = (*ci_array)[y + 1]; - (*ci_array)[y + 1] = (*ci_array)[y]; - (*ci_array)[y] = temp; + if (ci_array[y].index > ci_array[y + 1].index) { + temp = ci_array[y + 1]; + ci_array[y + 1] = ci_array[y]; + ci_array[y] = temp; } } @@ -516,7 +516,7 @@ int build_channel_array(const char *device_dir, free(scan_el_dir); /* 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; 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, int iioutils_get_param_float(float *output, const char *param_name, const char *device_dir, const char *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, struct iio_channel_info **ci_array, int *counter); int find_type_by_name(const char *name, const char *type);