When compile with CONFIG_FRAME_WARN=1024, there can be a warning: drivers/i2c/i2c-core-base.c: In function ‘i2c_detect.isra’: drivers/i2c/i2c-core-base.c:2507:1: warning: the frame size of 1028 bytes is larger than 1024 bytes [-Wframe-larger-than=]. 2507 | } | ^ Mark i2c_detect_address() noinline_for_stack to avoid this warning. Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx> --- ps: found this warning during running randconfig test. drivers/i2c/i2c-core-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 5546184df05f..59983d2a9cca 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -2405,8 +2405,8 @@ static int i2c_default_probe(struct i2c_adapter *adap, unsigned short addr) return err >= 0; } -static int i2c_detect_address(struct i2c_client *temp_client, - struct i2c_driver *driver) +static noinline_for_stack int i2c_detect_address(struct i2c_client *temp_client, + struct i2c_driver *driver) { struct i2c_board_info info; struct i2c_adapter *adapter = temp_client->adapter; -- 2.30.2