linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Roel Kluin <12o3l@tiscali.nl>
Cc: linux-ide@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	Borislav Petkov <petkovbb@gmail.com>
Subject: Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0
Date: Thu, 17 Apr 2008 00:40:07 +0200	[thread overview]
Message-ID: <200804170040.07397.bzolnier@gmail.com> (raw)
In-Reply-To: <48055F1A.9020706@tiscali.nl>


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@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);

  reply	other threads:[~2008-04-16 22:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-16  2:06 [PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0 Roel Kluin
2008-04-16 22:40 ` Bartlomiej Zolnierkiewicz [this message]
2008-04-17  3:51   ` Roel Kluin
2008-04-17  9:12     ` Boris Petkov
2008-04-17 11:04       ` Roel Kluin
2008-04-17 12:01         ` Boris Petkov
2008-04-27 18:32           ` Bartlomiej Zolnierkiewicz
2008-04-27 18:32 ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804170040.07397.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=12o3l@tiscali.nl \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).