ubifs: work around high stack usage with clang
authorArnd Bergmann <arnd@arndb.de>
Sun, 24 Mar 2019 19:44:51 +0000 (20:44 +0100)
committerRichard Weinberger <richard@nod.at>
Tue, 7 May 2019 19:36:39 +0000 (21:36 +0200)
commitf4844b35d68ab49c41d542c501fffb46ad81009a
treeba3a0defe190b28fabc143601fe5a79f45b511bc
parentfb9a5a3edb4c34ac0d7e6996278604e53a43245f
ubifs: work around high stack usage with clang

Building this file with clang can result in large stack usage as seen from
this warning:

fs/ubifs/auth.c:78:5: error: stack frame size of 1152 bytes in function 'ubifs_prepare_auth_node'

The problem is that inlining ubifs_hash_calc_hmac() leads to
two SHASH_DESC_ON_STACK() blocks in the same function, and clang
for some reason does not reuse the stack space as it should.

Putting the first declaration into a separate basic block avoids
this problem and reduces the stack allocation to 640 bytes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/auth.c