Skip to content

Commit a204e6d

Browse files
MiaoheLintehcaster
authored andcommitted
mm/slub: remove unneeded return value of slab_pad_check
The return value of slab_pad_check is never used. So we can make it return void now. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Link: https://lore.kernel.org/r/20220419120352.37825-1-linmiaohe@huawei.com
1 parent 6b6efe2 commit a204e6d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mm/slub.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ static int check_pad_bytes(struct kmem_cache *s, struct slab *slab, u8 *p)
10211021
}
10221022

10231023
/* Check the pad bytes at the end of a slab page */
1024-
static int slab_pad_check(struct kmem_cache *s, struct slab *slab)
1024+
static void slab_pad_check(struct kmem_cache *s, struct slab *slab)
10251025
{
10261026
u8 *start;
10271027
u8 *fault;
@@ -1031,21 +1031,21 @@ static int slab_pad_check(struct kmem_cache *s, struct slab *slab)
10311031
int remainder;
10321032

10331033
if (!(s->flags & SLAB_POISON))
1034-
return 1;
1034+
return;
10351035

10361036
start = slab_address(slab);
10371037
length = slab_size(slab);
10381038
end = start + length;
10391039
remainder = length % s->size;
10401040
if (!remainder)
1041-
return 1;
1041+
return;
10421042

10431043
pad = end - remainder;
10441044
metadata_access_enable();
10451045
fault = memchr_inv(kasan_reset_tag(pad), POISON_INUSE, remainder);
10461046
metadata_access_disable();
10471047
if (!fault)
1048-
return 1;
1048+
return;
10491049
while (end > fault && end[-1] == POISON_INUSE)
10501050
end--;
10511051

@@ -1054,7 +1054,6 @@ static int slab_pad_check(struct kmem_cache *s, struct slab *slab)
10541054
print_section(KERN_ERR, "Padding ", pad, remainder);
10551055

10561056
restore_bytes(s, "slab padding", POISON_INUSE, fault, end);
1057-
return 0;
10581057
}
10591058

10601059
static int check_object(struct kmem_cache *s, struct slab *slab,
@@ -1642,8 +1641,7 @@ static inline int free_debug_processing(
16421641
void *head, void *tail, int bulk_cnt,
16431642
unsigned long addr) { return 0; }
16441643

1645-
static inline int slab_pad_check(struct kmem_cache *s, struct slab *slab)
1646-
{ return 1; }
1644+
static inline void slab_pad_check(struct kmem_cache *s, struct slab *slab) {}
16471645
static inline int check_object(struct kmem_cache *s, struct slab *slab,
16481646
void *object, u8 val) { return 1; }
16491647
static inline void add_full(struct kmem_cache *s, struct kmem_cache_node *n,

0 commit comments

Comments
 (0)