diff options
author | Arnd Bergmann <arnd@arndb.de> | 2020-04-30 12:39:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-04 11:47:52 -0700 |
commit | 071a43e660996d1517d02ea7724491cc5b93bb03 (patch) | |
tree | 4d368d2129fe75ef4f44c8823befe3ad95040be8 /include | |
parent | c649c41d5d0f7d153bd5d5d9c093fec16ee03e00 (diff) |
cxgb4/chcr: avoid -Wreturn-local-addr warning
gcc-10 warns about functions that return a pointer to a stack
variable. In chcr_write_cpl_set_tcb_ulp(), this does not actually
happen, but it's too hard to see for the compiler:
drivers/crypto/chelsio/chcr_ktls.c: In function 'chcr_write_cpl_set_tcb_ulp.constprop':
drivers/crypto/chelsio/chcr_ktls.c:760:9: error: function may return address of local variable [-Werror=return-local-addr]
760 | return pos;
| ^~~
drivers/crypto/chelsio/chcr_ktls.c:712:5: note: declared here
712 | u8 buf[48] = {0};
| ^~~
Split the middle part of the function out into a helper to make
it easier to understand by both humans and compilers, which avoids
the warning.
Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions