From patchwork Tue Oct 22 17:21:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wladislav Wiebe X-Patchwork-Id: 13845984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58EE3D2CE08 for ; Tue, 22 Oct 2024 17:21:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D40226B0082; Tue, 22 Oct 2024 13:21:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEFFE6B0083; Tue, 22 Oct 2024 13:21:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB7B66B0085; Tue, 22 Oct 2024 13:21:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9CC916B0082 for ; Tue, 22 Oct 2024 13:21:18 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BE4AD140345 for ; Tue, 22 Oct 2024 17:21:00 +0000 (UTC) X-FDA: 82701904068.14.0859596 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf23.hostedemail.com (Postfix) with ESMTP id B3F52140023 for ; Tue, 22 Oct 2024 17:21:05 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="HGEOm/8/"; spf=pass (imf23.hostedemail.com: domain of wladislav.kw@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=wladislav.kw@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729617625; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=fVTv/ksHummE97FnDYtFliWHAfZzUexk/HaH8jn7z+I=; b=v4krFPZc9uQaNN8Ai23g6pBrz6M2cze/yU8FfkRXv++5JWsV+qckAoCXS7u3ou14JYI0k6 bPV9ruwM64olat+3h7RPcDku2mUM92y4bpaUBEVZLyOcrC5TlAg5EAvrLEL8opYgRLk0H9 JVgdlr5ODFMT8gWa4P+6wI8VsduhQAo= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="HGEOm/8/"; spf=pass (imf23.hostedemail.com: domain of wladislav.kw@gmail.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=wladislav.kw@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729617625; a=rsa-sha256; cv=none; b=1Nv8cIePo3L3fdEx0mwjR7/bSRg+FRTDIG6RTeKHPX1XivSthw+lV9mKd32L2xNXZYwaiS Kh2GZY9X8e6c+VI8sq/CF/ChDG5jv1+Lpu8XIQ07swRBDiX/OOMV/ZMDrElJ+MTDgvQzCP XIK/oFkx/Kwinqg8V3/xdiMTCz8AOp0= Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a9a68480164so575073266b.3 for ; Tue, 22 Oct 2024 10:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729617675; x=1730222475; darn=kvack.org; h=content-transfer-encoding:subject:from:cc:to:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=fVTv/ksHummE97FnDYtFliWHAfZzUexk/HaH8jn7z+I=; b=HGEOm/8/x12vcatbghniRaInYixBBmsU33VkJyolZdCbC+noWtm/5XDQEKgvUMhzdg 11ni/6ezRBbf91aPQB8R0pUmPb48LhBSSSIHyK1PHnAx5dEMKNy+pWTBn4JivJREnORb 8eQbEIAYYKHqaN8i9Vz080sNX5Mgjvy8YQ7FwcLMakJ5C1QSs/qpsHpkvbHoJQlkocmS Exd9lpxeQj5m9LmJOKWPI9XcCUnkIUjxWW333wLhNCfyOzLM7qE6Hsj5BdaoPRqmjbGB o1WKwGnPxnv8a4MzUnDTf94Zzu2cNfCezZFAtU63bD9QAlWD7t/G6UfrKoNWVtHhhIL5 THwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729617675; x=1730222475; h=content-transfer-encoding:subject:from:cc:to:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=fVTv/ksHummE97FnDYtFliWHAfZzUexk/HaH8jn7z+I=; b=qS1pgDOpniPDDYxuLBSb0VYLCDDa2gsINIxBo59KNAUwUXo/oRrVilRRUzUZZ6ao4Y SUSwAe4wOaNXzVnxo3MrOoxw5CeZLezAicKw/L1rJOZRKD/a5nlYYrM8FfMeuXFNVsvS 2BZGZtWJYB4YL3a85lo1mTLAyV0kIhw3VGrOKKifxFhom5hLCpb0un8wsOHhNas2KWZH xgwHEyzPpxzMFzCI3qqOAhWAj3Bd41Dsw9OeSG/FsBksZB2hnniVF3KLmak/8dGPa2cf Hn0dRFYK6jeRr77e0lWsiGKEJNU41sPJs6W0efc6gIwRMOvX3oALxssFYXk3a6jjcUUw oe1Q== X-Forwarded-Encrypted: i=1; AJvYcCV6pmZc5hH9P7Cnv4fvw1AEuFMSs8n2FhK8mDYmXrQv1sMdDxsp19PPlOSmpwEniwEL9IgI7OUy1g==@kvack.org X-Gm-Message-State: AOJu0Yw4YXpUYmlAV5TVkl+UzmwqFc7RO+FMzS9OVoZwM68A+5xAfwJi fZxCkrmb2HhKpHT/rCDneFSNkz3XDBPHuiBMkMzy4tMBHaVqyaH9u8GxsHf9Cfs= X-Google-Smtp-Source: AGHT+IGhAOPZp6xrjMIPt+5jU8/59Zal3osEA6sx6csLQQdOmUbXnGm6ypF56Te4f3ZV5guHeWVdWg== X-Received: by 2002:a17:907:1c9e:b0:a9a:188f:efd9 with SMTP id a640c23a62f3a-a9a69bad2a2mr1517764666b.29.1729617674288; Tue, 22 Oct 2024 10:21:14 -0700 (PDT) Received: from [192.168.2.39] (ip-109-192-223-157.um38.pools.vodafone-ip.de. [109.192.223.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a91598f11sm364897866b.193.2024.10.22.10.21.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 10:21:13 -0700 (PDT) Message-ID: Date: Tue, 22 Oct 2024 19:21:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, wladislav.kw@gmail.com From: Wladislav Wiebe Subject: [PATCH] tools/mm: -Werror fixes in page-types/slabinfo X-Rspam-User: X-Stat-Signature: 8a4baggr5e1kh87bmzit6sjidfh1b9w8 X-Rspamd-Queue-Id: B3F52140023 X-Rspamd-Server: rspam11 X-HE-Tag: 1729617665-336987 X-HE-Meta: U2FsdGVkX1+TZNSJKQtR/v2iHfPGlC7zibq33SUOtQCkv4bfZjAroNX40pcMUWTiXP9y25/Rc2gjQn+fSHJpJue0FKxk9JUU3l8Ru1SUY98aMsqOb+agI7Uws83jIYVHgwQfyfJutypGmFwoK2gn8KbScDQ2tfg6rcH04xhGZeSSVt4i2YCNdb9aORbWF11caTMQ9r4/4qf6F+AVeL+agbMNYxjTkiEkcHh0mOh3Bn4Obq020VLCy3Q/TVMD/WeD/BiBVjXEZ+HB5uQyLVEeZHsrofjWMoXgexW3JS+qvcqKVx9I2pphQd1g60apUccZ76GpbG0vcm7LlQxHKdleWPGYhTnb4uqLnfcbAyakTuQoKgx2lkRUdvMEQLrMeo0qv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LAlrR3Y7+R3y7B8bimAaGuEG5PS0uRhbe5EmJa2cWOuynGbu3wyHSBgFnZ8ZCGzBrOa74Me2MUK6tRLtXUdaQmW25qTgnx6LHFBDC6U+aoBMeo3jxIhEOW2ZtdvvaYsXlEQKwt5AY7Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000032, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Commit e6d2c436ff693 ("tools/mm: allow users to provide additional cflags/ldflags") passes now CFLAGS to Makefile. With this, build systems with default -Werror enabled found: slabinfo.c:1300:25: error: ignoring return value of 'chdir' declared with attribute 'warn_unused_result' [-Werror=unused-result]                          chdir("..");                          ^~~~~~~~~~~ page-types.c:397:35: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=format=]                          printf("%lu\t", mapcnt0);                                  ~~^     ~~~~~~~ .. Fix page-types by using PRIu64 for uint64_t prints and check in slabinfo for return code on chdir(".."). Signed-off-by: Wladislav Wiebe ---  tools/mm/page-types.c | 9 +++++----  tools/mm/slabinfo.c   | 3 ++-  2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c index 8d5595b6c59f8..69f00eab1b8c7 100644 --- a/tools/mm/page-types.c +++ b/tools/mm/page-types.c @@ -22,6 +22,7 @@  #include  #include  #include +#include  #include  #include  #include @@ -392,9 +393,9 @@ static void show_page_range(unsigned long voffset, unsigned long offset,          if (opt_file)              printf("%lx\t", voff);          if (opt_list_cgroup) -            printf("@%llu\t", (unsigned long long)cgroup0); +            printf("@%" PRIu64 "\t", cgroup0);          if (opt_list_mapcnt) -            printf("%lu\t", mapcnt0); +            printf("%" PRIu64 "\t", mapcnt0);          printf("%lx\t%lx\t%s\n",                  index, count, page_flag_name(flags0));      } @@ -420,9 +421,9 @@ static void show_page(unsigned long voffset, unsigned long offset,      if (opt_file)          printf("%lx\t", voffset);      if (opt_list_cgroup) -        printf("@%llu\t", (unsigned long long)cgroup); +        printf("@%" PRIu64 "\t", cgroup);      if (opt_list_mapcnt) -        printf("%lu\t", mapcnt); +        printf("%" PRIu64 "\t", mapcnt);        printf("%lx\t%s\n", offset, page_flag_name(flags));  } diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c index cfaeaea71042e..643fd9558e09a 100644 --- a/tools/mm/slabinfo.c +++ b/tools/mm/slabinfo.c @@ -1297,7 +1297,8 @@ static void read_slab_dir(void)              slab->cpu_partial_free = get_obj("cpu_partial_free");              slab->alloc_node_mismatch = get_obj("alloc_node_mismatch");              slab->deactivate_bypass = get_obj("deactivate_bypass"); -            chdir(".."); +            if (chdir("..")) +                fatal("Unable to chdir from slab ../%s\n", slab->name);              if (slab->name[0] == ':')                  alias_targets++;              slab++;