From 5d4f4dd51b159de457a989c731c0012d0bbbac98 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 22 Jan 2011 13:22:46 +0100 Subject: [PATCH] * grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make logical expression more readable. --- ChangeLog | 5 +++++ grub-core/disk/scsi.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cb499bb01..16be610ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-22 Vladimir Serbinenko + + * grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make + logical expression more readable. + 2011-01-22 Vladimir Serbinenko * grub-core/disk/raid.c (insert_array): Ensure uniqueness of p->number diff --git a/grub-core/disk/scsi.c b/grub-core/disk/scsi.c index 902ab12c3..a40de278f 100644 --- a/grub-core/disk/scsi.c +++ b/grub-core/disk/scsi.c @@ -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");