[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200504.114806.529418018451997120.davem@davemloft.net>
Date: Mon, 04 May 2020 11:48:06 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: arnd@...db.de
Cc: ayush.sawal@...lsio.com, vinay.yadav@...lsio.com,
rohitm@...lsio.com, herbert@...dor.apana.org.au,
netdev@...r.kernel.org, yuehaibing@...wei.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cxgb4/chcr: avoid -Wreturn-local-addr warning
From: Arnd Bergmann <arnd@...db.de>
Date: Thu, 30 Apr 2020 12:39:02 +0200
> 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@...db.de>
Applied, thanks Arnd.
Powered by blists - more mailing lists