Commit 12744ffe authored by Adrian Bunk's avatar Adrian Bunk Committed by Greg Kroah-Hartman

[PATCH] USB: USB w9968cf compile error

On Tue, Jul 13, 2004 at 06:25:59PM -0700, Andrew Morton wrote:
>...
> All 252 patches:
>...
> bk-usb.patch
>...

This patch marks w9968cf_valid_depth as inline, although it's used
before it's defined.

gcc 3.4 therefore correctly fails with:

<--  snip  -->

...
  CC      drivers/usb/media/w9968cf.o
drivers/usb/media/w9968cf.c: In function `w9968cf_set_picture':
drivers/usb/media/w9968cf.c:487: sorry, unimplemented: inlining failed
in call to 'w9968cf_valid_depth': function body not available
drivers/usb/media/w9968cf.c:1722: sorry, unimplemented: called from here
make[3]: *** [drivers/usb/media/w9968cf.o] Error 1

<--  snip  -->


This patch moves w9968cf_valid_depth above it's first user (it also uses
two other functions to keep the ordering of functions a bit more
consistent).
Signed-off-by: default avatarAdrian Bunk <bunk@fs.tum.de>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 6e6fc348
...@@ -481,11 +481,11 @@ static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*, ...@@ -481,11 +481,11 @@ static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*,
static void w9968cf_adjust_configuration(struct w9968cf_device*); static void w9968cf_adjust_configuration(struct w9968cf_device*);
static int w9968cf_turn_on_led(struct w9968cf_device*); static int w9968cf_turn_on_led(struct w9968cf_device*);
static int w9968cf_init_chip(struct w9968cf_device*); static int w9968cf_init_chip(struct w9968cf_device*);
static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture);
static int w9968cf_set_window(struct w9968cf_device*, struct video_window);
static inline u16 w9968cf_valid_palette(u16 palette); static inline u16 w9968cf_valid_palette(u16 palette);
static inline u16 w9968cf_valid_depth(u16 palette); static inline u16 w9968cf_valid_depth(u16 palette);
static inline u8 w9968cf_need_decompression(u16 palette); static inline u8 w9968cf_need_decompression(u16 palette);
static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture);
static int w9968cf_set_window(struct w9968cf_device*, struct video_window);
static int w9968cf_postprocess_frame(struct w9968cf_device*, static int w9968cf_postprocess_frame(struct w9968cf_device*,
struct w9968cf_frame_t*); struct w9968cf_frame_t*);
static int w9968cf_adjust_window_size(struct w9968cf_device*, u16* w, u16* h); static int w9968cf_adjust_window_size(struct w9968cf_device*, u16* w, u16* h);
...@@ -1708,6 +1708,50 @@ static int w9968cf_init_chip(struct w9968cf_device* cam) ...@@ -1708,6 +1708,50 @@ static int w9968cf_init_chip(struct w9968cf_device* cam)
} }
/*--------------------------------------------------------------------------
Return non-zero if the palette is supported, 0 otherwise.
--------------------------------------------------------------------------*/
static inline u16 w9968cf_valid_palette(u16 palette)
{
u8 i = 0;
while (w9968cf_formatlist[i].palette != 0) {
if (palette == w9968cf_formatlist[i].palette)
return palette;
i++;
}
return 0;
}
/*--------------------------------------------------------------------------
Return the depth corresponding to the given palette.
Palette _must_ be supported !
--------------------------------------------------------------------------*/
static inline u16 w9968cf_valid_depth(u16 palette)
{
u8 i=0;
while (w9968cf_formatlist[i].palette != palette)
i++;
return w9968cf_formatlist[i].depth;
}
/*--------------------------------------------------------------------------
Return non-zero if the format requires decompression, 0 otherwise.
--------------------------------------------------------------------------*/
static inline u8 w9968cf_need_decompression(u16 palette)
{
u8 i = 0;
while (w9968cf_formatlist[i].palette != 0) {
if (palette == w9968cf_formatlist[i].palette)
return w9968cf_formatlist[i].compression;
i++;
}
return 0;
}
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
Change the picture settings of the camera. Change the picture settings of the camera.
Return 0 on success, a negative number otherwise. Return 0 on success, a negative number otherwise.
...@@ -1966,50 +2010,6 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) ...@@ -1966,50 +2010,6 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win)
} }
/*--------------------------------------------------------------------------
Return non-zero if the palette is supported, 0 otherwise.
--------------------------------------------------------------------------*/
static inline u16 w9968cf_valid_palette(u16 palette)
{
u8 i = 0;
while (w9968cf_formatlist[i].palette != 0) {
if (palette == w9968cf_formatlist[i].palette)
return palette;
i++;
}
return 0;
}
/*--------------------------------------------------------------------------
Return the depth corresponding to the given palette.
Palette _must_ be supported !
--------------------------------------------------------------------------*/
static inline u16 w9968cf_valid_depth(u16 palette)
{
u8 i=0;
while (w9968cf_formatlist[i].palette != palette)
i++;
return w9968cf_formatlist[i].depth;
}
/*--------------------------------------------------------------------------
Return non-zero if the format requires decompression, 0 otherwise.
--------------------------------------------------------------------------*/
static inline u8 w9968cf_need_decompression(u16 palette)
{
u8 i = 0;
while (w9968cf_formatlist[i].palette != 0) {
if (palette == w9968cf_formatlist[i].palette)
return w9968cf_formatlist[i].compression;
i++;
}
return 0;
}
/*-------------------------------------------------------------------------- /*--------------------------------------------------------------------------
Adjust the asked values for window width and height. Adjust the asked values for window width and height.
Return 0 on success, -1 otherwise. Return 0 on success, -1 otherwise.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment