diff options
Diffstat (limited to 'arch/blackfin/mm/blackfin_sram.c')
-rw-r--r-- | arch/blackfin/mm/blackfin_sram.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/blackfin/mm/blackfin_sram.c b/arch/blackfin/mm/blackfin_sram.c index 5af3c31c936..4f5e887a0d9 100644 --- a/arch/blackfin/mm/blackfin_sram.c +++ b/arch/blackfin/mm/blackfin_sram.c | |||
@@ -66,7 +66,7 @@ static struct sram_piece free_l1_data_B_sram_head, used_l1_data_B_sram_head; | |||
66 | static struct sram_piece free_l1_inst_sram_head, used_l1_inst_sram_head; | 66 | static struct sram_piece free_l1_inst_sram_head, used_l1_inst_sram_head; |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | #ifdef L2_LENGTH | 69 | #if L2_LENGTH != 0 |
70 | static struct sram_piece free_l2_sram_head, used_l2_sram_head; | 70 | static struct sram_piece free_l2_sram_head, used_l2_sram_head; |
71 | #endif | 71 | #endif |
72 | 72 | ||
@@ -175,7 +175,7 @@ static void __init l1_inst_sram_init(void) | |||
175 | 175 | ||
176 | static void __init l2_sram_init(void) | 176 | static void __init l2_sram_init(void) |
177 | { | 177 | { |
178 | #ifdef L2_LENGTH | 178 | #if L2_LENGTH != 0 |
179 | free_l2_sram_head.next = | 179 | free_l2_sram_head.next = |
180 | kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); | 180 | kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); |
181 | if (!free_l2_sram_head.next) { | 181 | if (!free_l2_sram_head.next) { |
@@ -335,7 +335,7 @@ static int _sram_free(const void *addr, | |||
335 | plast->size += pavail->size; | 335 | plast->size += pavail->size; |
336 | kmem_cache_free(sram_piece_cache, pavail); | 336 | kmem_cache_free(sram_piece_cache, pavail); |
337 | } else { | 337 | } else { |
338 | pavail->next = plast; | 338 | pavail->next = plast->next; |
339 | plast->next = pavail; | 339 | plast->next = pavail; |
340 | plast = pavail; | 340 | plast = pavail; |
341 | } | 341 | } |
@@ -367,7 +367,7 @@ int sram_free(const void *addr) | |||
367 | && addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH)) | 367 | && addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH)) |
368 | return l1_data_B_sram_free(addr); | 368 | return l1_data_B_sram_free(addr); |
369 | #endif | 369 | #endif |
370 | #ifdef L2_LENGTH | 370 | #if L2_LENGTH != 0 |
371 | else if (addr >= (void *)L2_START | 371 | else if (addr >= (void *)L2_START |
372 | && addr < (void *)(L2_START + L2_LENGTH)) | 372 | && addr < (void *)(L2_START + L2_LENGTH)) |
373 | return l2_sram_free(addr); | 373 | return l2_sram_free(addr); |
@@ -379,7 +379,7 @@ EXPORT_SYMBOL(sram_free); | |||
379 | 379 | ||
380 | void *l1_data_A_sram_alloc(size_t size) | 380 | void *l1_data_A_sram_alloc(size_t size) |
381 | { | 381 | { |
382 | unsigned flags; | 382 | unsigned long flags; |
383 | void *addr = NULL; | 383 | void *addr = NULL; |
384 | 384 | ||
385 | /* add mutex operation */ | 385 | /* add mutex operation */ |
@@ -402,7 +402,7 @@ EXPORT_SYMBOL(l1_data_A_sram_alloc); | |||
402 | 402 | ||
403 | int l1_data_A_sram_free(const void *addr) | 403 | int l1_data_A_sram_free(const void *addr) |
404 | { | 404 | { |
405 | unsigned flags; | 405 | unsigned long flags; |
406 | int ret; | 406 | int ret; |
407 | 407 | ||
408 | /* add mutex operation */ | 408 | /* add mutex operation */ |
@@ -425,7 +425,7 @@ EXPORT_SYMBOL(l1_data_A_sram_free); | |||
425 | void *l1_data_B_sram_alloc(size_t size) | 425 | void *l1_data_B_sram_alloc(size_t size) |
426 | { | 426 | { |
427 | #if L1_DATA_B_LENGTH != 0 | 427 | #if L1_DATA_B_LENGTH != 0 |
428 | unsigned flags; | 428 | unsigned long flags; |
429 | void *addr; | 429 | void *addr; |
430 | 430 | ||
431 | /* add mutex operation */ | 431 | /* add mutex operation */ |
@@ -450,7 +450,7 @@ EXPORT_SYMBOL(l1_data_B_sram_alloc); | |||
450 | int l1_data_B_sram_free(const void *addr) | 450 | int l1_data_B_sram_free(const void *addr) |
451 | { | 451 | { |
452 | #if L1_DATA_B_LENGTH != 0 | 452 | #if L1_DATA_B_LENGTH != 0 |
453 | unsigned flags; | 453 | unsigned long flags; |
454 | int ret; | 454 | int ret; |
455 | 455 | ||
456 | /* add mutex operation */ | 456 | /* add mutex operation */ |
@@ -504,7 +504,7 @@ EXPORT_SYMBOL(l1_data_sram_free); | |||
504 | void *l1_inst_sram_alloc(size_t size) | 504 | void *l1_inst_sram_alloc(size_t size) |
505 | { | 505 | { |
506 | #if L1_CODE_LENGTH != 0 | 506 | #if L1_CODE_LENGTH != 0 |
507 | unsigned flags; | 507 | unsigned long flags; |
508 | void *addr; | 508 | void *addr; |
509 | 509 | ||
510 | /* add mutex operation */ | 510 | /* add mutex operation */ |
@@ -529,7 +529,7 @@ EXPORT_SYMBOL(l1_inst_sram_alloc); | |||
529 | int l1_inst_sram_free(const void *addr) | 529 | int l1_inst_sram_free(const void *addr) |
530 | { | 530 | { |
531 | #if L1_CODE_LENGTH != 0 | 531 | #if L1_CODE_LENGTH != 0 |
532 | unsigned flags; | 532 | unsigned long flags; |
533 | int ret; | 533 | int ret; |
534 | 534 | ||
535 | /* add mutex operation */ | 535 | /* add mutex operation */ |
@@ -551,7 +551,7 @@ EXPORT_SYMBOL(l1_inst_sram_free); | |||
551 | /* L1 Scratchpad memory allocate function */ | 551 | /* L1 Scratchpad memory allocate function */ |
552 | void *l1sram_alloc(size_t size) | 552 | void *l1sram_alloc(size_t size) |
553 | { | 553 | { |
554 | unsigned flags; | 554 | unsigned long flags; |
555 | void *addr; | 555 | void *addr; |
556 | 556 | ||
557 | /* add mutex operation */ | 557 | /* add mutex operation */ |
@@ -569,7 +569,7 @@ void *l1sram_alloc(size_t size) | |||
569 | /* L1 Scratchpad memory allocate function */ | 569 | /* L1 Scratchpad memory allocate function */ |
570 | void *l1sram_alloc_max(size_t *psize) | 570 | void *l1sram_alloc_max(size_t *psize) |
571 | { | 571 | { |
572 | unsigned flags; | 572 | unsigned long flags; |
573 | void *addr; | 573 | void *addr; |
574 | 574 | ||
575 | /* add mutex operation */ | 575 | /* add mutex operation */ |
@@ -587,7 +587,7 @@ void *l1sram_alloc_max(size_t *psize) | |||
587 | /* L1 Scratchpad memory free function */ | 587 | /* L1 Scratchpad memory free function */ |
588 | int l1sram_free(const void *addr) | 588 | int l1sram_free(const void *addr) |
589 | { | 589 | { |
590 | unsigned flags; | 590 | unsigned long flags; |
591 | int ret; | 591 | int ret; |
592 | 592 | ||
593 | /* add mutex operation */ | 593 | /* add mutex operation */ |
@@ -604,8 +604,8 @@ int l1sram_free(const void *addr) | |||
604 | 604 | ||
605 | void *l2_sram_alloc(size_t size) | 605 | void *l2_sram_alloc(size_t size) |
606 | { | 606 | { |
607 | #ifdef L2_LENGTH | 607 | #if L2_LENGTH != 0 |
608 | unsigned flags; | 608 | unsigned long flags; |
609 | void *addr; | 609 | void *addr; |
610 | 610 | ||
611 | /* add mutex operation */ | 611 | /* add mutex operation */ |
@@ -640,8 +640,8 @@ EXPORT_SYMBOL(l2_sram_zalloc); | |||
640 | 640 | ||
641 | int l2_sram_free(const void *addr) | 641 | int l2_sram_free(const void *addr) |
642 | { | 642 | { |
643 | #ifdef L2_LENGTH | 643 | #if L2_LENGTH != 0 |
644 | unsigned flags; | 644 | unsigned long flags; |
645 | int ret; | 645 | int ret; |
646 | 646 | ||
647 | /* add mutex operation */ | 647 | /* add mutex operation */ |
@@ -779,7 +779,7 @@ static int sram_proc_read(char *buf, char **start, off_t offset, int count, | |||
779 | &free_l1_inst_sram_head, &used_l1_inst_sram_head)) | 779 | &free_l1_inst_sram_head, &used_l1_inst_sram_head)) |
780 | goto not_done; | 780 | goto not_done; |
781 | #endif | 781 | #endif |
782 | #ifdef L2_LENGTH | 782 | #if L2_LENGTH != 0 |
783 | if (_sram_proc_read(buf, &len, count, "L2", | 783 | if (_sram_proc_read(buf, &len, count, "L2", |
784 | &free_l2_sram_head, &used_l2_sram_head)) | 784 | &free_l2_sram_head, &used_l2_sram_head)) |
785 | goto not_done; | 785 | goto not_done; |