Improve the type safety and remove calls to slab_page(). Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- mm/slub.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 98cc2545a9bd..d941bd188a8e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -761,12 +761,11 @@ void print_tracking(struct kmem_cache *s, void *object) print_track("Freed", get_track(s, object, TRACK_FREE), pr_time); } -static void print_page_info(struct page *page) +static void print_slab_info(struct slab *slab) { pr_err("Slab 0x%p objects=%u used=%u fp=0x%p flags=%#lx(%pGp)\n", - page, page->objects, page->inuse, page->freelist, - page->flags, &page->flags); - + slab, slab->objects, slab->inuse, slab->freelist, + slab->flags, &slab->flags); } static void slab_bug(struct kmem_cache *s, char *fmt, ...) @@ -823,7 +822,7 @@ static void print_trailer(struct kmem_cache *s, struct slab *slab, u8 *p) print_tracking(s, p); - print_page_info(slab_page(slab)); + print_slab_info(slab); pr_err("Object 0x%p @offset=%tu fp=0x%p\n\n", p, p - addr, get_freepointer(s, p)); @@ -879,7 +878,7 @@ static __printf(3, 4) void slab_err(struct kmem_cache *s, struct slab *slab, vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); slab_bug(s, "%s", buf); - print_page_info(slab_page(slab)); + print_slab_info(slab); dump_stack(); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); } -- 2.32.0