Commit 7fe579d2 authored by Andi Shyti's avatar Andi Shyti Committed by Mauro Carvalho Chehab

[media] lirc_dev: do not use goto to create loops

... use "do .. while" instead.
Signed-off-by: default avatarAndi Shyti <andi.shyti@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 54fcecaf
...@@ -99,18 +99,16 @@ static int lirc_add_to_buf(struct irctl *ir) ...@@ -99,18 +99,16 @@ static int lirc_add_to_buf(struct irctl *ir)
{ {
if (ir->d.add_to_buf) { if (ir->d.add_to_buf) {
int res = -ENODATA; int res = -ENODATA;
int got_data = 0; int got_data = -1;
/* /*
* service the device as long as it is returning * service the device as long as it is returning
* data and we have space * data and we have space
*/ */
get_data: do {
res = ir->d.add_to_buf(ir->d.data, ir->buf);
if (res == 0) {
got_data++; got_data++;
goto get_data; res = ir->d.add_to_buf(ir->d.data, ir->buf);
} } while (!res);
if (res == -ENODEV) if (res == -ENODEV)
kthread_stop(ir->task); kthread_stop(ir->task);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment