From patchwork Tue Aug 1 06:22:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 709520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA93EB64DD for ; Tue, 1 Aug 2023 06:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230442AbjHAGXD (ORCPT ); Tue, 1 Aug 2023 02:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbjHAGWs (ORCPT ); Tue, 1 Aug 2023 02:22:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD20E1BF1; Mon, 31 Jul 2023 23:22:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 354626147D; Tue, 1 Aug 2023 06:22:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D5CC433C9; Tue, 1 Aug 2023 06:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690870966; bh=b2RgmgrZgvx8gY0C2fKs3oh+azWjdXtoP4cL2Idz4YQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7RwOb7oUztbzNAhEda9ikSF6FSSik48MGrDJVno2hY8EGt94fNSgeklPels0sqy/ ekGIXqs1rIX+lqgmqiCbMJ4RRQqhD0I5PFZ5U61ItHDTgxTDSnrbo/i5NWHKr672TQ u16Gr0Sz9UP84+M11kkSOn6ZOabbRqBP5eWlBuNewTTrVrc2Kznm1/ABduiVtBx1+U QGPlRY38tDc7yiDbuYiJUFTXVT3J+jbcRG+qRv/iqzg83wIYgsmwXaIvf5Sm9BLS7I QMWbmKg77O4YVa+uWl2K918TxGce9WZNxM7BlhuiKbP8sOnQwTGTZqeVh/WozHA3hI cFS4s7uOkcCyQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Max Staudt , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Dario Binacchi , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/2] can: can327: remove casts from tty->disc_data Date: Tue, 1 Aug 2023 08:22:36 +0200 Message-ID: <20230801062237.2687-2-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801062237.2687-1-jirislaby@kernel.org> References: <20230801062237.2687-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- drivers/net/can/can327.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c index dc7192ecb001..ee8a977acc8d 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) { From patchwork Tue Aug 1 06:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiri Slaby \(SUSE\)" X-Patchwork-Id: 709123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDEBC41513 for ; Tue, 1 Aug 2023 06:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbjHAGXD (ORCPT ); Tue, 1 Aug 2023 02:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231515AbjHAGWx (ORCPT ); Tue, 1 Aug 2023 02:22:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CA7219AA; Mon, 31 Jul 2023 23:22:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21FA361483; Tue, 1 Aug 2023 06:22:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5CFC4339A; Tue, 1 Aug 2023 06:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690870970; bh=kuEWnL9p9BoO9qyiypu88WnOmaK1A5r5Av53wC58X/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sTAaCdjqqtaGw4jXqE8Zp1B4A46QbjBp0dXr631H/PgNlLVBuyCklYAGke2Wh0SrB V3LiY5YC3HRiuHhVcgPq7e69TY1EfVP0ql+l85qpEBSMzhf5uQV4tFTSYFr0fOcbD8 YijqLZynDBoU/TqXA6ioHSRUf0zg2cPEPkzDJ9f3wj9kVA8/uPOlBzgCkQGQN9i6Pw MPgq4IbGoM20r5r/j6iwS46RTzkeZJdGrcnUb/gBr559dRO7FmwyUfLNRKW9oHmcfA G8TOEodJKvNN7nvplCEH4mTmHxXpQvq9abVmp9aoVl+hf+yq/awLxqUl2ijo8ewb5h wIgfwLXTr1gpA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Max Staudt , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 2/2] net: nfc: remove casts from tty->disc_data Date: Tue, 1 Aug 2023 08:22:37 +0200 Message-ID: <20230801062237.2687-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801062237.2687-1-jirislaby@kernel.org> References: <20230801062237.2687-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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: Krzysztof Kozlowski Cc: linux-can@vger.kernel.org Cc: netdev@vger.kernel.org --- net/nfc/nci/uart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c index cc8fa9e36159..082f94be0996 100644 --- a/net/nfc/nci/uart.c +++ b/net/nfc/nci/uart.c @@ -172,7 +172,7 @@ static int nci_uart_tty_open(struct tty_struct *tty) */ static void nci_uart_tty_close(struct tty_struct *tty) { - struct nci_uart *nu = (void *)tty->disc_data; + struct nci_uart *nu = tty->disc_data; /* Detach from the tty */ tty->disc_data = NULL; @@ -204,7 +204,7 @@ static void nci_uart_tty_close(struct tty_struct *tty) */ static void nci_uart_tty_wakeup(struct tty_struct *tty) { - struct nci_uart *nu = (void *)tty->disc_data; + struct nci_uart *nu = tty->disc_data; if (!nu) return; @@ -298,7 +298,7 @@ static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data, static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data, const char *flags, int count) { - struct nci_uart *nu = (void *)tty->disc_data; + struct nci_uart *nu = tty->disc_data; if (!nu || tty != nu->tty) return; @@ -325,7 +325,7 @@ static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data, static int nci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { - struct nci_uart *nu = (void *)tty->disc_data; + struct nci_uart *nu = tty->disc_data; int err = 0; switch (cmd) {