Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1328789 > unrolled thread

[PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout

Started by"Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
First post2016-02-08 07:40 +0100
Last post2016-02-08 07:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com> - 2016-02-08 07:40 +0100

#1328789 — [PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout

From"Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
Date2016-02-08 07:40 +0100
Subject[PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout
Message-ID<qZNEm-1tp-3@gated-at.bofh.it>
From: Hari Prasath Gujulan Elango <hgujulan@visteon.com>

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>
---
	v2: Patch introduced checkpatch warning on the 80 character
	    limit & it was pointed out by Greg.Hence resubmitting
---
 drivers/staging/dgnc/dgnc_neo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 39c76e7..ee3155b 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1306,10 +1306,10 @@ 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web