From patchwork Fri Jul 1 08:01:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9209461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56A8460221 for ; Fri, 1 Jul 2016 08:19:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47EA62868E for ; Fri, 1 Jul 2016 08:19:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BBDA28695; Fri, 1 Jul 2016 08:19:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15FB2868E for ; Fri, 1 Jul 2016 08:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752724AbcGAIKU (ORCPT ); Fri, 1 Jul 2016 04:10:20 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:41748 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbcGAIE2 (ORCPT ); Fri, 1 Jul 2016 04:04:28 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9M028XYMAZ4SA0@mailout3.samsung.com>; Fri, 01 Jul 2016 17:01:47 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 8E.13.05160.B6326775; Fri, 1 Jul 2016 17:01:47 +0900 (KST) X-AuditID: cbfee68e-f79266d000001428-b1-5776236bc1ac Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id E0.19.04429.B6326775; Fri, 1 Jul 2016 01:01:47 -0700 (MST) Received: from samsunx.samsung ([10.113.63.54]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9M00G9YMAVFJA0@mmp2.samsung.com>; Fri, 01 Jul 2016 17:01:46 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab Cc: Joe Perches , Sean Young , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v2 06/15] [media] lirc_dev: do not use goto to create loops Date: Fri, 01 Jul 2016 17:01:29 +0900 Message-id: <1467360098-12539-7-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467360098-12539-1-git-send-email-andi.shyti@samsung.com> References: <1467360098-12539-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkUDdbuSzcoL9FymL7kWesFot/PGey mH3/MYvF5V1z2Cx6NmxltVj9rMJi4dPvLA7sHteXfGL2WPLG2mNL/112jy+rrjF79G1Zxejx eZNcAFsUl01Kak5mWWqRvl0CV0Z7x2fGgjb2iq55c9kaGHeydjFyckgImEj0vVnBDmGLSVy4 t56ti5GLQ0hgBaPE66kL2WGK9t6dxwqRmMUo8eLmRkYI5yOjxLr7u8Cq2AQ0JZpu/wBq5+AQ ETCWOPdDHSTMLHCAUaK32wXEFhbwlug+t48RxGYRUJXYt7KTCcTmFXCTeNn9iAlimZzE5ekP 2EBsTgF3ibvvdoHVCwHVzN11jx1kr4TAInaJ/nkfmSEGCUh8m3yIBWSvh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baIDjxzW5026Fs/e63wtV41lmKcecpfXvpQQni7fE7FTj hhre1meTc3ddEjVxvFWq+fmmzFHZid9DHzeKKn1aanfsZmb/x9yd1sktlpVznn344Lj16B+v WwVfp3v1qlQLJ/EXFc+0COiPEA9lcapaq1t+w4T7sDJ7YcmN+I4VSizFGYmGWsxFxYkASZgh nr4CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... use "do .. while" instead. Signed-off-by: Andi Shyti --- drivers/media/rc/lirc_dev.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 0d988c9..da1777c 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -99,18 +99,16 @@ static int lirc_add_to_buf(struct irctl *ir) { if (ir->d.add_to_buf) { int res = -ENODATA; - int got_data = 0; + int got_data = -1; /* * service the device as long as it is returning * data and we have space */ -get_data: - res = ir->d.add_to_buf(ir->d.data, ir->buf); - if (res == 0) { + do { got_data++; - goto get_data; - } + res = ir->d.add_to_buf(ir->d.data, ir->buf); + } while (!res); if (res == -ENODEV) kthread_stop(ir->task);