linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Richard Zhao <richard.zhao@freescale.com>, linux-media@vger.kernel.org
Subject: Re: __video_register_device: warning cannot be reached if warn_if_nr_in_use
Date: Thu, 09 Aug 2012 15:52:03 +0200	[thread overview]
Message-ID: <5023C083.8040003@samsung.com> (raw)
In-Reply-To: <201208091519.19254.hverkuil@xs4all.nl>

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

      parent reply	other threads:[~2012-08-09 13:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5023C083.8040003@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=richard.zhao@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).