mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]>
This commit is contained in:
parent
9c16094140
commit
234a4624ef
7 changed files with 9 additions and 19 deletions
15
lib/idr.c
15
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue