]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 12:22:46 +0000 (13:22 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 12:22:46 +0000 (13:22 +0100)
logical expression more readable.

ChangeLog
grub-core/disk/scsi.c

index cb499bb01ce6ebc51000ef43c4da8b1263e9c190..16be610ea09e87cc58249e7e4ac0c5c7cbe8aad4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * grub-core/disk/raid.c (insert_array): Ensure uniqueness of p->number
index 902ab12c39364daf52cd5069768ce2b41da296f7..a40de278f899aff4a9979cf50b582be472a76f03 100644 (file)
@@ -506,7 +506,7 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector,
   if (scsi->blocksize != GRUB_DISK_SECTOR_SIZE)
     {
       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,
                           "unsupported SCSI block size");