Re: [PATCH V0 2/2] iio: adc: sprd_pmic_adc: Add support for UMP serise pmic adc

From: Jonathan Cameron
Date: Mon Aug 28 2023 - 10:38:54 EST


On Wed, 16 Aug 2023 22:07:15 +0800
kernel test robot <lkp@xxxxxxxxx> wrote:

> Hi Mingjin,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on robh/for-next]
> [also build test WARNING on linus/master v6.5-rc6 next-20230816]
> [cannot apply to jic23-iio/togreg]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Mingjin-Yang/dt-bindings-iio-adc-Add-support-for-ump518-pmic-adc/20230816-160754
> base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
> patch link: https://lore.kernel.org/r/20230816080225.21482-3-mingjin.yang%40unisoc.com
> patch subject: [PATCH V0 2/2] iio: adc: sprd_pmic_adc: Add support for UMP serise pmic adc
> config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230816/202308162143.UjXhwiRf-lkp@xxxxxxxxx/config)
> compiler: m68k-linux-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230816/202308162143.UjXhwiRf-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308162143.UjXhwiRf-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
> drivers/iio/adc/sprd_pmic_adc.c: In function 'ump9620_ch_data_init':
> >> drivers/iio/adc/sprd_pmic_adc.c:530:1: warning: the frame size of 1320 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 530 | }
> | ^
>
>
> vim +530 drivers/iio/adc/sprd_pmic_adc.c
>
> 506
> 507 static void ump9620_ch_data_init(struct sprd_adc_data *data)
> 508 {
> 509 struct sprd_adc_channel_data ch_data_def = CH_DATA_INIT(SCALE_00, 0, 0, RATIO_DEF);
> 510 struct sprd_adc_channel_data ch_data[SPRD_ADC_CHANNEL_MAX] = {

Make these both const and I think the compiler will move these off the stack thus
solving the issue seen.

> 511 [0] = CH_DATA_INIT(SCALE_01, 0, 0, RATIO_DEF),
> 512 [5] = CH_DATA_INIT(SCALE_00, 0x1, 0x9, RATIO_DEF),
> 513 [6] = CH_DATA_INIT(SCALE_00, 0x1, 0x9, RATIO_DEF),
> 514 [7] = CH_DATA_INIT(SCALE_10, 0, 0, RATIO_DEF),
> 515 [9] = CH_DATA_INIT(SCALE_10, 0, 0, RATIO_DEF),
> 516 [10] = CH_DATA_INIT(SCALE_11, 0, 0, RATIO_DEF),
> 517 [11] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO_DEF),
> 518 [13] = CH_DATA_INIT(SCALE_01, 0, 0, RATIO_DEF),
> 519 [14] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO(68, 900)),
> 520 [15] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO(1, 3)),
> 521 [19] = CH_DATA_INIT(SCALE_11, 0, 0, RATIO_DEF),
> 522 [21] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO(3, 8)),
> 523 [22] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO(3, 8)),
> 524 [23] = CH_DATA_INIT(SCALE_00, 0, 0, RATIO(3, 8)),
> 525 [30] = CH_DATA_INIT(SCALE_11, 0, 0, RATIO_DEF),
> 526 [31] = CH_DATA_INIT(SCALE_11, 0, 0, RATIO_DEF),
> 527 };
> 528
> 529 sprd_adc_ch_data_merge(data, ch_data, &ch_data_def);

> > 530 }
> 531
>