Commit 1ad371de authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: pvrusb2: fix the retry logic

As reported by this warning:
	drivers/media/usb/pvrusb2/pvrusb2-encoder.c:263 pvr2_encoder_cmd() warn: continue to end of do { ... } while(0); loop

There's an issue at the retry logic there: the current logic is:

	do {
		if (need_to_retry)
			continue;

		some_code();
	} while (0);

Well, that won't work, as continue will make it test for zero, and
abort the loop. So, change the loop to:

	while (1) {
		if (need_to_retry)
			continue;

		some_code();
		break;
	};

With seems to be what's actually expected there.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent f3b38dca
...@@ -198,7 +198,7 @@ static int pvr2_encoder_cmd(void *ctxt, ...@@ -198,7 +198,7 @@ static int pvr2_encoder_cmd(void *ctxt,
} }
LOCK_TAKE(hdw->ctl_lock); do { LOCK_TAKE(hdw->ctl_lock); while (1) {
if (!hdw->state_encoder_ok) { if (!hdw->state_encoder_ok) {
ret = -EIO; ret = -EIO;
...@@ -293,9 +293,9 @@ rdData[0]); ...@@ -293,9 +293,9 @@ rdData[0]);
wrData[0] = 0x0; wrData[0] = 0x0;
ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,1); ret = pvr2_encoder_write_words(hdw,MBOX_BASE,wrData,1);
if (ret) break; break;
} while(0); LOCK_GIVE(hdw->ctl_lock); }; LOCK_GIVE(hdw->ctl_lock);
return ret; return ret;
} }
......
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