simple: make the two cases more obvious and avoid the need for extra defines
authorAlan Cox <alan@linux.intel.com>
Wed, 14 Jun 2017 20:25:04 +0000 (21:25 +0100)
committerAlan Cox <alan@linux.intel.com>
Wed, 14 Jun 2017 20:25:04 +0000 (21:25 +0100)
Kernel/simple.c

index 014a4e5..c2c23d0 100644 (file)
@@ -77,9 +77,12 @@ int swapout(ptptr p)
        /* Write the app (and possibly the uarea etc..) to disk */
 #ifdef CONFIG_SPLIT_UDATA
        swapwrite(SWAPDEV, blk, UDATA_SIZE, (uaddr_t)&udata, 1);
-#endif
        swapwrite(SWAPDEV, blk + UDATA_BLKS, SWAPTOP - SWAPBASE,
                  SWAPBASE, 1);
+#else
+       swapwrite(SWAPDEV, blk, SWAPTOP - SWAPBASE,
+                 SWAPBASE, 1);
+#endif
        p->p_page = 0;
        p->p_page2 = map;
 #ifdef DEBUG
@@ -105,9 +108,12 @@ void swapin(ptptr p, uint16_t map)
 
 #ifdef CONFIG_SPLIT_UDATA
        swapread(SWAPDEV, blk, UDATA_SIZE, (uaddr_t)&udata, 1);
-#endif
        swapread(SWAPDEV, blk + UDATA_BLKS, SWAPTOP - SWAPBASE,
                 SWAPBASE, 1);
+#else
+       swapread(SWAPDEV, blk, SWAPTOP - SWAPBASE,
+                SWAPBASE, 1);
+#endif
 #ifdef DEBUG
        kprintf("%x: swapin done %d\n", p, p->p_page);
 #endif