CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: "Nuno Sá" <nuno...@analog.com> CC: Jonathan Cameron <jonathan.came...@huawei.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e commit: 832cb9eeb9312dd2e14133681d3920b773ef1eac iio: dac: add support for ltc2688 date: 6 weeks ago :::::: branch date: 19 hours ago :::::: commit date: 6 weeks ago compiler: arc-elf-gcc (GCC) 11.2.0 reproduce (cppcheck warning): # apt-get install cppcheck git checkout 832cb9eeb9312dd2e14133681d3920b773ef1eac cppcheck --quiet --enable=style,performance,portability --template=gcc FILE If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <l...@intel.com> cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> drivers/iio/dac/ltc2688.c:859:70: warning: Parameter 'vref' can be declared >> with const [constParameter] static int ltc2688_setup(struct ltc2688_state *st, struct regulator *vref) ^ vim +/vref +859 drivers/iio/dac/ltc2688.c 832cb9eeb9312d Nuno Sá 2022-02-25 858 832cb9eeb9312d Nuno Sá 2022-02-25 @859 static int ltc2688_setup(struct ltc2688_state *st, struct regulator *vref) 832cb9eeb9312d Nuno Sá 2022-02-25 860 { 832cb9eeb9312d Nuno Sá 2022-02-25 861 struct gpio_desc *gpio; 832cb9eeb9312d Nuno Sá 2022-02-25 862 int ret; 832cb9eeb9312d Nuno Sá 2022-02-25 863 832cb9eeb9312d Nuno Sá 2022-02-25 864 /* 832cb9eeb9312d Nuno Sá 2022-02-25 865 * If we have a reset pin, use that to reset the board, If not, use 832cb9eeb9312d Nuno Sá 2022-02-25 866 * the reset bit. 832cb9eeb9312d Nuno Sá 2022-02-25 867 */ 832cb9eeb9312d Nuno Sá 2022-02-25 868 gpio = devm_gpiod_get_optional(&st->spi->dev, "clr", GPIOD_OUT_HIGH); 832cb9eeb9312d Nuno Sá 2022-02-25 869 if (IS_ERR(gpio)) 832cb9eeb9312d Nuno Sá 2022-02-25 870 return dev_err_probe(&st->spi->dev, PTR_ERR(gpio), 832cb9eeb9312d Nuno Sá 2022-02-25 871 "Failed to get reset gpio"); 832cb9eeb9312d Nuno Sá 2022-02-25 872 if (gpio) { 832cb9eeb9312d Nuno Sá 2022-02-25 873 usleep_range(1000, 1200); 832cb9eeb9312d Nuno Sá 2022-02-25 874 /* bring device out of reset */ 832cb9eeb9312d Nuno Sá 2022-02-25 875 gpiod_set_value_cansleep(gpio, 0); 832cb9eeb9312d Nuno Sá 2022-02-25 876 } else { 832cb9eeb9312d Nuno Sá 2022-02-25 877 ret = regmap_update_bits(st->regmap, LTC2688_CMD_CONFIG, 832cb9eeb9312d Nuno Sá 2022-02-25 878 LTC2688_CONFIG_RST, 832cb9eeb9312d Nuno Sá 2022-02-25 879 LTC2688_CONFIG_RST); 832cb9eeb9312d Nuno Sá 2022-02-25 880 if (ret) 832cb9eeb9312d Nuno Sá 2022-02-25 881 return ret; 832cb9eeb9312d Nuno Sá 2022-02-25 882 } 832cb9eeb9312d Nuno Sá 2022-02-25 883 832cb9eeb9312d Nuno Sá 2022-02-25 884 usleep_range(10000, 12000); 832cb9eeb9312d Nuno Sá 2022-02-25 885 832cb9eeb9312d Nuno Sá 2022-02-25 886 /* 832cb9eeb9312d Nuno Sá 2022-02-25 887 * Duplicate the default channel configuration as it can change during 832cb9eeb9312d Nuno Sá 2022-02-25 888 * @ltc2688_channel_config() 832cb9eeb9312d Nuno Sá 2022-02-25 889 */ 832cb9eeb9312d Nuno Sá 2022-02-25 890 st->iio_chan = devm_kmemdup(&st->spi->dev, ltc2688_channels, 832cb9eeb9312d Nuno Sá 2022-02-25 891 sizeof(ltc2688_channels), GFP_KERNEL); 832cb9eeb9312d Nuno Sá 2022-02-25 892 if (!st->iio_chan) 832cb9eeb9312d Nuno Sá 2022-02-25 893 return -ENOMEM; 832cb9eeb9312d Nuno Sá 2022-02-25 894 832cb9eeb9312d Nuno Sá 2022-02-25 895 ret = ltc2688_channel_config(st); 832cb9eeb9312d Nuno Sá 2022-02-25 896 if (ret) 832cb9eeb9312d Nuno Sá 2022-02-25 897 return ret; 832cb9eeb9312d Nuno Sá 2022-02-25 898 832cb9eeb9312d Nuno Sá 2022-02-25 899 if (!vref) 832cb9eeb9312d Nuno Sá 2022-02-25 900 return 0; 832cb9eeb9312d Nuno Sá 2022-02-25 901 832cb9eeb9312d Nuno Sá 2022-02-25 902 return regmap_set_bits(st->regmap, LTC2688_CMD_CONFIG, 832cb9eeb9312d Nuno Sá 2022-02-25 903 LTC2688_CONFIG_EXT_REF); 832cb9eeb9312d Nuno Sá 2022-02-25 904 } 832cb9eeb9312d Nuno Sá 2022-02-25 905 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org