Staging: dt3155: coding style cleanups for allocator code

This fixes up the worst of the coding style errors for the
allocator code.

Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2009-12-22 15:18:28 -08:00
Родитель 8125e2f668
Коммит 1769fd86e1
2 изменённых файлов: 143 добавлений и 143 удалений

Просмотреть файл

@ -88,8 +88,8 @@ int allocator_himem = 1; /* 0 = probe, pos. = megs, neg. = disable */
int allocator_step = 1; /* This is the step size in MB */
int allocator_probe = 1; /* This is a flag -- 1=probe, 0=don't probe */
static unsigned long allocator_buffer = 0; /* physical address */
static unsigned long allocator_buffer_size = 0; /* kilobytes */
static unsigned long allocator_buffer; /* physical address */
static unsigned long allocator_buffer_size; /* kilobytes */
/*
* The allocator keeps a list of DMA areas, so multiple devices
@ -102,7 +102,7 @@ struct allocator_struct {
struct allocator_struct *next;
};
struct allocator_struct *allocator_list = NULL;
struct allocator_struct *allocator_list;
#ifdef ALL_DEBUG
@ -111,9 +111,8 @@ static int dump_list(void)
struct allocator_struct *ptr;
PDEBUG("Current list:\n");
for (ptr = allocator_list; ptr; ptr = ptr->next) {
for (ptr = allocator_list; ptr; ptr = ptr->next)
PDEBUG("0x%08lx (size %likB)\n", ptr->address, ptr->size>>10);
}
return 0;
}
#endif
@ -177,7 +176,8 @@ int allocator_free_dma (unsigned long address)
prev = ptr; ptr = ptr->next;
if (!ptr) {
printk(KERN_ERR ALL_MSG "free_dma(0x%08lx) but add. not allocated\n",
printk(KERN_ERR ALL_MSG
"free_dma(0x%08lx) but add. not allocated\n",
ptr->address);
return -EINVAL;
}
@ -199,8 +199,7 @@ int allocator_free_dma (unsigned long address)
int allocator_init(u_long *allocator_max)
{
/* check how much free memory is there */
volatile void *remapped;
void *remapped;
unsigned long max;
unsigned long trial_size = allocator_himem<<20;
unsigned long last_trial = 0;
@ -213,12 +212,12 @@ int allocator_init(u_long *allocator_max)
if (allocator_himem < 0) /* don't even try */
return -EINVAL;
if (!trial_size) trial_size = 1<<20; /* not specified: try one meg */
if (!trial_size)
trial_size = 1<<20; /* not specified: try one meg */
while (1) {
remapped = ioremap(__pa(high_memory), trial_size);
if (!remapped)
{
if (!remapped) {
PDEBUGG("%li megs failed!\n", trial_size>>20);
break;
}
@ -234,12 +233,12 @@ int allocator_init(u_long *allocator_max)
last_trial = trial_size;
if (i == trial_size)
trial_size += step; /* increment, if all went well */
else
{
else {
PDEBUGG("%li megs copy test failed!\n", trial_size>>20);
break;
}
if (!allocator_probe) break;
if (!allocator_probe)
break;
}
PDEBUG("%li megs (%li k, %li b)\n", i>>20, i>>10, i);
allocator_buffer_size = i>>10; /* kilobytes */
@ -273,7 +272,8 @@ int allocator_init(u_long *allocator_max)
tail->next = NULL;
allocator_list = head;
*allocator_max = allocator_buffer_size; /* Back to the user code, in KB */
/* Back to the user code, in KB */
*allocator_max = allocator_buffer_size;
return 0; /* ok, ready */
}