Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e15ae2dd authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] Whitespace and CodingStyle cleanup for lib/idr.c



Cleanup trailing whitespace, blank lines, CodingStyle issues etc, for
lib/idr.c

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 850b9247
Loading
Loading
Loading
Loading
+17 −18
Original line number Original line Diff line number Diff line
@@ -225,6 +225,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
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));
}
}