lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47D9B19D.5010709@tiscali.nl>
Date:	Thu, 13 Mar 2008 23:58:37 +0100
From:	Roel Kluin <12o3l@...cali.nl>
To:	Rik van Riel <riel@...hat.com>
CC:	Mauro Carvalho Chehab <mchehab@...radead.org>, pe1rxq@...at.org,
	linux-usb@...r.kernel.org, video4linux-list@...hat.com,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] logical-bitwise & confusion in se401_init()

Rik van Riel wrote:
> On Thu, 13 Mar 2008 16:51:29 +0100
> Roel Kluin <12o3l@...cali.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@...cali.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;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ