diff options
author | David S. Miller <davem@davemloft.net> | 2013-03-12 09:52:22 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-12 09:52:22 (GMT) |
commit | e5f2ef7ab4690d2e8faaf5fd203c5ecd70c3abaf (patch) | |
tree | 3558f68717c70a67e18c3274bb17709a353d036f /lib/idr.c | |
parent | 30129cf28a5c99f9cb7c168f0d280f147fd6cc8b (diff) | |
parent | 3da889b616164bde76a37350cf28e0d17a94e979 (diff) | |
download | linux-fsl-qoriq-e5f2ef7ab4690d2e8faaf5fd203c5ecd70c3abaf.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/intel/e1000e/netdev.c
Minor conflict in e1000e, a line that got fixed in 'net'
has been removed in 'net-next'.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/idr.c')
-rw-r--r-- | lib/idr.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -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; |