From patchwork Wed Jun 29 13:20:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9205117 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 5014F607D8 for ; Wed, 29 Jun 2016 13:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41E69285BA for ; Wed, 29 Jun 2016 13:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36A4928655; Wed, 29 Jun 2016 13:24:39 +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 2C5BF285BA for ; Wed, 29 Jun 2016 13:24:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbcF2NYW (ORCPT ); Wed, 29 Jun 2016 09:24:22 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:57719 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404AbcF2NVB (ORCPT ); Wed, 29 Jun 2016 09:21:01 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9J02CH0BQWFN40@mailout1.samsung.com>; Wed, 29 Jun 2016 22:20:56 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id DF.5E.05161.83BC3775; Wed, 29 Jun 2016 22:20:56 +0900 (KST) X-AuditID: cbfee68f-f79476d000001429-1d-5773cb380ac0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 62.6D.04429.83BC3775; Wed, 29 Jun 2016 06:20:56 -0700 (MST) Received: from samsunx.samsung ([10.113.63.54]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9J0087XBQTVM50@mmp1.samsung.com>; Wed, 29 Jun 2016 22:20:56 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH 06/15] lirc_dev: do not use goto to create loops Date: Wed, 29 Jun 2016 22:20:35 +0900 Message-id: <1467206444-9935-7-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467206444-9935-1-git-send-email-andi.shyti@samsung.com> References: <1467206444-9935-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkUNfidHG4weWDphbbjzxjtVj84zmT xeVdc9gsejZsZbVY/azCgdXj+pJPzB5b+u+ye/RtWcXo8XmTXABLFJdNSmpOZllqkb5dAlfG rOfTWAr2sFXsXvuHsYGxm7WLkZNDQsBE4tP+iSwQtpjEhXvr2boYuTiEBFYwSkw9uAwowQFW 9PytMkR8KaNE14U/TBDOR0aJSae+s4F0swloSjTd/sEG0iAiYCxx7oc6SJhZoJlRYvd1IxBb WMBBYs+2C2DLWARUJVbNmwLWyivgKvG2ayYjxBFyEpenPwCLcwq4SSw/f5MdxBYCqml9+p8R ZK+EQDe7xOQ1b1ghBglIfJt8COpQWYlNB5gh5khKHFxxg2UCo/ACRoZVjKKpBckFxUnpRcZ6 xYm5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iWb2Se2Dq55OmbBvny/3o frGn1zbh+M7ATK/EOIfylUwzU96u23uQ1Wc749Jj33OSFUub/2QLXWZ7I/vy8ocy3mQdq13f H27wZ3b7q/HkO9e17X/mRDjcfHguIEOJpTgj0VCLuag4EQCfsvlzqgIAAA== 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 400ab80..cc00b9a 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -103,12 +103,11 @@ static int lirc_add_to_buf(struct irctl *ir) * 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) { - got_data++; - goto get_data; - } + do { + res = ir->d.add_to_buf(ir->d.data, ir->buf); + if (!res) + got_data++; + } while (!res); if (res == -ENODEV) kthread_stop(ir->task);