* [PATCH] serial: tegra: Switch to using struct tty_port
@ 2013-01-17 13:31 Thierry Reding
2013-01-17 17:07 ` Stephen Warren
0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2013-01-17 13:31 UTC (permalink / raw)
To: Alan Cox
Cc: Greg Kroah-Hartman, Jiri Slaby, Stephen Warren, Laxman Dewangan,
linux-serial-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Many of the tty functions were converted to use a struct tty_port
instead of a struct tty_struct. Update the Tegra driver accordingly to
avoid build breakage.
Signed-off-by: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
---
drivers/tty/serial/serial-tegra.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index cc4072f..30d6ff6 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -504,7 +504,7 @@ static void tegra_uart_handle_tx_pio(struct tegra_uart_port *tup)
}
static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
- struct tty_struct *tty)
+ struct tty_port *tty)
{
do {
char flag = TTY_NORMAL;
@@ -527,7 +527,7 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
}
static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
- struct tty_struct *tty, int count)
+ struct tty_port *tty, int count)
{
int copied;
@@ -554,6 +554,7 @@ static void tegra_uart_rx_dma_complete(void *args)
struct uart_port *u = &tup->uport;
int count = tup->rx_bytes_requested;
struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
+ struct tty_port *port = &u->state->port;
unsigned long flags;
async_tx_ack(tup->rx_dma_desc);
@@ -565,11 +566,11 @@ static void tegra_uart_rx_dma_complete(void *args)
/* If we are here, DMA is stopped */
if (count)
- tegra_uart_copy_rx_to_tty(tup, tty, count);
+ tegra_uart_copy_rx_to_tty(tup, port, count);
- tegra_uart_handle_rx_pio(tup, tty);
+ tegra_uart_handle_rx_pio(tup, port);
if (tty) {
- tty_flip_buffer_push(tty);
+ tty_flip_buffer_push(port);
tty_kref_put(tty);
}
tegra_uart_start_rx_dma(tup);
@@ -585,6 +586,7 @@ static void tegra_uart_handle_rx_dma(struct tegra_uart_port *tup)
{
struct dma_tx_state state;
struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
+ struct tty_port *port = &tup->uport.state->port;
int count;
/* Deactivate flow control to stop sender */
@@ -597,11 +599,11 @@ static void tegra_uart_handle_rx_dma(struct tegra_uart_port *tup)
/* If we are here, DMA is stopped */
if (count)
- tegra_uart_copy_rx_to_tty(tup, tty, count);
+ tegra_uart_copy_rx_to_tty(tup, port, count);
- tegra_uart_handle_rx_pio(tup, tty);
+ tegra_uart_handle_rx_pio(tup, port);
if (tty) {
- tty_flip_buffer_push(tty);
+ tty_flip_buffer_push(port);
tty_kref_put(tty);
}
tegra_uart_start_rx_dma(tup);
@@ -724,6 +726,7 @@ static void tegra_uart_stop_rx(struct uart_port *u)
{
struct tegra_uart_port *tup = to_tegra_uport(u);
struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
+ struct tty_port *port = &u->state->port;
struct dma_tx_state state;
unsigned long ier;
int count;
@@ -747,13 +750,13 @@ static void tegra_uart_stop_rx(struct uart_port *u)
dmaengine_tx_status(tup->rx_dma_chan, tup->rx_cookie, &state);
async_tx_ack(tup->rx_dma_desc);
count = tup->rx_bytes_requested - state.residue;
- tegra_uart_copy_rx_to_tty(tup, tty, count);
- tegra_uart_handle_rx_pio(tup, tty);
+ tegra_uart_copy_rx_to_tty(tup, port, count);
+ tegra_uart_handle_rx_pio(tup, port);
} else {
- tegra_uart_handle_rx_pio(tup, tty);
+ tegra_uart_handle_rx_pio(tup, port);
}
if (tty) {
- tty_flip_buffer_push(tty);
+ tty_flip_buffer_push(port);
tty_kref_put(tty);
}
return;
--
1.8.1.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] serial: tegra: Switch to using struct tty_port
2013-01-17 13:31 [PATCH] serial: tegra: Switch to using struct tty_port Thierry Reding
@ 2013-01-17 17:07 ` Stephen Warren
2013-01-17 17:34 ` Laxman Dewangan
[not found] ` <50F82FE7.9090403-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2013-01-17 17:07 UTC (permalink / raw)
To: Thierry Reding
Cc: Alan Cox, Greg Kroah-Hartman, Jiri Slaby, Stephen Warren,
Laxman Dewangan, linux-serial, linux-tegra, linux-kernel
On 01/17/2013 06:31 AM, Thierry Reding wrote:
> Many of the tty functions were converted to use a struct tty_port
> instead of a struct tty_struct. Update the Tegra driver accordingly to
> avoid build breakage.
I tested that this does indeed fix the build warnings. I didn't test the
resultant driver.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] serial: tegra: Switch to using struct tty_port
2013-01-17 17:07 ` Stephen Warren
@ 2013-01-17 17:34 ` Laxman Dewangan
[not found] ` <50F82FE7.9090403-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
1 sibling, 0 replies; 5+ messages in thread
From: Laxman Dewangan @ 2013-01-17 17:34 UTC (permalink / raw)
To: Stephen Warren
Cc: Thierry Reding, Alan Cox, Greg Kroah-Hartman, Jiri Slaby,
Stephen Warren, linux-serial@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
On Thursday 17 January 2013 10:37 PM, Stephen Warren wrote:
> On 01/17/2013 06:31 AM, Thierry Reding wrote:
>> Many of the tty functions were converted to use a struct tty_port
>> instead of a struct tty_struct. Update the Tegra driver accordingly to
>> avoid build breakage.
> I tested that this does indeed fix the build warnings. I didn't test the
> resultant driver.
>
The api prototype changes and driver development went in parallel and
hence the driver uses the older api. Both got merged on similar time and
so out of sync.
I think this change is proper. I have not tested this change but
reviewing code, it looks good to me.
Acked-By: Laxman Dewangan<ldewangan@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] serial: tegra: Switch to using struct tty_port
[not found] ` <50F82FE7.9090403-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-01-18 8:37 ` Thierry Reding
[not found] ` <20130118083756.GA3303-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2013-01-18 8:37 UTC (permalink / raw)
To: Stephen Warren
Cc: Alan Cox, Greg Kroah-Hartman, Jiri Slaby, Stephen Warren,
Laxman Dewangan, linux-serial-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]
On Thu, Jan 17, 2013 at 10:07:51AM -0700, Stephen Warren wrote:
> On 01/17/2013 06:31 AM, Thierry Reding wrote:
> > Many of the tty functions were converted to use a struct tty_port
> > instead of a struct tty_struct. Update the Tegra driver accordingly to
> > avoid build breakage.
>
> I tested that this does indeed fix the build warnings. I didn't test the
> resultant driver.
I wonder if this would have been caught earlier if it had errored out
instead of outputting lots of warnings. Looking at the gcc documentation
there doesn't seem to be a way to turn this kind of warning into an
error. That would leave -Werror as the only option to have the compiler
abort on this kind of warning.
Globally enabling -Werror might not be a good idea and I'm sure it must
have been discussed in the past (even though Google doesn't show any
references). In this particular case the warnings are actually severe
errors and are very likely to cause buggy behaviour so it would be good
to catch them at compile time. Warnings are unfortunately quite easy to
ignore.
I know I can always use EXTRA_CFLAGS to change this for local builds,
but maybe getting more people to do this would be worthwhile.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] serial: tegra: Switch to using struct tty_port
[not found] ` <20130118083756.GA3303-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
@ 2013-01-18 15:49 ` Laxman Dewangan
0 siblings, 0 replies; 5+ messages in thread
From: Laxman Dewangan @ 2013-01-18 15:49 UTC (permalink / raw)
To: Thierry Reding
Cc: Stephen Warren, Alan Cox, Greg Kroah-Hartman, Jiri Slaby,
Stephen Warren,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Friday 18 January 2013 02:07 PM, Thierry Reding wrote:
> * PGP Signed by an unknown key
>
> On Thu, Jan 17, 2013 at 10:07:51AM -0700, Stephen Warren wrote:
>> On 01/17/2013 06:31 AM, Thierry Reding wrote:
>>> Many of the tty functions were converted to use a struct tty_port
>>> instead of a struct tty_struct. Update the Tegra driver accordingly to
>>> avoid build breakage.
>> I tested that this does indeed fix the build warnings. I didn't test the
>> resultant driver.
> I wonder if this would have been caught earlier if it had errored out
> instead of outputting lots of warnings. Looking at the gcc documentation
> there doesn't seem to be a way to turn this kind of warning into an
> error. That would leave -Werror as the only option to have the compiler
> abort on this kind of warning.
>
> Globally enabling -Werror might not be a good idea and I'm sure it must
> have been discussed in the past (even though Google doesn't show any
> references). In this particular case the warnings are actually severe
> errors and are very likely to cause buggy behaviour so it would be good
> to catch them at compile time. Warnings are unfortunately quite easy to
> ignore.
>
> I know I can always use EXTRA_CFLAGS to change this for local builds,
> but maybe getting more people to do this would be worthwhile.
>
There was no issue when patch created. The change happen in the api with
same time when patch created and so become out of sync.
API changed with commit on 1/16. Serial driver also get added on 1/16.
Author: Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org> 2013-01-03 20:23:06
Committer: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> 2013-01-16
12:00:15
Follows: v3.8-rc3
Precedes: next-20130117
TTY: switch tty_flip_buffer_push
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-18 15:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 13:31 [PATCH] serial: tegra: Switch to using struct tty_port Thierry Reding
2013-01-17 17:07 ` Stephen Warren
2013-01-17 17:34 ` Laxman Dewangan
[not found] ` <50F82FE7.9090403-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-18 8:37 ` Thierry Reding
[not found] ` <20130118083756.GA3303-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-18 15:49 ` Laxman Dewangan
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).