login
Header Space

 
 

[PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <bzolnier@...>
Cc: <linux-ide@...>, lkml <linux-kernel@...>
Date: Tuesday, April 15, 2008 - 10:06 pm

Is this the right fix in this case?
---
valid is unsigned and cannot be below 0.,
    
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index c8d0e87..a60f5df 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -182,8 +182,6 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
 			sector &= ~(bio_sectors -1);
 			valid = (sector - failed_command->sector) << 9;
 
-			if (valid < 0)
-				valid = 0;
 			if (sector < get_capacity(info->disk) &&
 				drive->probed_capacity - sector < 4 * 75) {
 				set_capacity(info->disk, sector);

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0, Roel Kluin, (Tue Apr 15, 10:06 pm)
Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var &lt; 0, Bartlomiej Zolnierkiewicz..., (Sun Apr 27, 2:32 pm)
Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var &lt; 0, Bartlomiej Zolnierkiewicz..., (Wed Apr 16, 6:40 pm)
Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var &lt; 0, Bartlomiej Zolnierkiewicz..., (Sun Apr 27, 2:32 pm)
speck-geostationary