[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200804272032.51371.bzolnier@gmail.com>
Date: Sun, 27 Apr 2008 20:32:51 +0200
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To: petkovbb@...il.com
Cc: "Roel Kluin" <12o3l@...cali.nl>, linux-ide@...r.kernel.org,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/6] IDE: ide-cd: fix test unsigned var < 0
On Thursday 17 April 2008, Boris Petkov wrote:
> On Thu, Apr 17, 2008 at 1:04 PM, Roel Kluin <12o3l@...cali.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists