diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-11-28 09:56:36 -0500 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2018-02-06 16:40:31 -0500 |
commit | 234a4624efe5629a777b4c00dbdf41dd8b7332db (patch) | |
tree | 887bef7403ebe2d39c7d1afc33bd22d72c276d76 /lib | |
parent | 9c160941403ba833c8e67981806ccae73ff7aca7 (diff) | |
download | linux-stable-234a4624efe5629a777b4c00dbdf41dd8b7332db.tar.gz linux-stable-234a4624efe5629a777b4c00dbdf41dd8b7332db.tar.bz2 linux-stable-234a4624efe5629a777b4c00dbdf41dd8b7332db.zip |
idr: Delete idr_replace_ext function
Changing idr_replace's 'id' argument to 'unsigned long' works for all
callers. Callers which passed a negative ID now get -ENOENT instead of
-EINVAL. No callers relied on this error value.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/idr.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/idr.c b/lib/idr.c index 2593ce513a18..577bfd4fe5c2 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -147,18 +147,9 @@ EXPORT_SYMBOL(idr_get_next_ext); * the one being replaced!). * * Returns: the old value on success. %-ENOENT indicates that @id was not - * found. %-EINVAL indicates that @id or @ptr were not valid. + * found. %-EINVAL indicates that @ptr was not valid. */ -void *idr_replace(struct idr *idr, void *ptr, int id) -{ - if (id < 0) - return ERR_PTR(-EINVAL); - - return idr_replace_ext(idr, ptr, id); -} -EXPORT_SYMBOL(idr_replace); - -void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id) +void *idr_replace(struct idr *idr, void *ptr, unsigned long id) { struct radix_tree_node *node; void __rcu **slot = NULL; @@ -175,7 +166,7 @@ void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id) return entry; } -EXPORT_SYMBOL(idr_replace_ext); +EXPORT_SYMBOL(idr_replace); /** * DOC: IDA description |