The idr_for_each() function is now part of the LinuxKPI. Use the
LinuxKPI's idr_for_each() function instead of the local one to avoid compilation issues. Discussed with: np @ MFC after: 1 week
This commit is contained in:
parent
5685cc375d
commit
fd168b7052
@ -1004,43 +1004,6 @@ gen_pool_destroy(struct gen_pool *gp)
|
||||
#define L1_CACHE_BYTES 32
|
||||
#endif
|
||||
|
||||
static inline
|
||||
int idr_for_each(struct idr *idp,
|
||||
int (*fn)(int id, void *p, void *data), void *data)
|
||||
{
|
||||
int n, id, max, error = 0;
|
||||
struct idr_layer *p;
|
||||
struct idr_layer *pa[MAX_LEVEL];
|
||||
struct idr_layer **paa = &pa[0];
|
||||
|
||||
n = idp->layers * IDR_BITS;
|
||||
p = idp->top;
|
||||
max = 1 << n;
|
||||
|
||||
id = 0;
|
||||
while (id < max) {
|
||||
while (n > 0 && p) {
|
||||
n -= IDR_BITS;
|
||||
*paa++ = p;
|
||||
p = p->ary[(id >> n) & IDR_MASK];
|
||||
}
|
||||
|
||||
if (p) {
|
||||
error = fn(id, (void *)p, data);
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
|
||||
id += 1 << n;
|
||||
while (n < fls(id)) {
|
||||
n += IDR_BITS;
|
||||
p = *--paa;
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void c4iw_cm_init_cpl(struct adapter *);
|
||||
void c4iw_cm_term_cpl(struct adapter *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user