* __video_register_device: warning cannot be reached if warn_if_nr_in_use
@ 2012-08-09 12:55 Richard Zhao
2012-08-09 13:19 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Richard Zhao @ 2012-08-09 12:55 UTC (permalink / raw)
To: linux-media
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.
Thanks
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: __video_register_device: warning cannot be reached if warn_if_nr_in_use
2012-08-09 12:55 __video_register_device: warning cannot be reached if warn_if_nr_in_use Richard Zhao
@ 2012-08-09 13:19 ` Hans Verkuil
2012-08-09 13:40 ` Richard Zhao
2012-08-09 13:52 ` Sylwester Nawrocki
0 siblings, 2 replies; 4+ messages in thread
From: Hans Verkuil @ 2012-08-09 13:19 UTC (permalink / raw)
To: Richard Zhao; +Cc: linux-media
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: __video_register_device: warning cannot be reached if warn_if_nr_in_use
2012-08-09 13:19 ` Hans Verkuil
@ 2012-08-09 13:40 ` Richard Zhao
2012-08-09 13:52 ` Sylwester Nawrocki
1 sibling, 0 replies; 4+ messages in thread
From: Richard Zhao @ 2012-08-09 13:40 UTC (permalink / raw)
To: Hans Verkuil, Richard Zhao; +Cc: linux-media
Hans Verkuil <hverkuil@xs4all.nl> wrote:
>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?
+1
Richard
>
> Hans
>--
>To unsubscribe from this list: send the line "unsubscribe linux-media"
>in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
--
>From android phone
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: __video_register_device: warning cannot be reached if warn_if_nr_in_use
2012-08-09 13:19 ` Hans Verkuil
2012-08-09 13:40 ` Richard Zhao
@ 2012-08-09 13:52 ` Sylwester Nawrocki
1 sibling, 0 replies; 4+ messages in thread
From: Sylwester Nawrocki @ 2012-08-09 13:52 UTC (permalink / raw)
To: Hans Verkuil; +Cc: Richard Zhao, linux-media
On 08/09/2012 03:19 PM, Hans Verkuil wrote:
> 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?
Yeah, let's remove it.
--
Regards,
Sylwester
--
Sylwester Nawrocki
실베스터 나브로츠키
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-09 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09 12:55 __video_register_device: warning cannot be reached if warn_if_nr_in_use Richard Zhao
2012-08-09 13:19 ` Hans Verkuil
2012-08-09 13:40 ` Richard Zhao
2012-08-09 13:52 ` Sylwester Nawrocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).