2023-08-01 06:29:31

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 2/2] net: nfc: 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) <[email protected]>
Cc: Max Staudt <[email protected]>
Cc: Wolfgang Grandegger <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
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



2023-08-01 13:49:00

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data

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) <[email protected]>

Reviewed-by: Simon Horman <[email protected]>


2023-08-01 14:47:26

by Max Staudt

[permalink] [raw]
Subject: Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data

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) <[email protected]>

Reviewed-by: Max Staudt <[email protected]>


2023-08-02 19:38:18

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data

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?

2023-08-03 05:26:30

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data

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


2023-08-03 07:38:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/2] net: nfc: remove casts from tty->disc_data

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