linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test
@ 2006-01-14 22:49 Benoit Boissinot
  2006-01-14 23:04 ` Benoit Boissinot
  0 siblings, 1 reply; 3+ messages in thread
From: Benoit Boissinot @ 2006-01-14 22:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Christoph Hellwig, Jens Axboe, linux-kernel

In cleanup-cdrom_ioctl.patch,

the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))
		return -EINVAL;

to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
	return -EINVAL;


which is not equivalent with morgan's law.


Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>

diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
--- a/linux/drivers/cdrom/cdrom.c	2006-01-14 16:11:43.000000000 +0100
+++ b/drivers/cdrom/cdrom.c	2006-01-14 23:44:51.000000000 +0100
@@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
 		return -EFAULT;
 
 	requested_format = entry.cdte_format;
-	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
+	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
 		return -EINVAL;
 	/* make interface to low-level uniform */
 	entry.cdte_format = CDROM_MSF;

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

* Re: [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test
  2006-01-14 22:49 [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test Benoit Boissinot
@ 2006-01-14 23:04 ` Benoit Boissinot
  2006-01-16  8:40   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Benoit Boissinot @ 2006-01-14 23:04 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Christoph Hellwig, Jens Axboe, linux-kernel

On Sat, Jan 14, 2006 at 11:49:26PM +0100, Benoit Boissinot wrote:
> In cleanup-cdrom_ioctl.patch,
> 
> the test in CDROMREADTOCENTRY ioctl was changed from
> 
> if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))
> 		return -EINVAL;
> 
> to
> 
> if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
> 	return -EINVAL;
> 
> which is not equivalent with morgan's law.
> 

sorry, it doesn't apply with -p1 correct patch below:

In cleanup-cdrom_ioctl.patch,
the test in CDROMREADTOCENTRY ioctl was changed from

if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))
		return -EINVAL;
to

if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
	return -EINVAL;

which is not equivalent with morgan's law.

Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>

diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
--- a/drivers/cdrom/cdrom.c	2006-01-14 16:11:43.000000000 +0100
+++ b/drivers/cdrom/cdrom.c	2006-01-14 23:44:51.000000000 +0100
@@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
 		return -EFAULT;
 
 	requested_format = entry.cdte_format;
-	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
+	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
 		return -EINVAL;
 	/* make interface to low-level uniform */
 	entry.cdte_format = CDROM_MSF;

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

* Re: [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test
  2006-01-14 23:04 ` Benoit Boissinot
@ 2006-01-16  8:40   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2006-01-16  8:40 UTC (permalink / raw)
  To: Benoit Boissinot; +Cc: Andrew Morton, Christoph Hellwig, linux-kernel

On Sun, Jan 15 2006, Benoit Boissinot wrote:
> On Sat, Jan 14, 2006 at 11:49:26PM +0100, Benoit Boissinot wrote:
> > In cleanup-cdrom_ioctl.patch,
> > 
> > the test in CDROMREADTOCENTRY ioctl was changed from
> > 
> > if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))
> > 		return -EINVAL;
> > 
> > to
> > 
> > if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
> > 	return -EINVAL;
> > 
> > which is not equivalent with morgan's law.
> > 
> 
> sorry, it doesn't apply with -p1 correct patch below:
> 
> In cleanup-cdrom_ioctl.patch,
> the test in CDROMREADTOCENTRY ioctl was changed from
> 
> if (!((requested_format == CDROM_MSF) || (requested_format == CDROM_LBA)))
> 		return -EINVAL;
> to
> 
> if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
> 	return -EINVAL;
> 
> which is not equivalent with morgan's law.
> 
> Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
> 
> diff -Naurp -X Documentation/dontdiff ../linux/drivers/cdrom/cdrom.c drivers/cdrom/cdrom.c
> --- a/drivers/cdrom/cdrom.c	2006-01-14 16:11:43.000000000 +0100
> +++ b/drivers/cdrom/cdrom.c	2006-01-14 23:44:51.000000000 +0100
> @@ -2585,7 +2585,7 @@ static int cdrom_ioctl_read_tocentry(str
>  		return -EFAULT;
>  
>  	requested_format = entry.cdte_format;
> -	if (requested_format != CDROM_MSF || requested_format != CDROM_LBA)
> +	if (requested_format != CDROM_MSF && requested_format != CDROM_LBA)
>  		return -EINVAL;
>  	/* make interface to low-level uniform */
>  	entry.cdte_format = CDROM_MSF;

Good catch, thanks!

-- 
Jens Axboe


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

end of thread, other threads:[~2006-01-16  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-14 22:49 [patch 2.6.15-mm4] drivers/cdrom/cdrom.c fix incorrect test Benoit Boissinot
2006-01-14 23:04 ` Benoit Boissinot
2006-01-16  8:40   ` Jens Axboe

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).