tty: hvc-iucv: fix function pointer casts
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 Feb 2024 10:17:49 +0000 (11:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 16:44:52 +0000 (17:44 +0100)
commit42af6bcbc351d544889fcbcfc9c3d4bd39191b7d
tree266cb2f9ca627e61dcb02bdab5eb718129f16b4d
parent8524788abf564fb7927873ff3fbc8056c6f02195
tty: hvc-iucv: fix function pointer casts

clang warns about explicitly casting between incompatible function
pointers:

drivers/tty/hvc/hvc_iucv.c:1100:23: error: cast from 'void (*)(const void *)' to 'void (*)(struct device *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
 1100 |         priv->dev->release = (void (*)(struct device *)) kfree;
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add a separate function to handle this correctly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20240213101756.461701-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvc_iucv.c