Date: Tue, 2 Dec 1997 14:09:13 GMT
From: Roman Hodek <rnhodek@faui22c.informatik.uni-erlangen.de>
To: linux-m68k@lists.linux-m68k.org
Subject: L68K: Make stram.c compile without CONFIG_STRAM_SWAP
Sender: owner-linux-m68k@phil.uni-sb.de


It seems I again have made some mistakes in stram.c so that it didn't
compile without CONFIG_STRAM_SWAP defined. Below are the fixes. (Now
really tried with all four combinations of CONFIG_STRAM_SWAP and
CONFIG_STRAM_PROC :-)

Roman

------------------------------------------------------------------------------
--- linux-2.1.64.orig/arch/m68k/atari/stram.c	Tue Dec  2 13:59:06 1997
+++ linux-2.1.64/arch/m68k/atari/stram.c	Tue Dec  2 15:06:50 1997
@@ -27,10 +27,12 @@
 #include <asm/atari_stram.h>
 
 
+#ifdef CONFIG_STRAM_SWAP
 #define MAJOR_NR    Z2RAM_MAJOR
 #include <linux/blk.h>
 #undef DEVICE_NAME
 #define DEVICE_NAME	"stram"
+#endif
 
 #define DEBUG
 
@@ -246,8 +248,8 @@
 static int stram_open( struct inode *inode, struct file *filp );
 static int stram_release( struct inode *inode, struct file *filp );
 static void do_z2_request( void );
-static int get_gfp_order( unsigned long size );
 #endif
+static int get_gfp_order( unsigned long size );
 static void reserve_region( unsigned long addr, unsigned long end );
 static BLOCK *add_region( void *addr, unsigned long size );
 static BLOCK *find_region( void *addr );
@@ -503,8 +505,10 @@
 					 "freeing again\n" );
 			if (flags == BLOCK_STATIC)
 				rsvd_stram_end -= size;
+#ifdef CONFIG_STRAM_SWAP
 			else if (flags == BLOCK_INSWAP)
 				free_stram_region( SWAP_NR(addr), N_PAGES(size) );
+#endif
 			else
 				free_pages( (unsigned long)addr, get_gfp_order(size));
 			return( NULL );
@@ -1275,6 +1279,7 @@
 /* to avoid warning */
 static void do_z2_request( void ) { }
 
+#endif /* CONFIG_STRAM_SWAP */
 
 
 /* ------------------------------------------------------------------------ */
@@ -1297,8 +1302,6 @@
 	return( order );
 }
 
-#endif /* CONFIG_STRAM_SWAP */
-
 
 /* reserve a range of pages in mem_map[] */
 static void reserve_region( unsigned long addr, unsigned long end )
@@ -1397,11 +1400,14 @@
 
 int get_stram_list( char *buf )
 {
-    int i, len = 0;
+	int len = 0;
+	BLOCK *p;
+#ifdef CONFIG_STRAM_SWAP
+    int i;
 	unsigned char *map = stram_swap_info->swap_map;
 	unsigned long max = stram_swap_info->max;
 	unsigned free = 0, used = 0, rsvd = 0;
-	BLOCK *p;
+#endif
 
 #ifdef CONFIG_STRAM_SWAP
 	if (max_swap_size) {
