Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbbLXO2v (ORCPT ); Thu, 24 Dec 2015 09:28:51 -0500 Received: from mail-db3on0147.outbound.protection.outlook.com ([157.55.234.147]:38129 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751356AbbLXO2t convert rfc822-to-8bit (ORCPT ); Thu, 24 Dec 2015 09:28:49 -0500 X-Greylist: delayed 13185 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Dec 2015 09:28:49 EST From: "Gujulan Elango, Hari Prasath (H.)" To: "gregkh@linuxfoundation.org" , "lidza.louina@gmail.com" , "markh@compro.net" , "driverdev-devel@linuxdriverproject.org" CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout Thread-Topic: [PATCH] staging: dgnc: convert to wait_event_interruptible_timeout Thread-Index: AQHRPlKRjJqL12NJr06HmuUVj69rww== Date: Thu, 24 Dec 2015 13:54:12 +0000 Message-ID: <20151224135458.GA353@IND12F0122> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=hgujulan@visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [91.212.132.116] x-microsoft-exchange-diagnostics: 1;DB5PR06MB1575;5:AVQYlbB83tbZ66kn0TUuVN8xaab7Mwk5OC/Ak/foO+Vdu36BoT0lHWLQyY0uKf/AHT7VbsjV4Pdp5Sxp/gmjWZ70v3Jl5FydcK1hv2EiRJVrAer0gyU+4/jdbj85DH+B6dU8VRxnYtFxS8MHSeLVGQ==;24:rKm7tlTL74aUaHqHu0cflGsLfbJeeB/+DBcw44H7jdQhF9q7ScaMfcu97FxIUszRv1Zk0stxAz/reab4i0YXaizlpq6F6FM4tecCch6/q9g= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1575; 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)(520078)(8121501046)(10201501046)(3002001);SRVR:DB5PR06MB1575;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1575; x-forefront-prvs: 0800C0C167 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(81156007)(105586002)(2501003)(5001960100002)(97736004)(5001770100001)(66066001)(50986999)(122556002)(101416001)(106356001)(19580405001)(33656002)(19580395003)(229853001)(106116001)(54356999)(2201001)(86362001)(33716001)(2860100001)(5002640100001)(189998001)(1096002)(2900100001)(87936001)(1220700001)(40100003)(77096005)(11100500001)(10400500002)(1076002)(586003)(5008740100001)(3846002)(92566002)(5004730100002)(6116002)(102836003);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR06MB1575;H:DB5PR06MB1573.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <3A94227B487A3D4D933FC9E4A310153B@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2015 13:54:12.4882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR06MB1575 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 33 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/