lists.zerezo.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [v4l-dvb-maintainer] [PATCH] [PATCH] v4l: Introduce "index" attribute for?persistent video4linux device nodes



On Thu, 17 Jul 2008, Hans Verkuil wrote:

On Wednesday 25 June 2008 00:59:51 Brandon Philips wrote:
On 00:34 Tue 24 Jun 2008, Trent Piepho wrote:
On Mon, 23 Jun 2008, Brandon Philips wrote:
+	for (i = 0; i < 32; i++) {
+		if (used & (1 << i))
+			continue;
+		return i;
+	}

	i = ffz(used);
	return i >= 32 ? -ENFILE : i;

Err. Right :D  Tested and pushed.

Mauro-

Updated http://ifup.org/hg/v4l-dvb to have Trent's improvement.

Cheers,

	Brandon


Hi Mauro,

I think you missed this pull request from Brandon. Can you merge this?

Yes, I missed that one.

Yet, I didn't like the usage of "32" magic numbers on those parts:

-       if (num >= VIDEO_NUM_DEVICES)
+
+       if (num >= 32) {
+               printk(KERN_ERR "videodev: %s num is too large\n", __func__);

+       return i >= 32 ? -ENFILE : i;


It seems better to use VIDEO_NUM_DEVICES as the maximum limit on both usages of "32".

Brandon,

Could you fix and re-send me a pull request?

--
Cheers,
Mauro Carvalho Chehab
http://linuxtv.org
mchehab@xxxxxxxxxxxxx

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list