public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Krufky <mkrufky@linuxtv.org>
To: stable@kernel.org
Cc: linux-kernel@vger.kernel.org,
	v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
	Mike Isely <isely@pobox.com>
Subject: [2.6.18.y PATCH 5/6] pvrusb2: Suppress compiler warning
Date: Sun, 08 Oct 2006 14:42:14 -0400	[thread overview]
Message-ID: <45294686.6050003@linuxtv.org> (raw)

>From 8e9961660bc5701f82970c4b5a2eb239efb5c2d1 Mon Sep 17 00:00:00 2001
From: Mike Isely <isely@pobox.com>
Date: Sun, 24 Sep 2006 10:45:28 -0400
Subject: [PATCH] pvrusb2: Suppress compiler warning

The pvrusb2 driver needs to call video_devdata() in order to correctly
transform a file pointer into a video_device pointer.  Unfortunately
the prototype for this function has been marked V4L1-only and there's
no official substitute that I can find for V4L2.  Adding to the
mystery is that the implementation for this function exists whether or
not V4L1 compatibility has been selected.  The upshot of all this is
that we get a compilation warning here about a missing prototype but
the code links OK.  This fix solves the warning by copying the
prototype into the source file that is using it.  Yes this is a hack,
but it's a safe one for 2.6.18 (any alternative would be much more
intrusive).  A better solution should be forthcoming for the next
kernel.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
---
 drivers/media/video/pvrusb2/pvrusb2-v4l2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 128e6b5..385b715 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -32,6 +32,12 @@ #include "pvrusb2-ioread.h"
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 
+/* Mike Isely <isely@pobox.com> 23-Sep-2006 - This function is prototyped
+ * only for V4L1 but is implemented regardless of the V4L1 compatibility
+ * option state.  V4L2 has no replacement for this and we need it.  For now
+ * copy the prototype here so we can avoid the compiler warning. */
+extern struct video_device* video_devdata(struct file*);
+
 struct pvr2_v4l2_dev;
 struct pvr2_v4l2_fh;
 struct pvr2_v4l2;

                 reply	other threads:[~2006-10-08 18:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=45294686.6050003@linuxtv.org \
    --to=mkrufky@linuxtv.org \
    --cc=isely@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /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