* [PATCH] logical-bitwise & confusion in se401_init() (was: logical-bitwise & confusion in se401_init()?)
[not found] ` <20080313120602.6920a621@gaivota>
@ 2008-03-13 15:51 ` Roel Kluin
2008-03-13 21:30 ` Rik van Riel
0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2008-03-13 15:51 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: pe1rxq, linux-usb, video4linux-list, lkml
Mauro Carvalho Chehab wrote:
> On Mon, 10 Mar 2008 00:27:19 +0100
> Roel Kluin <12o3l@tiscali.nl> wrote:
>
>> drivers/media/video/se401.c:1282:
>>
>> if (!cp[2] && SE401_FORMAT_BAYER) {
>>
>> shouldn't this be 'if (!(cp[2] & SE401_FORMAT_BAYER)) {'
>> drivers/media/video/se401.h:52:
>>
>> #define SE401_FORMAT_BAYER 0x40
>
> I don't have this driver, but this seems to be the proper fix.
---
logical-bitwise & confusion, SE401_FORMAT_BAYER is defined 0x40
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index d5d7d6c..952c9bd 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -1279,7 +1279,7 @@ static int se401_init(struct usb_se401 *se401, int button)
rc=se401_sndctrl(0, se401, SE401_REQ_GET_HEIGHT, 0, cp, sizeof(cp));
se401->cheight=cp[0]+cp[1]*256;
- if (!cp[2] && SE401_FORMAT_BAYER) {
+ if (!cp[2] & SE401_FORMAT_BAYER) {
err("Bayer format not supported!");
return 1;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] logical-bitwise & confusion in se401_init() (was: logical-bitwise & confusion in se401_init()?)
2008-03-13 15:51 ` [PATCH] logical-bitwise & confusion in se401_init() (was: logical-bitwise & confusion in se401_init()?) Roel Kluin
@ 2008-03-13 21:30 ` Rik van Riel
2008-03-13 22:58 ` [PATCH] logical-bitwise & confusion in se401_init() Roel Kluin
0 siblings, 1 reply; 3+ messages in thread
From: Rik van Riel @ 2008-03-13 21:30 UTC (permalink / raw)
To: Roel Kluin
Cc: Mauro Carvalho Chehab, pe1rxq, linux-usb, video4linux-list, lkml
On Thu, 13 Mar 2008 16:51:29 +0100
Roel Kluin <12o3l@tiscali.nl> wrote:
> - if (!cp[2] && SE401_FORMAT_BAYER) {
> + if (!cp[2] & SE401_FORMAT_BAYER) {
> err("Bayer format not supported!");
> return 1;
> }
Would it be better to put in some additional parenthesis?
if (!(cp[2] & SE401_FORMAT_BAYER)) {
--
All Rights Reversed
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] logical-bitwise & confusion in se401_init()
2008-03-13 21:30 ` Rik van Riel
@ 2008-03-13 22:58 ` Roel Kluin
0 siblings, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2008-03-13 22:58 UTC (permalink / raw)
To: Rik van Riel
Cc: Mauro Carvalho Chehab, pe1rxq, linux-usb, video4linux-list, lkml
Rik van Riel wrote:
> On Thu, 13 Mar 2008 16:51:29 +0100
> Roel Kluin <12o3l@tiscali.nl> wrote:
>
>> - if (!cp[2] && SE401_FORMAT_BAYER) {
>> + if (!cp[2] & SE401_FORMAT_BAYER) {
>> err("Bayer format not supported!");
>> return 1;
>> }
>
> Would it be better to put in some additional parenthesis?
>
> if (!(cp[2] & SE401_FORMAT_BAYER)) {
>
yes of course, thanks for catching that.
---
logical-bitwise & confusion
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index d5d7d6c..9e8b521 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -1279,7 +1279,7 @@ static int se401_init(struct usb_se401 *se401, int button)
rc=se401_sndctrl(0, se401, SE401_REQ_GET_HEIGHT, 0, cp, sizeof(cp));
se401->cheight=cp[0]+cp[1]*256;
- if (!cp[2] && SE401_FORMAT_BAYER) {
+ if (!(cp[2] & SE401_FORMAT_BAYER)) {
err("Bayer format not supported!");
return 1;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-13 22:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <47D47257.9090204@tiscali.nl>
[not found] ` <20080313120602.6920a621@gaivota>
2008-03-13 15:51 ` [PATCH] logical-bitwise & confusion in se401_init() (was: logical-bitwise & confusion in se401_init()?) Roel Kluin
2008-03-13 21:30 ` Rik van Riel
2008-03-13 22:58 ` [PATCH] logical-bitwise & confusion in se401_init() Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome