lkml.org 
[lkml]   [2004]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] sym53c8xx_2 uses SYM_MEM_CLUSTER_SHIFT before its #define'd
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.028 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site