Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2579761imm; Thu, 16 Aug 2018 11:51:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy+gHVsyCdLU5TAIj+B83d69RQgs3bkSqSfxXPiMuZBuCe9tkjFPl+hsbpME7AoWDjlwqMg X-Received: by 2002:a17:902:7b83:: with SMTP id w3-v6mr29870777pll.192.1534445472050; Thu, 16 Aug 2018 11:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534445472; cv=none; d=google.com; s=arc-20160816; b=vSmnfhEUrukVM5Gz0j6VlXVE0mLhkxcQWk7Mua/HMyEA4ew1IhTmM4z0Pgp7HgxxND /eJHrrzefsG50KPfhwBvvnQNz4qtZD33CVzqKTM8KtADZ33ok0hjOM63U6UO0OfYwjuD SAMVhI3x78zqmtOnzycqOwrFsy4eK0IbhDWLTeM0gYo6xulXtWXBrMIltDMGIQ24xVu+ tRTadMUT7jx7QwymFZ8abumrB4Bijb6BCaFPJvD2fxHjDQ6eAcSP0xURY8QQPPy8ctAw JD86vg5K9M5bvvXZyVMcqdqIHN3wwkQsPUsxS1q6WPDuv7xv3FsxPcG73eisMNSyzAcj vTxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pT6AgFYxlj1ewnkah8Rof6GMx/+Eh49VLxBYi0aleZ4=; b=wXbmID4pbsiLJT2KtlOI3+JO8miCaOEUAuWZGnObSuHG6Tpdys6VG3Xkb30XqLAYoD Gize51axiWzPjqRcoBD5FENfq2gtN+bA2JriZodD/IrzOljI/ZVOlZo9YDP2buJ0ECeW bRhdq+tlnKduJEKBVsNsRWCyvfkswZ9jd8fyUbaTbVXwLx/WTBW+ao7jDvDoU2BbzsWS DrqhAtxiYYAs+f+6or9gG5dipPZD2uDhcAdZoSBgGxSpSHvg0q4Es1C9LgON5rnYczzQ fAzYsHdZUANtgYe1udZaepvpjx8oRx+tPGxscEUf3BwyYxRdacmcA/0j2hhp3bC9Gsx9 p6Sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si50475pll.72.2018.08.16.11.50.56; Thu, 16 Aug 2018 11:51:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728677AbeHPVmz (ORCPT + 99 others); Thu, 16 Aug 2018 17:42:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56172 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727674AbeHPVmy (ORCPT ); Thu, 16 Aug 2018 17:42:54 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 644F3CEB; Thu, 16 Aug 2018 18:42:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Ryabinin , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linus Torvalds Subject: [PATCH 3.18 08/15] mm: slub: fix format mismatches in slab_err() callers Date: Thu, 16 Aug 2018 20:41:45 +0200 Message-Id: <20180816171633.856272393@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816171633.546734046@linuxfoundation.org> References: <20180816171633.546734046@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrey Ryabinin commit f6edde9cbe0634e4391b6e421a609ca3f57f6c38 upstream. Adding __printf(3, 4) to slab_err exposed following: mm/slub.c: In function `check_slab': mm/slub.c:852:4: warning: format `%u' expects argument of type `unsigned int', but argument 4 has type `const char *' [-Wformat=] s->name, page->objects, maxobj); ^ mm/slub.c:852:4: warning: too many arguments for format [-Wformat-extra-args] mm/slub.c:857:4: warning: format `%u' expects argument of type `unsigned int', but argument 4 has type `const char *' [-Wformat=] s->name, page->inuse, page->objects); ^ mm/slub.c:857:4: warning: too many arguments for format [-Wformat-extra-args] mm/slub.c: In function `on_freelist': mm/slub.c:905:4: warning: format `%d' expects argument of type `int', but argument 5 has type `long unsigned int' [-Wformat=] "should be %d", page->objects, max_objects); Fix first two warnings by removing redundant s->name. Fix the last by changing type of max_object from unsigned long to int. Signed-off-by: Andrey Ryabinin Cc: Christoph Lameter Cc: Pekka Enberg Acked-by: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/slub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/slub.c +++ b/mm/slub.c @@ -849,12 +849,12 @@ static int check_slab(struct kmem_cache maxobj = order_objects(compound_order(page), s->size, s->reserved); if (page->objects > maxobj) { slab_err(s, page, "objects %u > max %u", - s->name, page->objects, maxobj); + page->objects, maxobj); return 0; } if (page->inuse > page->objects) { slab_err(s, page, "inuse %u > max %u", - s->name, page->inuse, page->objects); + page->inuse, page->objects); return 0; } /* Slab_pad_check fixes things up after itself */ @@ -871,7 +871,7 @@ static int on_freelist(struct kmem_cache int nr = 0; void *fp; void *object = NULL; - unsigned long max_objects; + int max_objects; fp = page->freelist; while (fp && nr <= page->objects) {