From patchwork Wed May 26 02:56:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12280545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893A4C47089 for ; Wed, 26 May 2021 02:56:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18D2161430 for ; Wed, 26 May 2021 02:56:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18D2161430 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E3C206B0071; Tue, 25 May 2021 22:56:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9F8B6B0072; Tue, 25 May 2021 22:56:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCAB56B0073; Tue, 25 May 2021 22:56:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id 7BDA96B0071 for ; Tue, 25 May 2021 22:56:32 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 15A8D180AD830 for ; Wed, 26 May 2021 02:56:32 +0000 (UTC) X-FDA: 78181869024.35.2CDC2B0 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf14.hostedemail.com (Postfix) with ESMTP id 9E982C0007C0 for ; Wed, 26 May 2021 02:56:24 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id i5so24394864pgm.0 for ; Tue, 25 May 2021 19:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hd4sjVebDaf07tFQ+ywKu8o7Lsylb2YjfwTECIMO6nE=; b=Ta1KK1z9gai6K08ZovKvMdSgSV9RnsLmXbqa+T+Xb50myBGArf76QxkU700w5T/qGF zCIzMIr1tNMayGVp6AimjdFicj3Eo47zPZx1lYeqKcOoVgMxGNOZcyYVn35dyXS8Elys mHd7UkQ3a9hGvR0mfnodrP+x7LeD3cu/YE2e0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hd4sjVebDaf07tFQ+ywKu8o7Lsylb2YjfwTECIMO6nE=; b=dzDvaV7RjUMhpun26KxXUvCFfFFBd8HJyUoLvCpxQoAgaR+9BJp2Isi0E1vxpTGZPG OSAXAlU5VgPQSC2esJiKYMorfszTKR5J6AZK5iBIH1MBgKZRixta+RAS+coXqSMTg/BK FkPRPuIls8miJctqXmTg7xx42yo6Pr2JA7Sux7oH6171RGfucQPEFSO2jTp42dZuVkL0 ++TdrKdx9iJtjMzt4zKt+fR4k2c5RUXrgwu+ZYToPNqdxpsbZyRXrvDFtrOIilUMIcJF 2vWPnj/peOkXnOaTKfyJ+gzYvm3cVCQaxK6VU7DZH1b5y+nfEGTdFIzt0OJEd3ctrP2U EPeg== X-Gm-Message-State: AOAM530LVCAd2qYrM8FTgQpUHMHK9Zp+KCqxMRPwfn6v65uVnBiCTR1A YCyfOPbHU/ANvd/4pmm+a3TGZg== X-Google-Smtp-Source: ABdhPJyhEeKpf7bQdFgMTHoucSgu3s1fpigfxmxSqi30hy2i6YsoFfE7qEMhFXKp3ynkjQthhRwXnQ== X-Received: by 2002:a63:6547:: with SMTP id z68mr15638232pgb.341.1621997790938; Tue, 25 May 2021 19:56:30 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:5a1b:e4e5:eb10:8870]) by smtp.gmail.com with ESMTPSA id 5sm2966295pjo.17.2021.05.25.19.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 19:56:30 -0700 (PDT) From: Stephen Boyd To: Andrew Morton Cc: Joe Perches , linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , linux-mm@kvack.org, Petr Mladek Subject: [PATCH v2 3/4] slub: Indicate slab_fix() uses printf formats Date: Tue, 25 May 2021 19:56:24 -0700 Message-Id: <20210526025625.601023-4-swboyd@chromium.org> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog In-Reply-To: <20210526025625.601023-1-swboyd@chromium.org> References: <20210526025625.601023-1-swboyd@chromium.org> MIME-Version: 1.0 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=Ta1KK1z9; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf14.hostedemail.com: domain of swboyd@chromium.org designates 209.85.215.179 as permitted sender) smtp.mailfrom=swboyd@chromium.org X-Stat-Signature: 5kka1qwgcqoaa4xusdc3cf9u7n17ywdk X-Rspamd-Queue-Id: 9E982C0007C0 X-Rspamd-Server: rspam02 X-HE-Tag: 1621997784-262684 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Joe Perches Ideally, slab_fix() would be marked with __printf and the format here would not use \n as that's emitted by the slab_fix(). Make these changes. Signed-off-by: Joe Perches Signed-off-by: Stephen Boyd Acked-by: Vlastimil Babka --- mm/slub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 6168b3ce1b3e..bf4949115412 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -672,6 +672,7 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...) va_end(args); } +__printf(2, 3) static void slab_fix(struct kmem_cache *s, char *fmt, ...) { struct va_format vaf; @@ -777,7 +778,7 @@ static void init_object(struct kmem_cache *s, void *object, u8 val) static void restore_bytes(struct kmem_cache *s, char *message, u8 data, void *from, void *to) { - slab_fix(s, "Restoring %s 0x%p-0x%p=0x%x\n", message, from, to - 1, data); + slab_fix(s, "Restoring %s 0x%p-0x%p=0x%x", message, from, to - 1, data); memset(from, data, to - from); } @@ -1026,13 +1027,13 @@ static int on_freelist(struct kmem_cache *s, struct page *page, void *search) slab_err(s, page, "Wrong number of objects. Found %d but should be %d", page->objects, max_objects); page->objects = max_objects; - slab_fix(s, "Number of objects adjusted."); + slab_fix(s, "Number of objects adjusted"); } if (page->inuse != page->objects - nr) { slab_err(s, page, "Wrong object count. Counter is %d but counted were %d", page->inuse, page->objects - nr); page->inuse = page->objects - nr; - slab_fix(s, "Object count adjusted."); + slab_fix(s, "Object count adjusted"); } return search == NULL; }