lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] tty: new helper function tty_get_icount()
On Tue, Dec 17, 2019 at 09:17:17AM +0100, Uwe Kleine-König wrote:
> For a given struct tty_struct this yields the corresponding statistics
> about sent and received characters (and some more)

Why?

>
> Use the function to simplify tty_tiocgicount().
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/tty/tty_io.c | 20 ++++++++++++++++----
> include/linux/tty.h | 2 ++
> 2 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> index 584025117cd3..df3942eb3468 100644
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -2497,15 +2497,27 @@ static int tty_tiocmset(struct tty_struct *tty, unsigned int cmd,
> return tty->ops->tiocmset(tty, set, clear);
> }
>
> +int tty_get_icount(struct tty_struct *tty,
> + struct serial_icounter_struct *icount)

kerneldoc?

> +{
> + memset(icount, 0, sizeof(*icount));
> +
> + if (tty->ops->get_icount)
> + return tty->ops->get_icount(tty, icount);
> + else
> + return -EINVAL;
> +}
> +EXPORT_SYMBOL(tty_get_icount);

EXPORT_SYMBOL_GPL() please.

thanks,

greg k-h

\
 
 \ /
  Last update: 2019-12-17 09:29    [W:0.048 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site