lkml.org 
[lkml]   [2017]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 17/26] [media] i2c: ks0127: reduce stack frame size for KASAN
    Date
    When CONFIG_KASAN is set, inlining of functions with local variables
    causes excessive stack usage:

    drivers/media/i2c/ks0127.c: In function 'ks0127_s_routing':
    drivers/media/i2c/ks0127.c:541:1: error: the frame size of 3136 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

    Marking one functions as noinline_for_kasan solves the problem in this
    driver.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    ---
    drivers/media/i2c/ks0127.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/media/i2c/ks0127.c b/drivers/media/i2c/ks0127.c
    index ab536c4a7115..eb2fccdc0602 100644
    --- a/drivers/media/i2c/ks0127.c
    +++ b/drivers/media/i2c/ks0127.c
    @@ -349,7 +349,7 @@ static void ks0127_write(struct v4l2_subdev *sd, u8 reg, u8 val)


    /* generic bit-twiddling */
    -static void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v)
    +static noinline_for_kasan void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v)
    {
    struct ks0127 *ks = to_ks0127(sd);

    --
    2.9.0
    \
     
     \ /
      Last update: 2017-03-02 17:50    [W:3.811 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site