public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qlogicpti: add missing parentheses
@ 2009-11-03 23:38 Roel Kluin
  2009-11-03 23:51 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Roel Kluin @ 2009-11-03 23:38 UTC (permalink / raw)
  To: James E.J. Bottomley, linux-scsi, Andrew Morton, LKML

`+' 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 <roel.kluin@gmail.com>
---
 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

diff --git a/drivers/scsi/qlogicpti.h b/drivers/scsi/qlogicpti.h
index 9c053bb..e3c74d1 100644
--- a/drivers/scsi/qlogicpti.h
+++ b/drivers/scsi/qlogicpti.h
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] qlogicpti: Add missing parentheses
@ 2009-02-18 12:48 Roel Kluin
  2009-02-18 22:39 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Roel Kluin @ 2009-02-18 12:48 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-scsi, Andrew Morton

Add missing parentheses

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This was used at drivers/scsi/qlogicpti.c:

946:   host->sg_tablesize = QLOGICPTI_MAX_SG(num_free);
1270:  .sg_tablesize           = QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN),

diff --git a/drivers/scsi/qlogicpti.h b/drivers/scsi/qlogicpti.h
index 9c053bb..e3c74d1 100644
--- a/drivers/scsi/qlogicpti.h
+++ b/drivers/scsi/qlogicpti.h
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-04  0:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 23:38 [PATCH] qlogicpti: add missing parentheses Roel Kluin
2009-11-03 23:51 ` James Bottomley
2009-11-04  0:19   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-02-18 12:48 [PATCH] qlogicpti: Add " Roel Kluin
2009-02-18 22:39 ` David Miller
2009-02-19 21:01   ` Andrew Morton
2009-02-20  8:51     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox