Re: __video_register_device: warning cannot be reached if warn_if_nr_in_use

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

 



On Thu August 9 2012 14:55:02 Richard Zhao wrote:
> In file drivers/media/video/v4l2-dev.c
> 
> int __video_register_device(struct video_device *vdev, int type, int nr,
> 		int warn_if_nr_in_use, struct module *owner)
> {
> [...]
> 	vdev->minor = i + minor_offset;
> 878:	vdev->num = nr;
> 
> vdev->num is set to nr here. 
> [...]
> 	if (nr != -1 && nr != vdev->num && warn_if_nr_in_use)
> 		printk(KERN_WARNING "%s: requested %s%d, got %s\n", __func__,
> 			name_base, nr, video_device_node_name(vdev));
> 
> so nr != vdev->num is always false. The warning can never be printed.

Hmm, true. The question is, should we just fix this, or drop the warning altogether?
Clearly nobody missed that warning.

I'm inclined to drop the warning altogether and so also the video_register_device_no_warn
inline function.

What do others think?

	Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux