From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755314AbcBHGjZ (ORCPT ); Mon, 8 Feb 2016 01:39:25 -0500 Received: from mail-db3on0146.outbound.protection.outlook.com ([157.55.234.146]:51376 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755023AbcBHGjX convert rfc822-to-8bit (ORCPT ); Mon, 8 Feb 2016 01:39:23 -0500 From: "Gujulan Elango, Hari Prasath (H.)" To: "gregkh@linuxfoundation.org" , "lidza.louina@gmail.com" , "markh@compro.net" CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "driverdev-devel@linuxdriverproject.org" Subject: [PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout Thread-Topic: [PATCHv2] staging: dgnc: convert to wait_event_interruptible_timeout Thread-Index: AQHRYjtxUN33J4krH0avST32zHDD2g== Date: Mon, 8 Feb 2016 06:39:21 +0000 Message-ID: <20160208064031.GA17246@IND12F0122> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=none action=none header.from=visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [91.212.132.118] x-microsoft-exchange-diagnostics: 1;DB5PR06MB1574;5:WJfP9mX+6nyy3ZIrXgIvhd5cfJKwkTsQ2ePkzAcJRB/5jRmWcL8On1Fwb3FJk2qWC8AHJSZZePdrPQiyRBrPKBLL3GT8TWJr0S6l4fOifdfGDx6Newj1m7e6NmbqEkjc1mjBbA6Zi3hnltLemcikPg==;24:UyRaBjRI8pkuDLbzhJddU0K0xYmovtQNc+X+uurlWJzy0QT3K7JB9OsQMt+Y76nuCCpAxxpPAd3Qm4vJbr7gR5WvQeiX2FUInhkM2QCNlqQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1574; x-ms-office365-filtering-correlation-id: 0b98e6a6-e2ad-47ac-2e77-08d3305293e2 x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(208512329853888); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:DB5PR06MB1574;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1574; x-forefront-prvs: 084674B2CF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(10400500002)(77096005)(5001770100001)(2201001)(19580395003)(92566002)(5002640100001)(19580405001)(189998001)(54356999)(50986999)(1076002)(1220700001)(4326007)(5001960100002)(2906002)(1096002)(586003)(102836003)(3846002)(6116002)(2501003)(86362001)(3660700001)(3280700002)(122556002)(11100500001)(5004730100002)(33716001)(229853001)(33656002)(2900100001)(106116001)(40100003)(5008740100001)(87936001)(66066001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR06MB1574;H:DB5PR06MB1573.eurprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <9AB12F75452F1D4D888768F0DC4CB63F@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2016 06:39:21.4959 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR06MB1574 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hari Prasath Gujulan Elango 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 --- 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