[PATCH] Whitespace and CodingStyle cleanup for lib/idr.c
Cleanup trailing whitespace, blank lines, CodingStyle issues etc, for lib/idr.c Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
850b924792
commit
e15ae2dd3e
13
lib/idr.c
13
lib/idr.c
@@ -225,6 +225,7 @@ build_up:
|
|||||||
int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
|
int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
rv = idr_get_new_above_int(idp, ptr, starting_id);
|
rv = idr_get_new_above_int(idp, ptr, starting_id);
|
||||||
/*
|
/*
|
||||||
* This is a cheap hack until the IDR code can be fixed to
|
* This is a cheap hack until the IDR code can be fixed to
|
||||||
@@ -259,6 +260,7 @@ EXPORT_SYMBOL(idr_get_new_above);
|
|||||||
int idr_get_new(struct idr *idp, void *ptr, int *id)
|
int idr_get_new(struct idr *idp, void *ptr, int *id)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
rv = idr_get_new_above_int(idp, ptr, 0);
|
rv = idr_get_new_above_int(idp, ptr, 0);
|
||||||
/*
|
/*
|
||||||
* This is a cheap hack until the IDR code can be fixed to
|
* This is a cheap hack until the IDR code can be fixed to
|
||||||
@@ -308,10 +310,9 @@ static void sub_remove(struct idr *idp, int shift, int id)
|
|||||||
}
|
}
|
||||||
if (!*paa)
|
if (!*paa)
|
||||||
idp->layers = 0;
|
idp->layers = 0;
|
||||||
} else {
|
} else
|
||||||
idr_remove_warning(id);
|
idr_remove_warning(id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* idr_remove - remove the given id and free it's slot
|
* idr_remove - remove the given id and free it's slot
|
||||||
@@ -326,8 +327,7 @@ void idr_remove(struct idr *idp, int id)
|
|||||||
id &= MAX_ID_MASK;
|
id &= MAX_ID_MASK;
|
||||||
|
|
||||||
sub_remove(idp, (idp->layers - 1) * IDR_BITS, id);
|
sub_remove(idp, (idp->layers - 1) * IDR_BITS, id);
|
||||||
if ( idp->top && idp->top->count == 1 &&
|
if (idp->top && idp->top->count == 1 && (idp->layers > 1) &&
|
||||||
(idp->layers > 1) &&
|
|
||||||
idp->top->ary[0]) { // We can drop a layer
|
idp->top->ary[0]) { // We can drop a layer
|
||||||
|
|
||||||
p = idp->top->ary[0];
|
p = idp->top->ary[0];
|
||||||
@@ -337,7 +337,6 @@ void idr_remove(struct idr *idp, int id)
|
|||||||
--idp->layers;
|
--idp->layers;
|
||||||
}
|
}
|
||||||
while (idp->id_free_cnt >= IDR_FREE_MAX) {
|
while (idp->id_free_cnt >= IDR_FREE_MAX) {
|
||||||
|
|
||||||
p = alloc_layer(idp);
|
p = alloc_layer(idp);
|
||||||
kmem_cache_free(idr_layer_cache, p);
|
kmem_cache_free(idr_layer_cache, p);
|
||||||
return;
|
return;
|
||||||
@@ -391,8 +390,8 @@ void *idr_find(struct idr *idp, int id)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(idr_find);
|
EXPORT_SYMBOL(idr_find);
|
||||||
|
|
||||||
static void idr_cache_ctor(void * idr_layer,
|
static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache,
|
||||||
kmem_cache_t *idr_layer_cache, unsigned long flags)
|
unsigned long flags)
|
||||||
{
|
{
|
||||||
memset(idr_layer, 0, sizeof(struct idr_layer));
|
memset(idr_layer, 0, sizeof(struct idr_layer));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user