hpsa: precedence bug in
PATCH 1/1 hpsa: precedence bug in
'!' has higher precedence than '&'. CFGTBL_ChangeReq is 0x1 so the original code is equivelent to if (!doorbell_value) {...
Signed-off-by Dan Carpenter <[email protected]>
drivers/scsi/hpsa.c +1 -1
@@ -3591,7 +3591,7 @@ static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h)spin_lock_irqsave (&h->lock, flags); doorbell_value =readl (h->vaddr +SA5_DOORBELL );spin_unlock_irqrestore (&h->lock, flags); -if (!doorbell_value & CFGTBL_ChangeReq) +if (!(doorbell_value & CFGTBL_ChangeReq))break ;/* delay and try again */ usleep_range (10000 ,20000 );
Re: [patch] [SCSI] hpsa: precedence bug in hpsa_wait_for_mode_change_ack()
Quoted 10 lines · Dan Carpenter
'!' has higher precedence than '&'.
CFGTBL_ChangeReqis0x1so the original code is equivelent to if (!doorbell_value) {...Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/hpsa.c +0
-0
drivers/scsi/hpsa.c static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h) · line 3597
Quoted 8 lines
drivers/scsi/hpsa.c +1
-1@@ -3591,7 +3591,7 @@ static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h)spin_lock_irqsave (&h->lock, flags); doorbell_value =readl (h->vaddr +SA5_DOORBELL );spin_unlock_irqrestore (&h->lock, flags); -if (!doorbell_value & CFGTBL_ChangeReq) +if (!(doorbell_value & CFGTBL_ChangeReq))break ;/* delay and try again */ usleep_range (10000 ,20000 );
Thanks. This looks correct.
-- steve