Blackfin arch: rename blackfin_sram.c to sram-alloc.c
authorRobin Getz <rgetz@blackfin.uclinux.org>
Wed, 8 Oct 2008 09:22:49 +0000 (17:22 +0800)
committerBryan Wu <cooloney@kernel.org>
Wed, 8 Oct 2008 09:22:49 +0000 (17:22 +0800)
rename blackfin_sram.c to sram-alloc.c (we know it is a blackfin file,
since it is in arch/blackfin) - and there is no "driver" code in there,
it is just an allocator/deallocator for L1 and L2 sram.

Also fix a problem that checkpatch pointed out

Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/mm/Makefile
arch/blackfin/mm/sram-alloc.c [moved from arch/blackfin/mm/blackfin_sram.c with 96% similarity]

index 2a7202ce01fd4166bece9317da237f78d107c349..81aacbc32d3cbc315c22c049856dbf7ef726637e 100644 (file)
@@ -2,4 +2,4 @@
 # arch/blackfin/mm/Makefile
 #
 
-obj-y := blackfin_sram.o init.o
+obj-y := sram-alloc.o init.o
similarity index 96%
rename from arch/blackfin/mm/blackfin_sram.c
rename to arch/blackfin/mm/sram-alloc.c
index 4f5e887a0d9655cf7a9a07cce3b7fb8865501804..0f1ca6930c16bc651529c814a1727694943b5f78 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * File:         arch/blackfin/mm/blackfin_sram.c
+ * File:         arch/blackfin/mm/sram-alloc.c
  * Based on:
  * Author:
  *
  * Created:
- * Description:  SRAM driver for Blackfin ADSP-BF5xx
+ * Description:  SRAM allocator for Blackfin L1 and L2 memory
  *
  * Modified:
- *               Copyright 2004-2007 Analog Devices Inc.
+ *               Copyright 2004-2008 Analog Devices Inc.
  *
  * Bugs:         Enter bugs at http://blackfin.uclinux.org/
  *
@@ -78,7 +78,7 @@ static void __init l1sram_init(void)
        free_l1_ssram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l1_ssram_head.next) {
-               printk(KERN_INFO"Fail to initialize Scratchpad data SRAM.\n");
+               printk(KERN_INFO "Failed to initialize Scratchpad data SRAM\n");
                return;
        }
 
@@ -102,7 +102,7 @@ static void __init l1_data_sram_init(void)
        free_l1_data_A_sram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l1_data_A_sram_head.next) {
-               printk(KERN_INFO"Fail to initialize L1 Data A SRAM.\n");
+               printk(KERN_INFO "Failed to initialize L1 Data A SRAM\n");
                return;
        }
 
@@ -123,7 +123,7 @@ static void __init l1_data_sram_init(void)
        free_l1_data_B_sram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l1_data_B_sram_head.next) {
-               printk(KERN_INFO"Fail to initialize L1 Data B SRAM.\n");
+               printk(KERN_INFO "Failed to initialize L1 Data B SRAM\n");
                return;
        }
 
@@ -151,7 +151,7 @@ static void __init l1_inst_sram_init(void)
        free_l1_inst_sram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l1_inst_sram_head.next) {
-               printk(KERN_INFO"Fail to initialize L1 Instruction SRAM.\n");
+               printk(KERN_INFO "Failed to initialize L1 Instruction SRAM\n");
                return;
        }
 
@@ -179,7 +179,7 @@ static void __init l2_sram_init(void)
        free_l2_sram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l2_sram_head.next) {
-               printk(KERN_INFO"Fail to initialize L2 SRAM.\n");
+               printk(KERN_INFO "Failed to initialize L2 SRAM\n");
                return;
        }
 
@@ -351,28 +351,31 @@ static int _sram_free(const void *addr,
 
 int sram_free(const void *addr)
 {
-       if (0) {}
+
 #if L1_CODE_LENGTH != 0
-       else if (addr >= (void *)L1_CODE_START
+       if (addr >= (void *)L1_CODE_START
                 && addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))
                return l1_inst_sram_free(addr);
+       else
 #endif
 #if L1_DATA_A_LENGTH != 0
-       else if (addr >= (void *)L1_DATA_A_START
+       if (addr >= (void *)L1_DATA_A_START
                 && addr < (void *)(L1_DATA_A_START + L1_DATA_A_LENGTH))
                return l1_data_A_sram_free(addr);
+       else
 #endif
 #if L1_DATA_B_LENGTH != 0
-       else if (addr >= (void *)L1_DATA_B_START
+       if (addr >= (void *)L1_DATA_B_START
                 && addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH))
                return l1_data_B_sram_free(addr);
+       else
 #endif
 #if L2_LENGTH != 0
-       else if (addr >= (void *)L2_START
+       if (addr >= (void *)L2_START
                 && addr < (void *)(L2_START + L2_LENGTH))
                return l2_sram_free(addr);
-#endif
        else
+#endif
                return -1;
 }
 EXPORT_SYMBOL(sram_free);