From: kernel test robot <lkp@intel.com>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, Guenter Roeck <groeck@chromium.org>
Subject: drivers/platform/chrome/cros_ec_proto_test.c:2530:13: warning: stack frame size (1040) exceeds limit (1024) in 'cros_ec_proto_test_get_sensor_count_legacy'
Date: Tue, 31 Jan 2023 18:22:29 +0800 [thread overview]
Message-ID: <202301311846.Y75Dbssa-lkp@intel.com> (raw)
Hi Tzung-Bi,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 22b8077d0fcec86c6ed0e0fce9f7e7e5a4c2d56a
commit: 33f0fdba6066b504ee0b5f1480b1f93b06050df6 platform/chrome: cros_ec_proto: add Kunit tests for get_sensor_count
date: 7 months ago
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20230131/202301311846.Y75Dbssa-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 4196ca3278f78c6e19246e54ab0ecb364e37d66a)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=33f0fdba6066b504ee0b5f1480b1f93b06050df6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 33f0fdba6066b504ee0b5f1480b1f93b06050df6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/steering/ drivers/platform/chrome/ drivers/staging/media/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/platform/chrome/cros_ec_proto_test.c:2530:13: warning: stack frame size (1040) exceeds limit (1024) in 'cros_ec_proto_test_get_sensor_count_legacy' [-Wframe-larger-than]
static void cros_ec_proto_test_get_sensor_count_legacy(struct kunit *test)
^
140/1040 (13.46%) spills, 900/1040 (86.54%) variables
1 warning generated.
vim +/cros_ec_proto_test_get_sensor_count_legacy +2530 drivers/platform/chrome/cros_ec_proto_test.c
2529
> 2530 static void cros_ec_proto_test_get_sensor_count_legacy(struct kunit *test)
2531 {
2532 struct cros_ec_proto_test_priv *priv = test->priv;
2533 struct cros_ec_device *ec_dev = &priv->ec_dev;
2534 struct ec_xfer_mock *mock;
2535 int ret, i;
2536 struct cros_ec_dev ec;
2537 struct {
2538 u8 readmem_data;
2539 int expected_result;
2540 } test_data[] = {
2541 { 0, 0 },
2542 { EC_MEMMAP_ACC_STATUS_PRESENCE_BIT, 2 },
2543 };
2544
2545 ec_dev->max_request = 0xff;
2546 ec_dev->max_response = 0xee;
2547 ec_dev->cmd_readmem = cros_kunit_readmem_mock;
2548 ec.ec_dev = ec_dev;
2549 ec.dev = ec_dev->dev;
2550 ec.cmd_offset = 0;
2551
2552 for (i = 0; i < ARRAY_SIZE(test_data); ++i) {
2553 /* For EC_CMD_MOTION_SENSE_CMD. */
2554 {
2555 mock = cros_kunit_ec_xfer_mock_addx(test, -EPROTO, EC_RES_SUCCESS, 0);
2556 KUNIT_ASSERT_PTR_NE(test, mock, NULL);
2557 }
2558
2559 /* For readmem. */
2560 {
2561 cros_kunit_readmem_mock_data = kunit_kzalloc(test, 1, GFP_KERNEL);
2562 KUNIT_ASSERT_PTR_NE(test, cros_kunit_readmem_mock_data, NULL);
2563 cros_kunit_readmem_mock_data[0] = test_data[i].readmem_data;
2564
2565 cros_kunit_ec_xfer_mock_default_ret = 1;
2566 }
2567
2568 ret = cros_ec_get_sensor_count(&ec);
2569 KUNIT_EXPECT_EQ(test, ret, test_data[i].expected_result);
2570
2571 /* For EC_CMD_MOTION_SENSE_CMD. */
2572 {
2573 struct ec_params_motion_sense *data;
2574
2575 mock = cros_kunit_ec_xfer_mock_next();
2576 KUNIT_EXPECT_PTR_NE(test, mock, NULL);
2577
2578 KUNIT_EXPECT_EQ(test, mock->msg.version, 1);
2579 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MOTION_SENSE_CMD);
2580 KUNIT_EXPECT_EQ(test, mock->msg.insize,
2581 sizeof(struct ec_response_motion_sense));
2582 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data));
2583
2584 data = (struct ec_params_motion_sense *)mock->i_data;
2585 KUNIT_EXPECT_EQ(test, data->cmd, MOTIONSENSE_CMD_DUMP);
2586 }
2587
2588 /* For readmem. */
2589 {
2590 KUNIT_EXPECT_EQ(test, cros_kunit_readmem_mock_offset, EC_MEMMAP_ACC_STATUS);
2591 }
2592 }
2593 }
2594
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-01-31 10:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-31 10:22 kernel test robot [this message]
2023-01-31 15:19 ` drivers/platform/chrome/cros_ec_proto_test.c:2530:13: warning: stack frame size (1040) exceeds limit (1024) in 'cros_ec_proto_test_get_sensor_count_legacy' Tzung-Bi Shih
-- strict thread matches above, loose matches on Subject: below --
2023-02-18 0:35 kernel test robot
2023-01-14 2:28 kernel test robot
2023-01-17 8:11 ` Tzung-Bi Shih
2022-12-17 22:00 kernel test robot
2022-12-03 11:16 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202301311846.Y75Dbssa-lkp@intel.com \
--to=lkp@intel.com \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tzungbi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.