Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3712629pxj; Tue, 1 Jun 2021 11:25:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAsvPt3FkzHKzNnNEoSL968hw0HUDCOBq/voNx3+7Ir+Yv+HVJIje5jktBkpp+bBVijBZi X-Received: by 2002:a17:906:2d51:: with SMTP id e17mr8485065eji.500.1622571891324; Tue, 01 Jun 2021 11:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622571891; cv=none; d=google.com; s=arc-20160816; b=l1NlLQ/uAbLgHGc5leC1HowJ/uIboPmkvUDaJ++cFEXvGoBa+IXezNRzHSE/n4Ctbo zLKjnKr18BJT6w2HwbnlJ4ihp//EdGrMvFsf54bzHEJmZncJIm+zjZchgqxkJYtd/fRP eoXa854w5dbS4/U+MGk2ThV35auq3ANRgb9l/m/ZJHcZGTnxWBu+8XtJYYkL/4fmRP3K mLvL88BI/bgl1JjaaeHKkRhNDF+XyA+mj8LGkFfAc9U1LDWJ+7fKkA4+qNfeQEx1W/en w1AtyzFguMKGbKSC0M3GTTwpSf+1pWcHXrvg3JPi3fybjxQFW+2s8cwy37K2FDDWt7hB wgIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+4kopGrPpDmNYqodYUvkjETu0gKLYPPcKDiSzcCSolk=; b=ijUrk5gHez/Cv8UXlMhOZimjzBrDL55BHPU6EHnoydM/Bb71CKh8wmJ6tnQZvU5AuQ ue6OdnMuqoA/Av3vRHRn+0lTJ9p+D2BI+W8O65kPoARbu/NIR0FRj+dtAcDZa73/2Qxn yKKRAdVMKZKRtI/+s3VzvLYp/vHxxuO2PSKypyx72Wizqp/UzmNg5AJXoxhSS9DFwB0+ YZO+QNKFvSS1Re717A8ilb/z8EgVe/vNJ79Syn28hODzKMZApGCprgPZZFTMBdNnoAS/ Fh5Y6mCOfgFAC8qextw6d7yMy0CkYek/C6zq/R9e9kTJrUdOR9twbyKp9CplVCT/3kUb NxEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FdH1YFBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si7852230eje.551.2021.06.01.11.24.28; Tue, 01 Jun 2021 11:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FdH1YFBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234738AbhFASXz (ORCPT + 99 others); Tue, 1 Jun 2021 14:23:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234718AbhFASXu (ORCPT ); Tue, 1 Jun 2021 14:23:50 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5168AC061574 for ; Tue, 1 Jun 2021 11:22:09 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id j12so33347pgh.7 for ; Tue, 01 Jun 2021 11:22:09 -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=+4kopGrPpDmNYqodYUvkjETu0gKLYPPcKDiSzcCSolk=; b=FdH1YFBnQgCff+7rGQ6EQDjWOQlazi5AGW5irmxbWACfjKF3jf3HzEcxIWIK/D69An 71EwfeSug2avMa2n9ao3JFsMQkXHL4Eg3EVtoSxKvCxhgjCY1PS0YKWV9Cq1shXJqsb1 g9ZkXirTMKZlH7yAO8UtAV9ojzlMdJAKJiAks= 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=+4kopGrPpDmNYqodYUvkjETu0gKLYPPcKDiSzcCSolk=; b=RgKNaaE62iJxFH1sSDih3dwXkz1FZU9YUi3LYMPuZ23L74mPo7WLVwhhxbCknqmO1y swB/RpjD6ru7cMNnxIPXx6kqy5LsEDGWjgPM5pyc6ep0OQlnNsCG8I1RBGMVlnswKOFM LCxVsyhODe+pf0B7G/J6TV1sraX/6jK6L6tC0hVKfZRyLw2LprVxXcpcz4zSPwRt5Oj8 BstWH/NuAXIR8pvmBhM5dHrZUE74dKz4TrVUpgMxh/bO7utgyyLMsUwcPWPSojp0x03a voNugZvru8K0NyB4jos1uwiLm1BkjALY2sjYBdNd3HO5JySOTg4/G/IO6Xr010Dq6cMw j0hw== X-Gm-Message-State: AOAM532hTeDw7/CuoDgQnd2kcjvRI42g79CqMNzYzOJSziGOaC11x3cm 82QQ5ebAKqRpEiRv6fNi5E5nsA== X-Received: by 2002:a63:5218:: with SMTP id g24mr28883071pgb.309.1622571728889; Tue, 01 Jun 2021 11:22:08 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:ee82:b2a7:c8bd:18e7]) by smtp.gmail.com with ESMTPSA id g29sm14510982pgm.11.2021.06.01.11.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 11:22:08 -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 v3 3/4] slub: Indicate slab_fix() uses printf formats Date: Tue, 1 Jun 2021 11:22:01 -0700 Message-Id: <20210601182202.3011020-4-swboyd@chromium.org> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog In-Reply-To: <20210601182202.3011020-1-swboyd@chromium.org> References: <20210601182202.3011020-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Vlastimil Babka Signed-off-by: Stephen Boyd --- 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; } -- https://chromeos.dev