qlogicpti: add missing parentheses
PATCH 1/1 qlogicpti: add missing parentheses
+' has a higher precedence than ?' so the condition always evaluates to true and this is preprocessed to `7*((ql) - 1)'
--- drivers/scsi/qlogicpti.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
This one must be right, I think.
QLOGICPTI_MAX_SG is used here:
drivers/scsi/qlogicpti.c:964: host->sg_tablesize = QLOGICPTI_MAX_SG(num_free);drivers/scsi/qlogicpti.c:1288: .sg_tablesize = QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN),
Thanks, Roel
drivers/scsi/qlogicpti.h +1 -1
@@ -43,7 +43,7 @@* determined for each queue request anew. */ #define QLOGICPTI_REQ_QUEUE_LEN 255/* must be power of two - 1 */ -#define QLOGICPTI_MAX_SG (ql) (4 + ((ql) > 0) ? 7*((ql) - 1) : 0) +#define QLOGICPTI_MAX_SG (ql) (4 + (((ql) > 0) ? 7*((ql) - 1) : 0))/* mailbox command complete status codes */ #define MBOX_COMMAND_COMPLETE 0x4000
Quoted 9 lines · Roel Kluin
+' has a higher precedence than?' so the condition always evaluates to true and this is preprocessed to `7*((ql) - 1)'Signed-off-by Roel Kluin <[email protected]>--- drivers/scsi/qlogicpti.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)This one must be right, I think.
It looks plausible ... but it will increase the mailbox segment length by 4 ... someone needs to verify that this increase will actually work and won't run off the end of the mailbox table.
James
David Miller
Acked-byFrom: James Bottomley <[email protected]>
Date: Tue, 03 Nov 2009 17:51:49 -0600
Quoted 9 lines · Roel Kluin
Quoted 8 lines
+' has a higher precedence than?' so the condition always evaluates to true and this is preprocessed to `7*((ql) - 1)'Signed-off-by Roel Kluin <[email protected]>--- drivers/scsi/qlogicpti.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 5 lines
Quoted 1 line
This one must be right, I think.
It looks plausible ... but it will increase the mailbox segment length by 4 ... someone needs to verify that this increase will actually work and won't run off the end of the mailbox table.
It should be fine, good find Roel.