diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-04-27 18:56:28 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-04-27 18:56:28 -0700 |
commit | 0b2b3103e6a71aed14aa4c8c315cfedbc1202237 (patch) | |
tree | 97a64ecc2c723c0e774f583d7281a803dc718a47 | |
parent | 56c99ea3cb0e6f418d38685a064b86a46dcb1c8d (diff) | |
download | mediapointer-dvb-s2-0b2b3103e6a71aed14aa4c8c315cfedbc1202237.tar.gz mediapointer-dvb-s2-0b2b3103e6a71aed14aa4c8c315cfedbc1202237.tar.bz2 |
v4l1-compat: misc fixes for pixelformat function
From: Trent Piepho <xyzzy@speakeasy.org>
Mark the palette2pixelformat lookup table as const
pixelformat is unsigned, adjust the palette2pixelformat table and
pixelformat_to_palette()
palette_to_pixelformat() is a pure function
pixelformat_to_palette() is a const function
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rw-r--r-- | linux/drivers/media/video/v4l1-compat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c index 2e42ee3a2..e46585a15 100644 --- a/linux/drivers/media/video/v4l1-compat.c +++ b/linux/drivers/media/video/v4l1-compat.c @@ -129,7 +129,7 @@ set_v4l_control(struct inode *inode, /* ----------------------------------------------------------------- */ -static int palette2pixelformat[] = { +const static unsigned int palette2pixelformat[] = { [VIDEO_PALETTE_GREY] = V4L2_PIX_FMT_GREY, [VIDEO_PALETTE_RGB555] = V4L2_PIX_FMT_RGB555, [VIDEO_PALETTE_RGB565] = V4L2_PIX_FMT_RGB565, @@ -147,7 +147,7 @@ static int palette2pixelformat[] = { [VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P, }; -static unsigned int +static unsigned int __attribute_pure__ palette_to_pixelformat(unsigned int palette) { if (palette < ARRAY_SIZE(palette2pixelformat)) @@ -156,8 +156,8 @@ palette_to_pixelformat(unsigned int palette) return 0; } -static unsigned int -pixelformat_to_palette(int pixelformat) +static unsigned int __attribute_const__ +pixelformat_to_palette(unsigned int pixelformat) { int palette = 0; switch (pixelformat) |