* grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make

logical expression more readable.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-01-22 13:22:46 +01:00
parent e489601ad0
commit 5d4f4dd51b
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2011-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make
logical expression more readable.
2011-01-22 Vladimir Serbinenko <phcoder@gmail.com> 2011-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/raid.c (insert_array): Ensure uniqueness of p->number * grub-core/disk/raid.c (insert_array): Ensure uniqueness of p->number

View file

@ -506,7 +506,7 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector,
if (scsi->blocksize != GRUB_DISK_SECTOR_SIZE) if (scsi->blocksize != GRUB_DISK_SECTOR_SIZE)
{ {
unsigned spb = scsi->blocksize >> GRUB_DISK_SECTOR_BITS; unsigned spb = scsi->blocksize >> GRUB_DISK_SECTOR_BITS;
if (! (spb != 0 && (scsi->blocksize & GRUB_DISK_SECTOR_SIZE) == 0)) if (spb == 0 || (scsi->blocksize & (GRUB_DISK_SECTOR_SIZE - 1)) != 0)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"unsupported SCSI block size"); "unsupported SCSI block size");