From: Guenter Roeck <linux@roeck-us.net>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: bleung@chromium.org, groeck@chromium.org,
chrome-platform@lists.linux.dev, llvm@lists.linux.dev,
oe-kbuild-all@lists.linux.dev, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] platform/chrome: cros_ec_proto: remove big stub objects from stack
Date: Tue, 17 Jan 2023 08:24:51 -0800 [thread overview]
Message-ID: <20230117162451.GA4097956@roeck-us.net> (raw)
In-Reply-To: <20230117080254.2725536-1-tzungbi@kernel.org>
On Tue, Jan 17, 2023 at 04:02:54PM +0800, Tzung-Bi Shih wrote:
> sizeof(struct device) = 680
> sizeof(struct cros_ec_dev) = 720
>
> They tend to exceed the stack frame size limit in some specific
> environment which results in the following compilation error:
>
> >> drivers/platform/chrome/cros_ec_proto_test.c:2530:13: error: stack
> frame size (2128) exceeds limit (2048) in
> 'cros_ec_proto_test_get_sensor_count_legacy'
>
> Remove the big stub objects from stack.
>
> This is:
> $ sed -i 's/struct cros_ec_dev /static struct cros_ec_dev /' \
> drivers/platform/chrome/cros_ec_proto_test.c
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/platform/chrome/cros_ec_proto_test.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
> index 08c58d031593..5b9748e0463b 100644
> --- a/drivers/platform/chrome/cros_ec_proto_test.c
> +++ b/drivers/platform/chrome/cros_ec_proto_test.c
> @@ -2371,7 +2371,7 @@ static void cros_ec_proto_test_get_host_event_normal(struct kunit *test)
> static void cros_ec_proto_test_check_features_cached(struct kunit *test)
> {
> int ret, i;
> - struct cros_ec_dev ec;
> + static struct cros_ec_dev ec;
>
> ec.features.flags[0] = EC_FEATURE_MASK_0(EC_FEATURE_FINGERPRINT);
> ec.features.flags[1] = EC_FEATURE_MASK_0(EC_FEATURE_SCP);
> @@ -2396,7 +2396,7 @@ static void cros_ec_proto_test_check_features_not_cached(struct kunit *test)
> struct cros_ec_device *ec_dev = &priv->ec_dev;
> struct ec_xfer_mock *mock;
> int ret, i;
> - struct cros_ec_dev ec;
> + static struct cros_ec_dev ec;
>
> ec_dev->max_request = 0xff;
> ec_dev->max_response = 0xee;
> @@ -2449,7 +2449,7 @@ static void cros_ec_proto_test_get_sensor_count_normal(struct kunit *test)
> struct cros_ec_device *ec_dev = &priv->ec_dev;
> struct ec_xfer_mock *mock;
> int ret;
> - struct cros_ec_dev ec;
> + static struct cros_ec_dev ec;
>
> ec_dev->max_request = 0xff;
> ec_dev->max_response = 0xee;
> @@ -2494,7 +2494,7 @@ static void cros_ec_proto_test_get_sensor_count_xfer_error(struct kunit *test)
> struct cros_ec_device *ec_dev = &priv->ec_dev;
> struct ec_xfer_mock *mock;
> int ret;
> - struct cros_ec_dev ec;
> + static struct cros_ec_dev ec;
>
> ec_dev->max_request = 0xff;
> ec_dev->max_response = 0xee;
> @@ -2534,7 +2534,7 @@ static void cros_ec_proto_test_get_sensor_count_legacy(struct kunit *test)
> struct cros_ec_device *ec_dev = &priv->ec_dev;
> struct ec_xfer_mock *mock;
> int ret, i;
> - struct cros_ec_dev ec;
> + static struct cros_ec_dev ec;
> struct {
> u8 readmem_data;
> int expected_result;
next prev parent reply other threads:[~2023-01-17 16:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 8:02 [PATCH] platform/chrome: cros_ec_proto: remove big stub objects from stack Tzung-Bi Shih
2023-01-17 16:24 ` Guenter Roeck [this message]
2023-01-18 3:00 ` patchwork-bot+chrome-platform
2023-01-18 6:20 ` patchwork-bot+chrome-platform
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=20230117162451.GA4097956@roeck-us.net \
--to=linux@roeck-us.net \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=lkp@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox