From: Jiri Slaby Date: Tue, 1 Aug 2023 06:22:36 +0000 (+0200) Subject: can: can327: remove casts from tty->disc_data X-Git-Tag: v6.6.7~2018^2~123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a35f38991c2e22c41aa9cd67bd6c55de5d9972dc;p=platform%2Fkernel%2Flinux-starfive.git can: can327: remove casts from tty->disc_data tty->disc_data is 'void *', so there is no need to cast from that. Therefore remove the casts and assign the pointer directly. Signed-off-by: Jiri Slaby (SUSE) Cc: Max Staudt Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Dario Binacchi Cc: linux-can@vger.kernel.org Cc: netdev@vger.kernel.org Reviewed-by: Simon Horman Reviewed-by: Max Staudt Link: https://lore.kernel.org/r/20230801062237.2687-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c index dc7192e..ee8a977 100644 --- a/drivers/net/can/can327.c +++ b/drivers/net/can/can327.c @@ -888,7 +888,7 @@ static bool can327_is_valid_rx_char(u8 c) static void can327_ldisc_rx(struct tty_struct *tty, const unsigned char *cp, const char *fp, int count) { - struct can327 *elm = (struct can327 *)tty->disc_data; + struct can327 *elm = tty->disc_data; size_t first_new_char_idx; if (elm->uart_side_failure) @@ -990,7 +990,7 @@ static void can327_ldisc_tx_worker(struct work_struct *work) /* Called by the driver when there's room for more data. */ static void can327_ldisc_tx_wakeup(struct tty_struct *tty) { - struct can327 *elm = (struct can327 *)tty->disc_data; + struct can327 *elm = tty->disc_data; schedule_work(&elm->tx_work); } @@ -1067,7 +1067,7 @@ static int can327_ldisc_open(struct tty_struct *tty) */ static void can327_ldisc_close(struct tty_struct *tty) { - struct can327 *elm = (struct can327 *)tty->disc_data; + struct can327 *elm = tty->disc_data; /* unregister_netdev() calls .ndo_stop() so we don't have to. */ unregister_candev(elm->dev); @@ -1092,7 +1092,7 @@ static void can327_ldisc_close(struct tty_struct *tty) static int can327_ldisc_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { - struct can327 *elm = (struct can327 *)tty->disc_data; + struct can327 *elm = tty->disc_data; unsigned int tmp; switch (cmd) {