diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2013-05-28 10:09:22 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2013-05-28 10:09:29 +0200 |
| commit | 864bfb25b57a6766ea689befa5cf09a4353281ce (patch) | |
| tree | 478941ca6e76b8d77b71f5827a3ce751c46a72b5 /lib | |
| parent | 071361d3473ebb8142907470ff12d59c59f6be72 (diff) | |
| parent | 49717cb40410fe4b563968680ff7c513967504c6 (diff) | |
| download | linux-864bfb25b57a6766ea689befa5cf09a4353281ce.tar.gz linux-864bfb25b57a6766ea689befa5cf09a4353281ce.zip | |
Merge branch 'master' into for-next
Merge with 49717cb ("kthread: Document ways of reducing OS jitter due
to per-CPU kthreads") to be able to apply fixup patch on top of it.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/idr.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/idr.c b/lib/idr.c index 73f4d53c02f3..00739aaf95a2 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -569,8 +569,7 @@ void idr_remove(struct idr *idp, int id) struct idr_layer *p; struct idr_layer *to_free; - /* see comment in idr_find_slowpath() */ - if (WARN_ON_ONCE(id < 0)) + if (id < 0) return; sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); @@ -667,15 +666,7 @@ void *idr_find_slowpath(struct idr *idp, int id) int n; struct idr_layer *p; - /* - * If @id is negative, idr_find() used to ignore the sign bit and - * performed lookup with the rest of bits, which is weird and can - * lead to very obscure bugs. We're now returning NULL for all - * negative IDs but just in case somebody was depending on the sign - * bit being ignored, let's trigger WARN_ON_ONCE() so that they can - * be detected and fixed. WARN_ON_ONCE() can later be removed. - */ - if (WARN_ON_ONCE(id < 0)) + if (id < 0) return NULL; p = rcu_dereference_raw(idp->top); @@ -824,8 +815,7 @@ void *idr_replace(struct idr *idp, void *ptr, int id) int n; struct idr_layer *p, *old_p; - /* see comment in idr_find_slowpath() */ - if (WARN_ON_ONCE(id < 0)) + if (id < 0) return ERR_PTR(-EINVAL); p = idp->top; |
