Skip to contentSkip to conversation

sym53c8xx_2 uses SYM_MEM_CLUSTER_SHIFT before its #define'd

PATCH In review Adrian Bunk 2 participants 2 messages Feb 7, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

drivers/scsi/sym53c8xx_2/sym_hipd.h renamed from drivers/scsi/sym53c8xx_2/sym_hipd.h.old +9 -8
@@ -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.
#1 lore raw
Quoted 4 lines · Adrian Bunk

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

The patch below fixes this issue.

Thanks, I've taken this patch too.

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain