All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: petkovbb@gmail.com
Cc: Roel Kluin <12o3l@tiscali.nl>,
	linux-ide@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0
Date: Sun, 27 Apr 2008 20:32:51 +0200	[thread overview]
Message-ID: <200804272032.51371.bzolnier@gmail.com> (raw)
In-Reply-To: <9ea470500804170501s5e794cd2u8cda1b46fb6fbf9f@mail.gmail.com>

On Thursday 17 April 2008, Boris Petkov wrote:
> On Thu, Apr 17, 2008 at 1:04 PM, Roel Kluin <12o3l@tiscali.nl> wrote:
> > Boris Petkov wrote:
> >
> >  > I'd rather keep the "unsigned long bio_sectors;" part and do something
> >  > of the likes of:
> >  >
> >  > bio_sectors = bio_sectors(failed_command->bio);
> >  >
> >  >
> >  > (remove the "if (bio_sectors < 4)"-test)
> >  >
> >  > ... and later...
> >  >
> >  > sector &= ~(max(bio_sectors - 1, 3));

drivers/ide/ide-cd.c: In function ‘cdrom_analyze_sense_data’:
drivers/ide/ide-cd.c:180: warning: comparison of distinct pointer types lacks a cast

[ which actually hints us into real issue -> please think what would
  happen if bio_sectors() returns _zero_ before and after the patch ]

I applied the patch replacing the above code with:

	bio_sectors = max(bio_sectors(failed_command->bio), 4U);
	sector &= ~(bio_sectors - 1);

Thanks,
Bart

  reply	other threads:[~2008-04-27 19:54 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
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 [this message]
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=200804272032.51371.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.