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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wednesday 16 April 2008, Roel Kluin wrote:
> Is this the right fix in this case?

Yes, but it seems that 'valid' is only written to
so it may be as well removed completely.

Care to update the patch?

Thanks,
Bart

> ---
> valid is unsigned and cannot be below 0.,
>     
> Signed-off-by: Roel Kluin <12o3l@xxxxxxxxxx>
> ---
> 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux