Re: [PATCH] SCSI: add check_capacity flag and sd_read_last_sector()

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

 



On Wed, 22 Apr 2009, Matthew Wilcox wrote:

> On Wed, Apr 22, 2009 at 10:42:36AM -0400, Alan Stern wrote:
> > +	/* If the capacity is unknown, we can't test anything */
> > +	if (sdkp->capacity <= 0)
> > +		return rc;
> 
> sector_t is unsigned, so this should be just == 0.

It doesn't make any difference.

> > +	/* One test should be enough (unless it's inconclusive) */
> > +	sdp->check_capacity = 0;
> > +
> > +	/* If the device doesn't use READ(10), assume we're okay */
> > +	if (!sdp->use_10_for_rw)
> > +		return rc;
> > +
> > +	/* If the capacity is too big for READ(10), assume we're okay */
> > +	if (sdkp->capacity > 0xffffffff)
> > +		return rc;
> 
> Won't gcc warn about this when sector_t is 32 bits?

My version of gcc doesn't emit a warning (and I don't have CONFIG_LBD 
defined).  Maybe other versions will.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux