public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sym53c8xx_2 uses SYM_MEM_CLUSTER_SHIFT before its #define'd
@ 2004-02-07 20:30 Adrian Bunk
  2004-02-07 20:45 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2004-02-07 20:30 UTC (permalink / raw)
  To: matthew, linux-scsi, James.Bottomley, linux-kernel

When compiling 2.6.2-mm1 (this problem doesn't seem to be specific
to -mm) with -Wundef I got many of the following warnings:

<--  snip  -->

...
In file included from drivers/scsi/sym53c8xx_2/sym_glue.h:446,
                 from drivers/scsi/sym53c8xx_2/sym_fw.c:56:
drivers/scsi/sym53c8xx_2/sym_hipd.h:186:30: 
warning: "SYM_MEM_CLUSTER_SIZE" is not defined
...

<--  snip  -->

This seems to be a bug:
SYM_MEM_CLUSTER_SIZE is used before it's #define'd.

The patch below fixes this issue.

cu
Adrian

--- linux-2.6.2-mm1/drivers/scsi/sym53c8xx_2/sym_hipd.h.old	2004-02-07 21:20:04.000000000 +0100
+++ linux-2.6.2-mm1/drivers/scsi/sym53c8xx_2/sym_hipd.h	2004-02-07 21:20:54.000000000 +0100
@@ -171,6 +171,15 @@
 #define	SYM_CONF_MIN_ASYNC (40)
 
 /*
+ *  Shortest memory chunk is (1<<SYM_MEM_SHIFT), currently 16.
+ *  Actual allocations happen as SYM_MEM_CLUSTER_SIZE sized.
+ *  (1 PAGE at a time is just fine).
+ */
+#define SYM_MEM_SHIFT   4
+#define SYM_MEM_CLUSTER_SIZE    (1UL << SYM_MEM_CLUSTER_SHIFT)
+#define SYM_MEM_CLUSTER_MASK    (SYM_MEM_CLUSTER_SIZE-1)
+
+/*
  *  Number of entries in the START and DONE queues.
  *
  *  We limit to 1 PAGE in order to succeed allocation of 
@@ -1322,14 +1331,6 @@
  *  MEMORY ALLOCATOR.
  */
 
-/*
- *  Shortest memory chunk is (1<<SYM_MEM_SHIFT), currently 16.
- *  Actual allocations happen as SYM_MEM_CLUSTER_SIZE sized.
- *  (1 PAGE at a time is just fine).
- */
-#define SYM_MEM_SHIFT	4
-#define SYM_MEM_CLUSTER_SIZE	(1UL << SYM_MEM_CLUSTER_SHIFT)
-#define SYM_MEM_CLUSTER_MASK	(SYM_MEM_CLUSTER_SIZE-1)
 
 /*
  *  Link between free memory chunks of a given size.

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

end of thread, other threads:[~2004-02-07 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-07 20:30 [patch] sym53c8xx_2 uses SYM_MEM_CLUSTER_SHIFT before its #define'd Adrian Bunk
2004-02-07 20:45 ` Matthew Wilcox

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