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/idr.c | |
parent | 9c160941403ba833c8e67981806ccae73ff7aca7 (diff) |
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/idr.c')
-rw-r--r-- | lib/idr.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -147,18 +147,9 @@ EXPORT_SYMBOL(idr_get_next_ext); | |||
147 | * the one being replaced!). | 147 | * the one being replaced!). |
148 | * | 148 | * |
149 | * Returns: the old value on success. %-ENOENT indicates that @id was not | 149 | * Returns: the old value on success. %-ENOENT indicates that @id was not |
150 | * found. %-EINVAL indicates that @id or @ptr were not valid. | 150 | * found. %-EINVAL indicates that @ptr was not valid. |
151 | */ | 151 | */ |
152 | void *idr_replace(struct idr *idr, void *ptr, int id) | 152 | void *idr_replace(struct idr *idr, void *ptr, unsigned long id) |
153 | { | ||
154 | if (id < 0) | ||
155 | return ERR_PTR(-EINVAL); | ||
156 | |||
157 | return idr_replace_ext(idr, ptr, id); | ||
158 | } | ||
159 | EXPORT_SYMBOL(idr_replace); | ||
160 | |||
161 | void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id) | ||
162 | { | 153 | { |
163 | struct radix_tree_node *node; | 154 | struct radix_tree_node *node; |
164 | void __rcu **slot = NULL; | 155 | void __rcu **slot = NULL; |
@@ -175,7 +166,7 @@ void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id) | |||
175 | 166 | ||
176 | return entry; | 167 | return entry; |
177 | } | 168 | } |
178 | EXPORT_SYMBOL(idr_replace_ext); | 169 | EXPORT_SYMBOL(idr_replace); |
179 | 170 | ||
180 | /** | 171 | /** |
181 | * DOC: IDA description | 172 | * DOC: IDA description |