Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ config AD4630
select IIO_BUFFER
select IIO_BUFFER_DMA
select IIO_BUFFER_DMAENGINE
select SPI_OFFLOAD
help
Say yes here to build support for Analog Devices AD4630 high speed
SPI analog to digital converters (ADC).
Expand Down
5 changes: 2 additions & 3 deletions drivers/iio/adc/ad4630.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
if (ret)
return ret;

*val = temp;

Check warning on line 383 in drivers/iio/adc/ad4630.c

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

gcc_fanalayzer: use of uninitialized value 'temp' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 383 | *val = temp; | ~~~~~^~~~~~ 'ad4630_read_raw': events 1-6 | | 343 | static int ad4630_read_raw(struct iio_dev *indio_dev, | | ^~~~~~~~~~~~~~~ | | | | | (1) entry to 'ad4630_read_raw' |...... | 348 | unsigned int temp; | | ~~~~ | | | | | (2) region created on stack here | | (3) capacity: 4 bytes |...... | 351 | switch (info) { | | ~~~~~~ | | | | | (4) following 'case 26:' branch... |...... | 378 | case IIO_CHAN_INFO_OVERSAMPLING_RATIO: | | ~~~~ | | | | | (5) ...to here | 379 | ret = ad4630_get_avg_frame_len(indio_dev, &temp); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (6) calling 'ad4630_get_avg_frame_len' from 'ad4630_read_raw' | +--> 'ad4630_get_avg_frame_len': events 7-9 | | 322 | static int ad4630_get_avg_frame_len(struct iio_dev *dev, unsigned int *avg_len) | | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (7) entry to 'ad4630_get_avg_frame_len' |...... | 333 | if (ret) | | ~ | | | | | (8) following 'true' branch (when 'ret != 0')... | 334 | goto out; | | ~~~~ | | | | | (9) ...to here | <------+ | 'ad4630_read_raw': events 10-13 | | 379 | ret = ad4630_get_avg_frame_len(indio_dev, &temp); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (10) returning to 'ad4630_read_raw' from 'ad4630_get_avg_frame_len' | 380 | if (ret) | | ~ | | | | | (11) following 'false' branch (when 'ret == 0')... |...... | 383 | *val = temp; | | ~~~~~~~~~~~ | | | | | (12) ...to here | | (13) use of uninitialized value 'temp' here |

Check warning on line 383 in drivers/iio/adc/ad4630.c

View workflow job for this annotation

GitHub Actions / build_llvm_x86_64 / build

clang_analyzer: Assigned value is garbage or undefined [core.uninitialized.Assign] 383 | *val = temp; | ^ ~~~~

return IIO_VAL_INT;
default:
Expand Down Expand Up @@ -536,7 +536,7 @@
val = mult_frac(val, ad4630_gains_frac[i][1] * MILLI,
ad4630_gains_frac[i][0]);
/* Would multiply by NANO here but we already multiplied by MILLI */
tmp2 = shift_right((u64)val * MICRO, val2);

Check warning on line 539 in drivers/iio/adc/ad4630.c

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

smatch: unsigned '__x' is never less than zero.
tmp0 = (int)div_s64_rem(tmp2, NANO, &tmp1);
st->scale_tbl[i][0] = tmp0; /* Integer part */
st->scale_tbl[i][1] = abs(tmp1); /* Fractional part */
Expand Down Expand Up @@ -1585,9 +1585,8 @@
return 0;
}

static const struct dev_pm_ops ad4630_pm_ops = {
SET_RUNTIME_PM_OPS(ad4630_runtime_suspend, ad4630_runtime_resume, NULL)
};
static DEFINE_SIMPLE_DEV_PM_OPS(ad4630_pm_ops, ad4630_runtime_suspend,
ad4630_runtime_resume);

static const struct spi_device_id ad4630_id_table[] = {
{ "ad4030-24", (kernel_ulong_t)&ad4630_chip_info[ID_AD4030_24] },
Expand Down
Loading