CC: [email protected] CC: [email protected] TO: Antoniu Miclaus <[email protected]> CC: Jonathan Cameron <[email protected]> CC: Cai Huoqing <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 commit: 0bb12606c05fe9737e3056fe76d6e4b9c2a87b57 iio:dac:ad7293: add support for AD7293 date: 7 weeks ago :::::: branch date: 19 hours ago :::::: commit date: 7 weeks ago config: nios2-randconfig-m031-20220124 (https://download.01.org/0day-ci/archive/20220124/[email protected]/config) compiler: nios2-linux-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: drivers/iio/dac/ad7293.c:524 ad7293_read_raw() error: uninitialized symbol 'data'. vim +/data +524 drivers/iio/dac/ad7293.c 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 475 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 476 static int ad7293_read_raw(struct iio_dev *indio_dev, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 477 struct iio_chan_spec const *chan, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 478 int *val, int *val2, long info) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 479 { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 480 struct ad7293_state *st = iio_priv(indio_dev); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 481 int ret; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 482 u16 data; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 483 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 484 switch (info) { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 485 case IIO_CHAN_INFO_RAW: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 486 switch (chan->type) { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 487 case IIO_VOLTAGE: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 488 if (chan->output) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 489 ret = ad7293_ch_read_raw(st, AD7293_DAC, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 490 chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 491 else 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 492 ret = ad7293_ch_read_raw(st, AD7293_ADC_VINX, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 493 chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 494 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 495 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 496 case IIO_CURRENT: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 497 ret = ad7293_ch_read_raw(st, AD7293_ADC_ISENSE, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 498 chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 499 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 500 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 501 case IIO_TEMP: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 502 ret = ad7293_ch_read_raw(st, AD7293_ADC_TSENSE, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 503 chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 504 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 505 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 506 default: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 507 return -EINVAL; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 508 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 509 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 510 if (ret) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 511 return ret; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 512 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 513 *val = data; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 514 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 515 return IIO_VAL_INT; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 516 case IIO_CHAN_INFO_OFFSET: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 517 switch (chan->type) { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 518 case IIO_VOLTAGE: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 519 if (chan->output) { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 520 ret = ad7293_get_offset(st, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 521 chan->channel + AD7293_VOUT_MIN_OFFSET_CH, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 522 &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 523 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 @524 data = FIELD_GET(AD7293_REG_VOUT_OFFSET_MSK, data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 525 } else { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 526 ret = ad7293_get_offset(st, chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 527 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 528 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 529 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 530 case IIO_CURRENT: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 531 ret = ad7293_get_offset(st, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 532 chan->channel + AD7293_ISENSE_MIN_OFFSET_CH, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 533 &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 534 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 535 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 536 case IIO_TEMP: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 537 ret = ad7293_get_offset(st, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 538 chan->channel + AD7293_TSENSE_MIN_OFFSET_CH, 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 539 &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 540 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 541 break; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 542 default: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 543 return -EINVAL; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 544 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 545 if (ret) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 546 return ret; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 547 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 548 *val = data; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 549 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 550 return IIO_VAL_INT; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 551 case IIO_CHAN_INFO_SCALE: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 552 switch (chan->type) { 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 553 case IIO_VOLTAGE: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 554 ret = ad7293_adc_get_scale(st, chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 555 if (ret) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 556 return ret; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 557 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 558 *val = data; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 559 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 560 return IIO_VAL_INT; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 561 case IIO_CURRENT: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 562 ret = ad7293_isense_get_scale(st, chan->channel, &data); 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 563 if (ret) 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 564 return ret; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 565 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 566 *val = data; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 567 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 568 return IIO_VAL_INT; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 569 case IIO_TEMP: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 570 *val = 1; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 571 *val2 = 8; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 572 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 573 return IIO_VAL_FRACTIONAL; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 574 default: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 575 return -EINVAL; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 576 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 577 default: 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 578 return -EINVAL; 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 579 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 580 } 0bb12606c05fe9 Antoniu Miclaus 2021-12-02 581 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
