Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joo Aun Saw and committed by
Jonathan Cameron
95ddd3f4 6b20f406

+7 -7
+6 -6
tools/iio/iio_utils.c
··· 286 286 * @cnt: the amount of array elements 287 287 **/ 288 288 289 - void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt) 289 + void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt) 290 290 { 291 291 struct iio_channel_info temp; 292 292 int x, y; 293 293 294 294 for (x = 0; x < cnt; x++) 295 295 for (y = 0; y < (cnt - 1); y++) 296 - if ((*ci_array)[y].index > (*ci_array)[y + 1].index) { 297 - temp = (*ci_array)[y + 1]; 298 - (*ci_array)[y + 1] = (*ci_array)[y]; 299 - (*ci_array)[y] = temp; 296 + if (ci_array[y].index > ci_array[y + 1].index) { 297 + temp = ci_array[y + 1]; 298 + ci_array[y + 1] = ci_array[y]; 299 + ci_array[y] = temp; 300 300 } 301 301 } 302 302 ··· 516 516 517 517 free(scan_el_dir); 518 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 521 return 0; 522 522
+1 -1
tools/iio/iio_utils.h
··· 60 60 int iioutils_get_param_float(float *output, const char *param_name, 61 61 const char *device_dir, const char *name, 62 62 const char *generic_name); 63 - void bsort_channel_array_by_index(struct iio_channel_info **ci_array, int cnt); 63 + void bsort_channel_array_by_index(struct iio_channel_info *ci_array, int cnt); 64 64 int build_channel_array(const char *device_dir, 65 65 struct iio_channel_info **ci_array, int *counter); 66 66 int find_type_by_name(const char *name, const char *type);