Skip to content

Commit

Permalink
iiod/ops: Remove unused functions
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Molloy <[email protected]>
  • Loading branch information
pamolloy authored and dNechita committed Feb 11, 2025
1 parent cfe2b96 commit d687ea3
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions iiod/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,6 @@ struct sample_cb_info {
* clients */
static pthread_mutex_t devlist_lock = PTHREAD_MUTEX_INITIALIZER;

static unsigned int get_channel_number(const struct iio_channel *chn)
{
const struct iio_device *dev = iio_channel_get_device(chn);
const struct iio_channel *other;
unsigned int i = 0;

for (i = 0; i < iio_device_get_channels_count(dev); i++) {
other = iio_device_get_channel(dev, i);
if (other == chn)
break;
}

return i;
}

static inline const char *dev_label_or_name_or_id(const struct iio_device *dev)
{
const char *name;
Expand Down Expand Up @@ -794,48 +779,6 @@ static void remove_thd_entry(struct ThdEntry *t)
free_thd_entry(t);
}

static ssize_t get_dev_sample_size_mask(const struct iio_device *dev,
const uint32_t *mask, size_t words)
{
unsigned int i, len, number,
nb_channels = iio_device_get_channels_count(dev);
const struct iio_channel *prev = NULL;
const struct iio_channel *chn;
const struct iio_data_format *fmt;
long index;
ssize_t size = 0;

if (words != (nb_channels + 31) / 32)
return -EINVAL;

for (i = 0; i < nb_channels; i++) {
chn = iio_device_get_channel(dev, i);
number = get_channel_number(chn);
fmt = iio_channel_get_data_format(chn);
index = iio_channel_get_index(chn);
len = fmt->length / 8 * fmt->repeat;

if (index < 0)
break;
if (!TEST_BIT(mask, number))
continue;

if (prev && index == iio_channel_get_index(prev)) {
prev = chn;
continue;
}

if (size % len)
size += 2 * len - (size % len);
else
size += len;

prev = chn;
}

return size;
}

static int open_dev_helper(struct parser_pdata *pdata, struct iio_device *dev,
size_t samples_count, uint32_t *words, bool cyclic)
{
Expand Down

0 comments on commit d687ea3

Please sign in to comment.