linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/crypto/picoxcell_crypto.c: boolean and / or confusion
       [not found] <4EE688FC.8090606@gmail.com>
@ 2011-12-12 23:44 ` Joe Perches
  2011-12-12 23:55   ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
  2011-12-13  9:50   ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles
  0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2011-12-12 23:44 UTC (permalink / raw)
  To: roel, Jamie Iles; +Cc: Andrew Morton, LKML, linux-crypto

On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true

Hey Jamie and Roel

Looking at drivers with:

$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers

drivers/crypto/picoxcell_crypto.c:	if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
drivers/crypto/picoxcell_crypto.c:	} else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&

Most likely these should be && not ||.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/media/video/s5p-fimc/fimc-capture.c: boolean and / or confusion
  2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: boolean and / or confusion Joe Perches
@ 2011-12-12 23:55   ` Joe Perches
  2011-12-13 14:26     ` Sylwester Nawrocki
  2011-12-13  9:50   ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2011-12-12 23:55 UTC (permalink / raw)
  To: roel, Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab
  Cc: Andrew Morton, LKML, linux-crypto

On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> The test not [val1] or not [val2] always evaluates to true

Hello

Looking at drivers with:

$ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers

drivers/media/video/s5p-fimc/fimc-capture.c:		if (mf->width != tfmt->width || mf->width != tfmt->width) {
drivers/media/video/s5p-fimc/fimc-capture.c:			if (mf->width != tfmt->width || mf->width != tfmt->width)

Most likely these tests should be:
	if (mf->height != tfmt->height || mf->width != tfmt->width)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/crypto/picoxcell_crypto.c: boolean and / or confusion
  2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: boolean and / or confusion Joe Perches
  2011-12-12 23:55   ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
@ 2011-12-13  9:50   ` Jamie Iles
  1 sibling, 0 replies; 4+ messages in thread
From: Jamie Iles @ 2011-12-13  9:50 UTC (permalink / raw)
  To: Joe Perches; +Cc: roel, Jamie Iles, Andrew Morton, LKML, linux-crypto

Hi Joe,

On Mon, Dec 12, 2011 at 03:44:53PM -0800, Joe Perches wrote:
> On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
> > The test not [val1] or not [val2] always evaluates to true
> 
> Hey Jamie and Roel
> 
> Looking at drivers with:
> 
> $ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
> 
> drivers/crypto/picoxcell_crypto.c:	if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
> drivers/crypto/picoxcell_crypto.c:	} else if ((len != AES_KEYSIZE_128 || len != AES_KEYSIZE_256) &&
> 
> Most likely these should be && not ||.

Yup, the original code was incorrect.  Patch to follow.  Thanks Joe!

Jamie

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/media/video/s5p-fimc/fimc-capture.c: boolean and / or confusion
  2011-12-12 23:55   ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
@ 2011-12-13 14:26     ` Sylwester Nawrocki
  0 siblings, 0 replies; 4+ messages in thread
From: Sylwester Nawrocki @ 2011-12-13 14:26 UTC (permalink / raw)
  To: Joe Perches
  Cc: roel, Kyungmin Park, Mauro Carvalho Chehab, Andrew Morton, LKML,
	linux-crypto

On 12/13/2011 12:55 AM, Joe Perches wrote:
> On Tue, 2011-12-13 at 00:06 +0100, roel wrote:
>> The test not [val1] or not [val2] always evaluates to true
> 
> Hello
> 
> Looking at drivers with:
> 
> $ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\|\|\s*\1\s*\!\=" drivers
> 
> drivers/media/video/s5p-fimc/fimc-capture.c:		if (mf->width != tfmt->width || mf->width != tfmt->width) {
> drivers/media/video/s5p-fimc/fimc-capture.c:			if (mf->width != tfmt->width || mf->width != tfmt->width)
> 
> Most likely these tests should be:
> 	if (mf->height != tfmt->height || mf->width != tfmt->width)

Indeed. I'll prepare a patch fixing this.

-- 
Thank you,
Sylwester

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-13 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4EE688FC.8090606@gmail.com>
2011-12-12 23:44 ` drivers/crypto/picoxcell_crypto.c: boolean and / or confusion Joe Perches
2011-12-12 23:55   ` drivers/media/video/s5p-fimc/fimc-capture.c: " Joe Perches
2011-12-13 14:26     ` Sylwester Nawrocki
2011-12-13  9:50   ` drivers/crypto/picoxcell_crypto.c: " Jamie Iles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).