Skip to content

Commit 444f20c

Browse files
zhaoxinchaotehcaster
authored andcommitted
mm/slab: correct return values in comment for _kmem_cache_create()
__kmem_cache_create() returns 0 on success and non-zero on failure. The comment is wrong in two instances, so fix the first one and remove the second one. Also make the comment non-doc, because it doesn't describe an API function, but SLAB-specific implementation. Signed-off-by: zhaoxinchao <chrisxinchao@outlook.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
1 parent 44c026a commit 444f20c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

mm/slab.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,14 +1887,12 @@ static bool set_on_slab_cache(struct kmem_cache *cachep,
18871887
return true;
18881888
}
18891889

1890-
/**
1890+
/*
18911891
* __kmem_cache_create - Create a cache.
18921892
* @cachep: cache management descriptor
18931893
* @flags: SLAB flags
18941894
*
1895-
* Returns a ptr to the cache on success, NULL on failure.
1896-
* Cannot be called within an int, but can be interrupted.
1897-
* The @ctor is run when new pages are allocated by the cache.
1895+
* Returns zero on success, nonzero on failure.
18981896
*
18991897
* The flags are
19001898
*
@@ -1907,8 +1905,6 @@ static bool set_on_slab_cache(struct kmem_cache *cachep,
19071905
* %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware
19081906
* cacheline. This can be beneficial if you're counting cycles as closely
19091907
* as davem.
1910-
*
1911-
* Return: a pointer to the created cache or %NULL in case of error
19121908
*/
19131909
int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags)
19141910
{

0 commit comments

Comments
 (0)