All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout
@ 2015-12-24 13:54 ` Gujulan Elango, Hari Prasath (H.)
  0 siblings, 0 replies; 4+ messages in thread
From: Gujulan Elango, Hari Prasath (H.) @ 2015-12-24 13:54 UTC (permalink / raw)
  To: gregkh, lidza.louina, markh, driverdev-devel; +Cc: devel, linux-kernel

This patch makes use of wait_event_interruptible_timeout to achieve timeout
functionality.This is a TODO mentiond in the comment which is also removed.
It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
---
 drivers/staging/dgnc/dgnc_neo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 39c76e7..7d9efe0 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1306,10 +1306,8 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
 	/*
 	 * Go to sleep waiting for the tty layer to wake me back up when
 	 * the empty flag goes away.
-	 *
-	 * NOTE: TODO: Do something with time passed in.
 	 */
-	rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0));
+	rc = wait_event_interruptible_timeout(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0), msecs_to_jiffies(seconds * 1000));
 
 	/* If ret is non-zero, user ctrl-c'ed us */
 	return rc;
-- 
1.9.1

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

* [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout
@ 2015-12-24 13:54 ` Gujulan Elango, Hari Prasath (H.)
  0 siblings, 0 replies; 4+ messages in thread
From: Gujulan Elango, Hari Prasath (H.) @ 2015-12-24 13:54 UTC (permalink / raw)
  To: gregkh, lidza.louina, markh, driverdev-devel; +Cc: devel, linux-kernel

This patch makes use of wait_event_interruptible_timeout to achieve timeout
functionality.This is a TODO mentiond in the comment which is also removed.
It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
---
 drivers/staging/dgnc/dgnc_neo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 39c76e7..7d9efe0 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1306,10 +1306,8 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
 	/*
 	 * Go to sleep waiting for the tty layer to wake me back up when
 	 * the empty flag goes away.
-	 *
-	 * NOTE: TODO: Do something with time passed in.
 	 */
-	rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0));
+	rc = wait_event_interruptible_timeout(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0), msecs_to_jiffies(seconds * 1000));
 
 	/* If ret is non-zero, user ctrl-c'ed us */
 	return rc;
-- 
1.9.1

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

* Re: [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout
  2015-12-24 13:54 ` Gujulan Elango, Hari Prasath (H.)
@ 2016-02-08  4:09   ` gregkh
  -1 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2016-02-08  4:09 UTC (permalink / raw)
  To: Gujulan Elango, Hari Prasath (H.)
  Cc: lidza.louina, markh, driverdev-devel, devel, linux-kernel

On Thu, Dec 24, 2015 at 01:54:12PM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> This patch makes use of wait_event_interruptible_timeout to achieve timeout
> functionality.This is a TODO mentiond in the comment which is also removed.
> It also aligns with what the function is supposed to do as in the
> comments.
> 
> Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
> ---
>  drivers/staging/dgnc/dgnc_neo.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
> index 39c76e7..7d9efe0 100644
> --- a/drivers/staging/dgnc/dgnc_neo.c
> +++ b/drivers/staging/dgnc/dgnc_neo.c
> @@ -1306,10 +1306,8 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
>  	/*
>  	 * Go to sleep waiting for the tty layer to wake me back up when
>  	 * the empty flag goes away.
> -	 *
> -	 * NOTE: TODO: Do something with time passed in.
>  	 */
> -	rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0));
> +	rc = wait_event_interruptible_timeout(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0), msecs_to_jiffies(seconds * 1000));

Any reason you didn't properly wrap your line at the 80 column limit?

Please fix and resend.

thanks,

greg k-h

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

* Re: [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout
@ 2016-02-08  4:09   ` gregkh
  0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2016-02-08  4:09 UTC (permalink / raw)
  To: Gujulan Elango, Hari Prasath (H.)
  Cc: lidza.louina, markh, driverdev-devel, devel, linux-kernel

On Thu, Dec 24, 2015 at 01:54:12PM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> This patch makes use of wait_event_interruptible_timeout to achieve timeout
> functionality.This is a TODO mentiond in the comment which is also removed.
> It also aligns with what the function is supposed to do as in the
> comments.
> 
> Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
> ---
>  drivers/staging/dgnc/dgnc_neo.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
> index 39c76e7..7d9efe0 100644
> --- a/drivers/staging/dgnc/dgnc_neo.c
> +++ b/drivers/staging/dgnc/dgnc_neo.c
> @@ -1306,10 +1306,8 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
>  	/*
>  	 * Go to sleep waiting for the tty layer to wake me back up when
>  	 * the empty flag goes away.
> -	 *
> -	 * NOTE: TODO: Do something with time passed in.
>  	 */
> -	rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0));
> +	rc = wait_event_interruptible_timeout(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0), msecs_to_jiffies(seconds * 1000));

Any reason you didn't properly wrap your line at the 80 column limit?

Please fix and resend.

thanks,

greg k-h

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

end of thread, other threads:[~2016-02-08  4:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-24 13:54 [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout Gujulan Elango, Hari Prasath (H.)
2015-12-24 13:54 ` Gujulan Elango, Hari Prasath (H.)
2016-02-08  4:09 ` gregkh
2016-02-08  4:09   ` gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.