projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d25cb64
)
V4L/DVB (10064): mt9m111: mt9m111_get_global_gain() - unsigned >= 0 is always true
author
roel kluin
<
[email protected]
>
Wed, 17 Dec 2008 17:01:07 +0000
(14:01 -0300)
committer
Mauro Carvalho Chehab
<
[email protected]
>
Tue, 30 Dec 2008 11:40:13 +0000
(09:40 -0200)
unsigned >= 0 is always true and fix formula
Signed-off-by: Roel Kluin <
[email protected]
>
Acked-by: Robert Jarzmik <
[email protected]
>
Signed-off-by: Guennadi Liakhovetski <
[email protected]
>
Signed-off-by: Mauro Carvalho Chehab <
[email protected]
>
drivers/media/video/mt9m111.c
patch
|
blob
|
history
diff --git
a/drivers/media/video/mt9m111.c
b/drivers/media/video/mt9m111.c
index 63c52c0b3e7227e720b705bc653821ccff741f2c..343be9252fe7b65b82ce9fc7a621cc683cb1d7a6 100644
(file)
--- a/
drivers/media/video/mt9m111.c
+++ b/
drivers/media/video/mt9m111.c
@@
-634,18
+634,15
@@
static int mt9m111_set_flip(struct soc_camera_device *icd, int flip, int mask)
static int mt9m111_get_global_gain(struct soc_camera_device *icd)
{
-
unsigned int data, gain
;
+
int data
;
data = reg_read(GLOBAL_GAIN);
if (data >= 0)
- gain = ((data & (1 << 10)) * 2)
- | ((data & (1 << 9)) * 2)
- | (data & 0x2f);
- else
- gain = data;
-
- return gain;
+ return (data & 0x2f) * (1 << ((data >> 10) & 1)) *
+ (1 << ((data >> 9) & 1));
+ return data;
}
+
static int mt9m111_set_global_gain(struct soc_camera_device *icd, int gain)
{
u16 val;