aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-02-18 05:31:43 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-18 05:31:43 -0800
commit12a7558cb0f47338a4dad41fd432e405c8a70bc2 (patch)
tree082a361d32c9dc5257c1c3a1c3079d12cea1e12e /lib
parenta1861dbf7d0232b9dfceefdabf09f849c67db7d4 (diff)
downloadhistory-12a7558cb0f47338a4dad41fd432e405c8a70bc2.tar.gz
[PATCH] lib/idr.c 64-bit fixes
Various overflow problems compiling the lib/idr.c code for ppc64
Diffstat (limited to 'lib')
-rw-r--r--lib/idr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/idr.c b/lib/idr.c
index f48d714db64c40..5e2c8f29da46d0 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -150,7 +150,7 @@ EXPORT_SYMBOL(idr_pre_get);
static inline int sub_alloc(struct idr *idp, int shift, void *ptr)
{
- int n, v = 0;
+ long n, v = 0;
struct idr_layer *p;
struct idr_layer **pa[MAX_LEVEL];
struct idr_layer ***paa = &pa[0];
@@ -211,7 +211,7 @@ static inline int sub_alloc(struct idr *idp, int shift, void *ptr)
int idr_get_new(struct idr *idp, void *ptr)
{
- int v;
+ long v;
if (idp->id_free_cnt < idp->layers + 1)
return (-1);
@@ -236,7 +236,7 @@ int idr_get_new(struct idr *idp, void *ptr)
idp->count++;
v += (idp->count << MAX_ID_SHIFT);
if ( unlikely( v == -1 ))
- v += (1 << MAX_ID_SHIFT);
+ v += (1L << MAX_ID_SHIFT);
}
return(v);
}
@@ -259,7 +259,7 @@ static inline void sub_remove(struct idr *idp, int shift, int id)
p = p->ary[n];
shift -= IDR_BITS;
}
- if ( likely(p)){
+ if (likely(p != NULL)){
int n = id & IDR_MASK;
__clear_bit(n, &p->bitmap);
p->ary[n] = NULL;