netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] can: can327: remove casts from tty->disc_data
       [not found] <20230801062237.2687-1-jirislaby@kernel.org>
@ 2023-08-01  6:22 ` Jiri Slaby (SUSE)
  2023-08-01 12:25   ` Simon Horman
  2023-08-01 13:46   ` Max Staudt
  2023-08-01  6:22 ` [PATCH 2/2] net: nfc: " Jiri Slaby (SUSE)
  1 sibling, 2 replies; 9+ messages in thread
From: Jiri Slaby (SUSE) @ 2023-08-01  6:22 UTC (permalink / raw)
  To: gregkh
  Cc: linux-serial, linux-kernel, Jiri Slaby (SUSE), Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Dario Binacchi,
	linux-can, netdev

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) <jirislaby@kernel.org>
Cc: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
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) {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] net: nfc: remove casts from tty->disc_data
       [not found] <20230801062237.2687-1-jirislaby@kernel.org>
  2023-08-01  6:22 ` [PATCH 1/2] can: can327: remove casts from tty->disc_data Jiri Slaby (SUSE)
@ 2023-08-01  6:22 ` Jiri Slaby (SUSE)
  2023-08-01 12:26   ` Simon Horman
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Jiri Slaby (SUSE) @ 2023-08-01  6:22 UTC (permalink / raw)
  To: gregkh
  Cc: linux-serial, linux-kernel, Jiri Slaby (SUSE), Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski,
	linux-can, netdev

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) <jirislaby@kernel.org>
Cc: Max Staudt <max@enpas.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
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) {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] can: can327: remove casts from tty->disc_data
  2023-08-01  6:22 ` [PATCH 1/2] can: can327: remove casts from tty->disc_data Jiri Slaby (SUSE)
@ 2023-08-01 12:25   ` Simon Horman
  2023-08-01 13:46   ` Max Staudt
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Horman @ 2023-08-01 12:25 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: gregkh, linux-serial, linux-kernel, Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Dario Binacchi,
	linux-can, netdev

On Tue, Aug 01, 2023 at 08:22:36AM +0200, Jiri Slaby (SUSE) wrote:
> 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) <jirislaby@kernel.org>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data
  2023-08-01  6:22 ` [PATCH 2/2] net: nfc: " Jiri Slaby (SUSE)
@ 2023-08-01 12:26   ` Simon Horman
  2023-08-01 13:46   ` Max Staudt
  2023-08-02 19:07   ` Jakub Kicinski
  2 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2023-08-01 12:26 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: gregkh, linux-serial, linux-kernel, Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski,
	linux-can, netdev

On Tue, Aug 01, 2023 at 08:22:37AM +0200, Jiri Slaby (SUSE) wrote:
> 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) <jirislaby@kernel.org>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] can: can327: remove casts from tty->disc_data
  2023-08-01  6:22 ` [PATCH 1/2] can: can327: remove casts from tty->disc_data Jiri Slaby (SUSE)
  2023-08-01 12:25   ` Simon Horman
@ 2023-08-01 13:46   ` Max Staudt
  1 sibling, 0 replies; 9+ messages in thread
From: Max Staudt @ 2023-08-01 13:46 UTC (permalink / raw)
  To: Jiri Slaby (SUSE), gregkh
  Cc: linux-serial, linux-kernel, Wolfgang Grandegger,
	Marc Kleine-Budde, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Dario Binacchi, linux-can, netdev

On 8/1/23 15:22, Jiri Slaby (SUSE) wrote:
> 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) <jirislaby@kernel.org>

Thanks for spotting this!

Reviewed-by: Max Staudt <max@enpas.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data
  2023-08-01  6:22 ` [PATCH 2/2] net: nfc: " Jiri Slaby (SUSE)
  2023-08-01 12:26   ` Simon Horman
@ 2023-08-01 13:46   ` Max Staudt
  2023-08-02 19:07   ` Jakub Kicinski
  2 siblings, 0 replies; 9+ messages in thread
From: Max Staudt @ 2023-08-01 13:46 UTC (permalink / raw)
  To: Jiri Slaby (SUSE), gregkh
  Cc: linux-serial, linux-kernel, Wolfgang Grandegger,
	Marc Kleine-Budde, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Krzysztof Kozlowski, linux-can, netdev

On 8/1/23 15:22, Jiri Slaby (SUSE) wrote:
> 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) <jirislaby@kernel.org>

Reviewed-by: Max Staudt <max@enpas.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data
  2023-08-01  6:22 ` [PATCH 2/2] net: nfc: " Jiri Slaby (SUSE)
  2023-08-01 12:26   ` Simon Horman
  2023-08-01 13:46   ` Max Staudt
@ 2023-08-02 19:07   ` Jakub Kicinski
  2023-08-03  5:08     ` Jiri Slaby
  2 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2023-08-02 19:07 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: gregkh, linux-serial, linux-kernel, Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Paolo Abeni, Krzysztof Kozlowski, linux-can, netdev

On Tue,  1 Aug 2023 08:22:37 +0200 Jiri Slaby (SUSE) wrote:
> tty->disc_data is 'void *', so there is no need to cast from that.
> Therefore remove the casts and assign the pointer directly.

Which tree are these expected to flow thru?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data
  2023-08-02 19:07   ` Jakub Kicinski
@ 2023-08-03  5:08     ` Jiri Slaby
  2023-08-03  6:51       ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Jiri Slaby @ 2023-08-03  5:08 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: gregkh, linux-serial, linux-kernel, Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Paolo Abeni, Krzysztof Kozlowski, linux-can, netdev

On 02. 08. 23, 21:07, Jakub Kicinski wrote:
> On Tue,  1 Aug 2023 08:22:37 +0200 Jiri Slaby (SUSE) wrote:
>> tty->disc_data is 'void *', so there is no need to cast from that.
>> Therefore remove the casts and assign the pointer directly.
> 
> Which tree are these expected to flow thru?

The intention was through the tty tree. But I don't mind either way -- 
it's up to you Greg.

thanks,
-- 
js
suse labs


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data
  2023-08-03  5:08     ` Jiri Slaby
@ 2023-08-03  6:51       ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2023-08-03  6:51 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Jakub Kicinski, linux-serial, linux-kernel, Max Staudt,
	Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Eric Dumazet, Paolo Abeni, Krzysztof Kozlowski, linux-can, netdev

On Thu, Aug 03, 2023 at 07:08:07AM +0200, Jiri Slaby wrote:
> On 02. 08. 23, 21:07, Jakub Kicinski wrote:
> > On Tue,  1 Aug 2023 08:22:37 +0200 Jiri Slaby (SUSE) wrote:
> > > tty->disc_data is 'void *', so there is no need to cast from that.
> > > Therefore remove the casts and assign the pointer directly.
> > 
> > Which tree are these expected to flow thru?
> 
> The intention was through the tty tree. But I don't mind either way -- it's
> up to you Greg.

I'll take them, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-03  6:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230801062237.2687-1-jirislaby@kernel.org>
2023-08-01  6:22 ` [PATCH 1/2] can: can327: remove casts from tty->disc_data Jiri Slaby (SUSE)
2023-08-01 12:25   ` Simon Horman
2023-08-01 13:46   ` Max Staudt
2023-08-01  6:22 ` [PATCH 2/2] net: nfc: " Jiri Slaby (SUSE)
2023-08-01 12:26   ` Simon Horman
2023-08-01 13:46   ` Max Staudt
2023-08-02 19:07   ` Jakub Kicinski
2023-08-03  5:08     ` Jiri Slaby
2023-08-03  6:51       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).