From patchwork Wed Jul 6 09:01:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9215919 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 E96E660467 for ; Wed, 6 Jul 2016 09:46:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8B91287D1 for ; Wed, 6 Jul 2016 09:46:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CABAA287D9; Wed, 6 Jul 2016 09:46:00 +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 538B0287D1 for ; Wed, 6 Jul 2016 09:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbcGFJpm (ORCPT ); Wed, 6 Jul 2016 05:45:42 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:56504 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753094AbcGFJoC (ORCPT ); Wed, 6 Jul 2016 05:44:02 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9W022VR0D6A830@mailout2.samsung.com>; Wed, 06 Jul 2016 18:43:54 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id CB.69.05161.9D2DC775; Wed, 6 Jul 2016 18:43:53 +0900 (KST) X-AuditID: cbfee68f-f79476d000001429-35-577cd2d9c8f5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 8C.B5.04429.9D2DC775; Wed, 6 Jul 2016 02:43:53 -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 <0O9W003BE0D2J600@mmp2.samsung.com>; Wed, 06 Jul 2016 18:43:53 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab Cc: Joe Perches , Sean Young , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v3 06/15] [media] lirc_dev: do not use goto to create loops Date: Wed, 06 Jul 2016 18:01:18 +0900 Message-id: <1467795687-10737-7-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1467795687-10737-1-git-send-email-andi.shyti@samsung.com> References: <1467795687-10737-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsWyRsSkQPfmpZpwgwdNthbbjzxjtVj84zmT xanJz5gsZt9/zGJxedccNoueDVtZLVY/q7BY+PQ7iwOHx/Uln5g9lryx9tjSf5fd48uqa8we fVtWMXp83iTncerrZ/YA9igum5TUnMyy1CJ9uwSujO1PlzAVtLFXXJ0f1MC4k7WLkZNDQsBE Ysnav1C2mMSFe+vZuhi5OIQEVjBKbJ+7nwWm6OeRb0wQiVmMEhOeH2aGcD4ySvxadpMJpIpN QFOi6fYPoHYODhEBY4lzP9RBapgFnjJK7Js6F6xGWMBbYsbVp+wgNouAqkTn2wYwm1fATeL9 c5iT5CQuT38ANodTwF3i6nIlkLAQUMn+bTfZQWZKCKxjl1g0sYE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uJ8z7+vy5M SCA9sSQ1OzW1ILUIpo+Jg1OqgdFtVccl5vJ1ch3STpF6eZVleQ9Tt6/tkTz0+sSWnKbvy038 k+at4TF7xKY9O/jlOa7XOQu6BQq7BGIq511cq2SxdEGPqVhUuUj/NKlpH+scDT9WvhXj82xp O7XOIUp+/hyjwx9ljubYN4jfnXCQW2T7/cpJ/RO7I9cvNp4nU7D98pWZs0uuqyqxFGckGmox FxUnAgDET4GWxwIAAA== 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 b11d026..cfa6031 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);