Thread (5 messages) 5 messages, 2 authors, 2024-08-08

Re: [PATCH v2 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once

From: Jiri Slaby <jirislaby@kernel.org>
Date: 2024-08-08 07:31:28
Also in: linux-samsung-soc, linux-serial, lkml

On 07. 08. 24, 13:58, André Draszik wrote:
The interrupt handler routines and helpers are casting the 'void *'
pointer to 'struct exynos_uart_port *' all over the place.

There is no need for that, we can do the casting once and keep passing
the 'struct exynos_uart_port *', simplifying the code and saving a few
lines of code.

No functional changes.
...
quoted hunk ↗ jump to hunk
@@ -944,17 +939,17 @@ static irqreturn_t s3c24xx_serial_tx_irq(void *id)
  /* interrupt handler for s3c64xx and later SoC's.*/
  static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
  {
-	const struct s3c24xx_uart_port *ourport = id;
-	const struct uart_port *port = &ourport->port;
+	struct s3c24xx_uart_port *ourport = id;
+	struct uart_port *port = &ourport->port;
  	u32 pend = rd_regl(port, S3C64XX_UINTP);
  	irqreturn_t ret = IRQ_HANDLED;
  
  	if (pend & S3C64XX_UINTM_RXD_MSK) {
-		ret = s3c24xx_serial_rx_irq(id);
+		ret = s3c24xx_serial_rx_irq(ourport);
  		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
  	}
  	if (pend & S3C64XX_UINTM_TXD_MSK) {
-		ret = s3c24xx_serial_tx_irq(id);
+		ret = s3c24xx_serial_tx_irq(ourport);
  		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
  	}
  	return ret;
@@ -963,19 +958,19 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
  /* interrupt handler for Apple SoC's.*/
  static irqreturn_t apple_serial_handle_irq(int irq, void *id)
  {
-	const struct s3c24xx_uart_port *ourport = id;
-	const struct uart_port *port = &ourport->port;
+	struct s3c24xx_uart_port *ourport = id;
+	struct uart_port *port = &ourport->port;
No need to remove const from port here and above, right? (Only from 
ourport.)

Other than that, LGTM.

thanks,
-- 
js
suse labs

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help