[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <46329c2f-dc04-4533-a958-bfe6b9a1fa0e@app.fastmail.com>
Date: Wed, 17 Apr 2024 20:57:19 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Nathan Chancellor" <nathan@...nel.org>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Heiko Carstens" <hca@...ux.ibm.com>, gor@...ux.ibm.com,
"Alexander Gordeev" <agordeev@...ux.ibm.com>
Cc: "Christian Borntraeger" <borntraeger@...ux.ibm.com>,
"Sven Schnelle" <svens@...ux.ibm.com>, wintera@...ux.ibm.com,
twinkler@...ux.ibm.com, linux-s390@...r.kernel.org,
Netdev <netdev@...r.kernel.org>, llvm@...ts.linux.dev,
patches@...ts.linux.dev
Subject: Re: [PATCH 3/3] s390/netiucv: Remove function pointer cast
On Wed, Apr 17, 2024, at 20:24, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR) after enabling
> -Wcast-function-type-strict by default:
>
> drivers/s390/net/netiucv.c:1716:18: error: cast from 'void (*)(const
> void *)' to 'void (*)(struct device *)' converts to incompatible
> function type [-Werror,-Wcast-function-type-strict]
> 1716 | dev->release = (void (*)(struct device
> *))kfree;
> |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
>
> Add a standalone function to fix the warning properly, which addresses
> the root of the warning that these casts are not safe for kCFI. The
> comment is not really relevant after this change, so remove it.
>
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists