mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
@ 2024-08-06 15:29 André Draszik
  2024-08-06 15:29 ` [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers André Draszik
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: André Draszik @ 2024-08-06 15:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman, Jiri Slaby
  Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, linux-serial,
	André Draszik

While looking through the samsung tty driver, I've spotted a few things that
can be simplified by removing unused function arguments and by avoiding some
duplicated variables and casting.

There are no functional changes here.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
André Draszik (2):
      tty: serial: samsung_tty: drop unused argument to irq handlers
      tty: serial: samsung_tty: cast the interrupt's void *id just once

 drivers/tty/serial/samsung_tty.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)
---
base-commit: 1e391b34f6aa043c7afa40a2103163a0ef06d179
change-id: 20240806-samsung-tty-cleanup-ffae1515a284

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>


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

* [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers
  2024-08-06 15:29 [PATCH 0/2] tty: serial: samsung_tty: simple cleanups André Draszik
@ 2024-08-06 15:29 ` André Draszik
  2024-08-07 10:49   ` Tudor Ambarus
  2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
  2024-08-07 11:09 ` [PATCH 0/2] tty: serial: samsung_tty: simple cleanups Greg Kroah-Hartman
  2 siblings, 1 reply; 13+ messages in thread
From: André Draszik @ 2024-08-06 15:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman, Jiri Slaby
  Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, linux-serial,
	André Draszik

The 'irq' argument is not used in any of the callees, we can just drop
it and simplify the code.

No functional changes.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 drivers/tty/serial/samsung_tty.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index dc35eb77d2ef..1c6d0ffe5649 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -855,7 +855,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t s3c24xx_serial_rx_irq(int irq, void *dev_id)
+static irqreturn_t s3c24xx_serial_rx_irq(void *dev_id)
 {
 	struct s3c24xx_uart_port *ourport = dev_id;
 
@@ -928,7 +928,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
 		s3c24xx_serial_stop_tx(port);
 }
 
-static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id)
+static irqreturn_t s3c24xx_serial_tx_irq(void *id)
 {
 	struct s3c24xx_uart_port *ourport = id;
 	struct uart_port *port = &ourport->port;
@@ -950,11 +950,11 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
 	irqreturn_t ret = IRQ_HANDLED;
 
 	if (pend & S3C64XX_UINTM_RXD_MSK) {
-		ret = s3c24xx_serial_rx_irq(irq, id);
+		ret = s3c24xx_serial_rx_irq(id);
 		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
 	}
 	if (pend & S3C64XX_UINTM_TXD_MSK) {
-		ret = s3c24xx_serial_tx_irq(irq, id);
+		ret = s3c24xx_serial_tx_irq(id);
 		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
 	}
 	return ret;
@@ -971,11 +971,11 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id)
 	if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) {
 		wr_regl(port, S3C2410_UTRSTAT,
 			APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO);
-		ret = s3c24xx_serial_rx_irq(irq, id);
+		ret = s3c24xx_serial_rx_irq(id);
 	}
 	if (pend & APPLE_S5L_UTRSTAT_TXTHRESH) {
 		wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_TXTHRESH);
-		ret = s3c24xx_serial_tx_irq(irq, id);
+		ret = s3c24xx_serial_tx_irq(id);
 	}
 
 	return ret;

-- 
2.46.0.rc2.264.g509ed76dc8-goog


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

* [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
  2024-08-06 15:29 [PATCH 0/2] tty: serial: samsung_tty: simple cleanups André Draszik
  2024-08-06 15:29 ` [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers André Draszik
@ 2024-08-06 15:29 ` André Draszik
  2024-08-07 10:49   ` Tudor Ambarus
                     ` (2 more replies)
  2024-08-07 11:09 ` [PATCH 0/2] tty: serial: samsung_tty: simple cleanups Greg Kroah-Hartman
  2 siblings, 3 replies; 13+ messages in thread
From: André Draszik @ 2024-08-06 15:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Greg Kroah-Hartman, Jiri Slaby
  Cc: Peter Griffin, Tudor Ambarus, Will McVicker, kernel-team,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, linux-serial,
	André Draszik

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.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 drivers/tty/serial/samsung_tty.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 1c6d0ffe5649..971765aaeaca 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -707,9 +707,8 @@ static void enable_rx_pio(struct s3c24xx_uart_port *ourport)
 
 static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport);
 
-static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id)
+static irqreturn_t s3c24xx_serial_rx_chars_dma(struct s3c24xx_uart_port *ourport)
 {
-	struct s3c24xx_uart_port *ourport = dev_id;
 	struct uart_port *port = &ourport->port;
 	struct s3c24xx_uart_dma *dma = ourport->dma;
 	struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port);
@@ -843,9 +842,8 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport)
 	tty_flip_buffer_push(&port->state->port);
 }
 
-static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id)
+static irqreturn_t s3c24xx_serial_rx_chars_pio(struct s3c24xx_uart_port *ourport)
 {
-	struct s3c24xx_uart_port *ourport = dev_id;
 	struct uart_port *port = &ourport->port;
 
 	uart_port_lock(port);
@@ -855,13 +853,11 @@ static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t s3c24xx_serial_rx_irq(void *dev_id)
+static irqreturn_t s3c24xx_serial_rx_irq(struct s3c24xx_uart_port *ourport)
 {
-	struct s3c24xx_uart_port *ourport = dev_id;
-
 	if (ourport->dma && ourport->dma->rx_chan)
-		return s3c24xx_serial_rx_chars_dma(dev_id);
-	return s3c24xx_serial_rx_chars_pio(dev_id);
+		return s3c24xx_serial_rx_chars_dma(ourport);
+	return s3c24xx_serial_rx_chars_pio(ourport);
 }
 
 static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
@@ -928,9 +924,8 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
 		s3c24xx_serial_stop_tx(port);
 }
 
-static irqreturn_t s3c24xx_serial_tx_irq(void *id)
+static irqreturn_t s3c24xx_serial_tx_irq(struct s3c24xx_uart_port *ourport)
 {
-	struct s3c24xx_uart_port *ourport = id;
 	struct uart_port *port = &ourport->port;
 
 	uart_port_lock(port);
@@ -950,11 +945,11 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
 	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;
@@ -971,11 +966,11 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id)
 	if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) {
 		wr_regl(port, S3C2410_UTRSTAT,
 			APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO);
-		ret = s3c24xx_serial_rx_irq(id);
+		ret = s3c24xx_serial_rx_irq(ourport);
 	}
 	if (pend & APPLE_S5L_UTRSTAT_TXTHRESH) {
 		wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_TXTHRESH);
-		ret = s3c24xx_serial_tx_irq(id);
+		ret = s3c24xx_serial_tx_irq(ourport);
 	}
 
 	return ret;

-- 
2.46.0.rc2.264.g509ed76dc8-goog


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

* Re: [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers
  2024-08-06 15:29 ` [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers André Draszik
@ 2024-08-07 10:49   ` Tudor Ambarus
  0 siblings, 0 replies; 13+ messages in thread
From: Tudor Ambarus @ 2024-08-07 10:49 UTC (permalink / raw)
  To: André Draszik, Krzysztof Kozlowski, Alim Akhtar,
	Greg Kroah-Hartman, Jiri Slaby
  Cc: Peter Griffin, Will McVicker, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-serial


Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

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

* Re: [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
  2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
@ 2024-08-07 10:49   ` Tudor Ambarus
  2024-08-09  7:01   ` kernel test robot
  2024-08-09  7:21   ` kernel test robot
  2 siblings, 0 replies; 13+ messages in thread
From: Tudor Ambarus @ 2024-08-07 10:49 UTC (permalink / raw)
  To: André Draszik, Krzysztof Kozlowski, Alim Akhtar,
	Greg Kroah-Hartman, Jiri Slaby
  Cc: Peter Griffin, Will McVicker, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-serial


Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-06 15:29 [PATCH 0/2] tty: serial: samsung_tty: simple cleanups André Draszik
  2024-08-06 15:29 ` [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers André Draszik
  2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
@ 2024-08-07 11:09 ` Greg Kroah-Hartman
  2024-08-07 11:17   ` André Draszik
  2024-08-07 12:00   ` André Draszik
  2 siblings, 2 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2024-08-07 11:09 UTC (permalink / raw)
  To: André Draszik
  Cc: Krzysztof Kozlowski, Alim Akhtar, Jiri Slaby, Peter Griffin,
	Tudor Ambarus, Will McVicker, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-serial

On Tue, Aug 06, 2024 at 04:29:44PM +0100, André Draszik wrote:
> While looking through the samsung tty driver, I've spotted a few things that
> can be simplified by removing unused function arguments and by avoiding some
> duplicated variables and casting.
> 
> There are no functional changes here.
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
> André Draszik (2):
>       tty: serial: samsung_tty: drop unused argument to irq handlers
>       tty: serial: samsung_tty: cast the interrupt's void *id just once

This series blows up the build for me, are you sure you tested it?

drivers/tty/serial/samsung_tty.c: In function ‘s3c64xx_serial_handle_irq’:
drivers/tty/serial/samsung_tty.c:948:45: error: passing argument 1 of ‘s3c24xx_serial_rx_irq’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  948 |                 ret = s3c24xx_serial_rx_irq(ourport);
      |                                             ^~~~~~~
drivers/tty/serial/samsung_tty.c:856:68: note: expected ‘struct s3c24xx_uart_port *’ but argument is of type ‘const struct s3c24xx_uart_port *’

And so on...




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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-07 11:09 ` [PATCH 0/2] tty: serial: samsung_tty: simple cleanups Greg Kroah-Hartman
@ 2024-08-07 11:17   ` André Draszik
  2024-08-07 12:00   ` André Draszik
  1 sibling, 0 replies; 13+ messages in thread
From: André Draszik @ 2024-08-07 11:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Krzysztof Kozlowski, Alim Akhtar, Jiri Slaby, Peter Griffin,
	Tudor Ambarus, Will McVicker, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-serial

On Wed, 2024-08-07 at 13:09 +0200, Greg Kroah-Hartman wrote:
> On Tue, Aug 06, 2024 at 04:29:44PM +0100, André Draszik wrote:
> > While looking through the samsung tty driver, I've spotted a few things that
> > can be simplified by removing unused function arguments and by avoiding some
> > duplicated variables and casting.
> > 
> > There are no functional changes here.
> > 
> > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > ---
> > André Draszik (2):
> >       tty: serial: samsung_tty: drop unused argument to irq handlers
> >       tty: serial: samsung_tty: cast the interrupt's void *id just once
> 
> This series blows up the build for me, are you sure you tested it?
> 
> drivers/tty/serial/samsung_tty.c: In function ‘s3c64xx_serial_handle_irq’:
> drivers/tty/serial/samsung_tty.c:948:45: error: passing argument 1 of ‘s3c24xx_serial_rx_irq’ discards ‘const’ qualifier from pointer
> target type [-Werror=discarded-qualifiers]
>   948 |                 ret = s3c24xx_serial_rx_irq(ourport);
>       |                                             ^~~~~~~
> drivers/tty/serial/samsung_tty.c:856:68: note: expected ‘struct s3c24xx_uart_port *’ but argument is of type ‘const struct
> s3c24xx_uart_port *’
> 
> And so on...

Odd, I did test this, yes. Not sure why I don't get these, let me check.

Cheers,
Andre'


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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-07 11:09 ` [PATCH 0/2] tty: serial: samsung_tty: simple cleanups Greg Kroah-Hartman
  2024-08-07 11:17   ` André Draszik
@ 2024-08-07 12:00   ` André Draszik
  2024-08-07 13:53     ` Tudor Ambarus
  1 sibling, 1 reply; 13+ messages in thread
From: André Draszik @ 2024-08-07 12:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Krzysztof Kozlowski, Alim Akhtar, Jiri Slaby, Peter Griffin,
	Tudor Ambarus, Will McVicker, kernel-team, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-serial

On Wed, 2024-08-07 at 13:09 +0200, Greg Kroah-Hartman wrote:
> On Tue, Aug 06, 2024 at 04:29:44PM +0100, André Draszik wrote:
> > While looking through the samsung tty driver, I've spotted a few things that
> > can be simplified by removing unused function arguments and by avoiding some
> > duplicated variables and casting.
> > 
> > There are no functional changes here.
> > 
> > Signed-off-by: André Draszik <andre.draszik@linaro.org>
> > ---
> > André Draszik (2):
> >       tty: serial: samsung_tty: drop unused argument to irq handlers
> >       tty: serial: samsung_tty: cast the interrupt's void *id just once
> 
> This series blows up the build for me, are you sure you tested it?
> 
> drivers/tty/serial/samsung_tty.c: In function ‘s3c64xx_serial_handle_irq’:
> drivers/tty/serial/samsung_tty.c:948:45: error: passing argument 1 of ‘s3c24xx_serial_rx_irq’ discards ‘const’ qualifier from pointer
> target type [-Werror=discarded-qualifiers]
>   948 |                 ret = s3c24xx_serial_rx_irq(ourport);
>       |                                             ^~~~~~~
> drivers/tty/serial/samsung_tty.c:856:68: note: expected ‘struct s3c24xx_uart_port *’ but argument is of type ‘const struct
> s3c24xx_uart_port *’
> 
> And so on...

Looks like I had Werror disabled and therefore just missed them. Sorry for that.

Cheers,
Andre'


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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-07 12:00   ` André Draszik
@ 2024-08-07 13:53     ` Tudor Ambarus
  2024-08-07 13:58       ` André Draszik
  0 siblings, 1 reply; 13+ messages in thread
From: Tudor Ambarus @ 2024-08-07 13:53 UTC (permalink / raw)
  To: André Draszik, Greg Kroah-Hartman
  Cc: Krzysztof Kozlowski, Alim Akhtar, Jiri Slaby, Peter Griffin,
	Will McVicker, kernel-team, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-serial



On 8/7/24 1:00 PM, André Draszik wrote:
> On Wed, 2024-08-07 at 13:09 +0200, Greg Kroah-Hartman wrote:
>> On Tue, Aug 06, 2024 at 04:29:44PM +0100, André Draszik wrote:
>>> While looking through the samsung tty driver, I've spotted a few things that
>>> can be simplified by removing unused function arguments and by avoiding some
>>> duplicated variables and casting.
>>>
>>> There are no functional changes here.
>>>
>>> Signed-off-by: André Draszik <andre.draszik@linaro.org>
>>> ---
>>> André Draszik (2):
>>>       tty: serial: samsung_tty: drop unused argument to irq handlers
>>>       tty: serial: samsung_tty: cast the interrupt's void *id just once
>>
>> This series blows up the build for me, are you sure you tested it?
>>
>> drivers/tty/serial/samsung_tty.c: In function ‘s3c64xx_serial_handle_irq’:
>> drivers/tty/serial/samsung_tty.c:948:45: error: passing argument 1 of ‘s3c24xx_serial_rx_irq’ discards ‘const’ qualifier from pointer
>> target type [-Werror=discarded-qualifiers]
>>   948 |                 ret = s3c24xx_serial_rx_irq(ourport);
>>       |                                             ^~~~~~~
>> drivers/tty/serial/samsung_tty.c:856:68: note: expected ‘struct s3c24xx_uart_port *’ but argument is of type ‘const struct
>> s3c24xx_uart_port *’
>>
>> And so on...
> 
> Looks like I had Werror disabled and therefore just missed them. Sorry for that.
> 

Same on my side. Any idea why CONFIG_WERROR is not enabled by more
archs? I see just the two:
arch/x86/configs/i386_defconfig:CONFIG_WERROR=y
arch/x86/configs/x86_64_defconfig:CONFIG_WERROR=y

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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-07 13:53     ` Tudor Ambarus
@ 2024-08-07 13:58       ` André Draszik
  2024-08-08  7:23         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 13+ messages in thread
From: André Draszik @ 2024-08-07 13:58 UTC (permalink / raw)
  To: Tudor Ambarus, Greg Kroah-Hartman
  Cc: Krzysztof Kozlowski, Alim Akhtar, Jiri Slaby, Peter Griffin,
	Will McVicker, kernel-team, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, linux-serial

On Wed, 2024-08-07 at 14:53 +0100, Tudor Ambarus wrote:
> Same on my side. Any idea why CONFIG_WERROR is not enabled by more
> archs? I see just the two:
> arch/x86/configs/i386_defconfig:CONFIG_WERROR=y
> arch/x86/configs/x86_64_defconfig:CONFIG_WERROR=y

I can't answer that, but it's an opt-in these days, see
b339ec9c229a ("kbuild: Only default to -Werror if COMPILE_TEST").
Surely if the concern at the time was runtime testing, then that
runtime testing CI infra could have disabled CONFIG_WERROR instead of
globally disabling it for everybody.

Anyway, I've updated our Pixel build env now.

Cheers,
Andre'


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

* Re: [PATCH 0/2] tty: serial: samsung_tty: simple cleanups
  2024-08-07 13:58       ` André Draszik
@ 2024-08-08  7:23         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-08  7:23 UTC (permalink / raw)
  To: André Draszik, Tudor Ambarus, Greg Kroah-Hartman
  Cc: Alim Akhtar, Jiri Slaby, Peter Griffin, Will McVicker,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	linux-serial

On 07/08/2024 15:58, André Draszik wrote:
> On Wed, 2024-08-07 at 14:53 +0100, Tudor Ambarus wrote:
>> Same on my side. Any idea why CONFIG_WERROR is not enabled by more
>> archs? I see just the two:
>> arch/x86/configs/i386_defconfig:CONFIG_WERROR=y
>> arch/x86/configs/x86_64_defconfig:CONFIG_WERROR=y
> 
> I can't answer that, but it's an opt-in these days, see
> b339ec9c229a ("kbuild: Only default to -Werror if COMPILE_TEST").
> Surely if the concern at the time was runtime testing, then that
> runtime testing CI infra could have disabled CONFIG_WERROR instead of
> globally disabling it for everybody.

You are supposed to look for warnings not rely on errors. The same for
building with W=1...

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
  2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
  2024-08-07 10:49   ` Tudor Ambarus
@ 2024-08-09  7:01   ` kernel test robot
  2024-08-09  7:21   ` kernel test robot
  2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2024-08-09  7:01 UTC (permalink / raw)
  To: André Draszik, Krzysztof Kozlowski, Alim Akhtar,
	Greg Kroah-Hartman, Jiri Slaby
  Cc: oe-kbuild-all, Peter Griffin, Tudor Ambarus, Will McVicker,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	linux-serial, André Draszik

Hi André,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 1e391b34f6aa043c7afa40a2103163a0ef06d179]

url:    https://github.com/intel-lab-lkp/linux/commits/Andr-Draszik/tty-serial-samsung_tty-drop-unused-argument-to-irq-handlers/20240806-234342
base:   1e391b34f6aa043c7afa40a2103163a0ef06d179
patch link:    https://lore.kernel.org/r/20240806-samsung-tty-cleanup-v1-2-a68d3abf31fe%40linaro.org
patch subject: [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240809/202408091405.QtjNlf8Z-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240809/202408091405.QtjNlf8Z-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408091405.QtjNlf8Z-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/tty/serial/samsung_tty.c: In function 's3c64xx_serial_handle_irq':
>> drivers/tty/serial/samsung_tty.c:948:45: warning: passing argument 1 of 's3c24xx_serial_rx_irq' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     948 |                 ret = s3c24xx_serial_rx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:856:68: note: expected 'struct s3c24xx_uart_port *' but argument is of type 'const struct s3c24xx_uart_port *'
     856 | static irqreturn_t s3c24xx_serial_rx_irq(struct s3c24xx_uart_port *ourport)
         |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
>> drivers/tty/serial/samsung_tty.c:952:45: warning: passing argument 1 of 's3c24xx_serial_tx_irq' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     952 |                 ret = s3c24xx_serial_tx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:927:68: note: expected 'struct s3c24xx_uart_port *' but argument is of type 'const struct s3c24xx_uart_port *'
     927 | static irqreturn_t s3c24xx_serial_tx_irq(struct s3c24xx_uart_port *ourport)
         |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/tty/serial/samsung_tty.c: In function 'apple_serial_handle_irq':
   drivers/tty/serial/samsung_tty.c:969:45: warning: passing argument 1 of 's3c24xx_serial_rx_irq' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     969 |                 ret = s3c24xx_serial_rx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:856:68: note: expected 'struct s3c24xx_uart_port *' but argument is of type 'const struct s3c24xx_uart_port *'
     856 | static irqreturn_t s3c24xx_serial_rx_irq(struct s3c24xx_uart_port *ourport)
         |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   drivers/tty/serial/samsung_tty.c:973:45: warning: passing argument 1 of 's3c24xx_serial_tx_irq' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     973 |                 ret = s3c24xx_serial_tx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:927:68: note: expected 'struct s3c24xx_uart_port *' but argument is of type 'const struct s3c24xx_uart_port *'
     927 | static irqreturn_t s3c24xx_serial_tx_irq(struct s3c24xx_uart_port *ourport)
         |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~


vim +948 drivers/tty/serial/samsung_tty.c

   938	
   939	/* interrupt handler for s3c64xx and later SoC's.*/
   940	static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
   941	{
   942		const struct s3c24xx_uart_port *ourport = id;
   943		const struct uart_port *port = &ourport->port;
   944		u32 pend = rd_regl(port, S3C64XX_UINTP);
   945		irqreturn_t ret = IRQ_HANDLED;
   946	
   947		if (pend & S3C64XX_UINTM_RXD_MSK) {
 > 948			ret = s3c24xx_serial_rx_irq(ourport);
   949			wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
   950		}
   951		if (pend & S3C64XX_UINTM_TXD_MSK) {
 > 952			ret = s3c24xx_serial_tx_irq(ourport);
   953			wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
   954		}
   955		return ret;
   956	}
   957	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
  2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
  2024-08-07 10:49   ` Tudor Ambarus
  2024-08-09  7:01   ` kernel test robot
@ 2024-08-09  7:21   ` kernel test robot
  2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2024-08-09  7:21 UTC (permalink / raw)
  To: André Draszik, Krzysztof Kozlowski, Alim Akhtar,
	Greg Kroah-Hartman, Jiri Slaby
  Cc: llvm, oe-kbuild-all, Peter Griffin, Tudor Ambarus, Will McVicker,
	kernel-team, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	linux-serial, André Draszik

Hi André,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1e391b34f6aa043c7afa40a2103163a0ef06d179]

url:    https://github.com/intel-lab-lkp/linux/commits/Andr-Draszik/tty-serial-samsung_tty-drop-unused-argument-to-irq-handlers/20240806-234342
base:   1e391b34f6aa043c7afa40a2103163a0ef06d179
patch link:    https://lore.kernel.org/r/20240806-samsung-tty-cleanup-v1-2-a68d3abf31fe%40linaro.org
patch subject: [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240809/202408091530.vvvqEiPv-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240809/202408091530.vvvqEiPv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408091530.vvvqEiPv-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/tty/serial/samsung_tty.c:948:31: error: passing 'const struct s3c24xx_uart_port *' to parameter of type 'struct s3c24xx_uart_port *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     948 |                 ret = s3c24xx_serial_rx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:856:68: note: passing argument to parameter 'ourport' here
     856 | static irqreturn_t s3c24xx_serial_rx_irq(struct s3c24xx_uart_port *ourport)
         |                                                                    ^
   drivers/tty/serial/samsung_tty.c:952:31: error: passing 'const struct s3c24xx_uart_port *' to parameter of type 'struct s3c24xx_uart_port *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     952 |                 ret = s3c24xx_serial_tx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:927:68: note: passing argument to parameter 'ourport' here
     927 | static irqreturn_t s3c24xx_serial_tx_irq(struct s3c24xx_uart_port *ourport)
         |                                                                    ^
   drivers/tty/serial/samsung_tty.c:969:31: error: passing 'const struct s3c24xx_uart_port *' to parameter of type 'struct s3c24xx_uart_port *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     969 |                 ret = s3c24xx_serial_rx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:856:68: note: passing argument to parameter 'ourport' here
     856 | static irqreturn_t s3c24xx_serial_rx_irq(struct s3c24xx_uart_port *ourport)
         |                                                                    ^
   drivers/tty/serial/samsung_tty.c:973:31: error: passing 'const struct s3c24xx_uart_port *' to parameter of type 'struct s3c24xx_uart_port *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     973 |                 ret = s3c24xx_serial_tx_irq(ourport);
         |                                             ^~~~~~~
   drivers/tty/serial/samsung_tty.c:927:68: note: passing argument to parameter 'ourport' here
     927 | static irqreturn_t s3c24xx_serial_tx_irq(struct s3c24xx_uart_port *ourport)
         |                                                                    ^
   4 errors generated.


vim +948 drivers/tty/serial/samsung_tty.c

   938	
   939	/* interrupt handler for s3c64xx and later SoC's.*/
   940	static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
   941	{
   942		const struct s3c24xx_uart_port *ourport = id;
   943		const struct uart_port *port = &ourport->port;
   944		u32 pend = rd_regl(port, S3C64XX_UINTP);
   945		irqreturn_t ret = IRQ_HANDLED;
   946	
   947		if (pend & S3C64XX_UINTM_RXD_MSK) {
 > 948			ret = s3c24xx_serial_rx_irq(ourport);
   949			wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
   950		}
   951		if (pend & S3C64XX_UINTM_TXD_MSK) {
   952			ret = s3c24xx_serial_tx_irq(ourport);
   953			wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
   954		}
   955		return ret;
   956	}
   957	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2024-08-09  7:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 15:29 [PATCH 0/2] tty: serial: samsung_tty: simple cleanups André Draszik
2024-08-06 15:29 ` [PATCH 1/2] tty: serial: samsung_tty: drop unused argument to irq handlers André Draszik
2024-08-07 10:49   ` Tudor Ambarus
2024-08-06 15:29 ` [PATCH 2/2] tty: serial: samsung_tty: cast the interrupt's void *id just once André Draszik
2024-08-07 10:49   ` Tudor Ambarus
2024-08-09  7:01   ` kernel test robot
2024-08-09  7:21   ` kernel test robot
2024-08-07 11:09 ` [PATCH 0/2] tty: serial: samsung_tty: simple cleanups Greg Kroah-Hartman
2024-08-07 11:17   ` André Draszik
2024-08-07 12:00   ` André Draszik
2024-08-07 13:53     ` Tudor Ambarus
2024-08-07 13:58       ` André Draszik
2024-08-08  7:23         ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®