Skip to content

Commit

Permalink
examples/ad9371-iiostream: Fix comment and variables
Browse files Browse the repository at this point in the history
- Remove unused variables
- The uninitialized variable should never be read since the example will
  exit() if an error occurs. A warning was only generated with the macOS
  builds, not the x86 or ARM Linux builds.

Signed-off-by: Philip Molloy <[email protected]>
  • Loading branch information
pamolloy committed Jul 18, 2024
1 parent 2b12c94 commit 14ef974
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/ad9371-iiostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ static void wr_ch_lli(struct iio_channel *chn, const char* what, long long val)
errchk(attr ? iio_attr_write_longlong(attr, val) : -ENOENT, what);
}

/* write attribute: long long int */
/* read attribute: long long int */
static long long rd_ch_lli(struct iio_channel *chn, const char* what)
{
const struct iio_attr *attr = iio_channel_find_attr(chn, what);
long long val;
long long val = 0;

errchk(attr ? iio_attr_read_longlong(attr, &val) : -ENOENT, what);

Expand Down Expand Up @@ -194,10 +194,6 @@ int main (__notused int argc, __notused char **argv)
struct iio_device *tx;
struct iio_device *rx;

// RX and TX sample counters
size_t nrx = 0;
size_t ntx = 0;

// RX and TX sample size
size_t rx_sample_sz, tx_sample_sz;

Expand Down

0 comments on commit 14ef974

Please sign in to comment.