Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp892762rdg; Fri, 13 Oct 2023 04:38:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIQ6Fgl0Iilua8Iq8hzyqQ99wta5L94LpK7l09+bTVYADsVxR/0EZ1AEB+ANcM1gqCNXRP X-Received: by 2002:a17:902:e80a:b0:1c3:9928:7b28 with SMTP id u10-20020a170902e80a00b001c399287b28mr33064914plg.6.1697197115760; Fri, 13 Oct 2023 04:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697197115; cv=none; d=google.com; s=arc-20160816; b=tyqJtvp/F5gaDzVTkMF1REYO4eCSWzikcu3TZ/49Sr8UeEdoMvu+vA7QK1Cmm9LkB0 58UFrTkIseBAyNCRUQmHQTaKVxMWP0e2Ot2rwiHKP+SQNgYRionbUDUcnVnO8KCTNqKv v5hX1bevZDDZx6dMFvuqQozvPcX4XaxD6gCySGnZhW9A4m1ktm4tpDj9efAt1WMyNKPV oXoeWaIwUVb9E1/jsswgLAhvsHMniOU1iiKg/kEnN/baibWZH/2OYQe4TPCHSU9I1Fqd v1YM4bXccax9UzLpTPUNVCGo3vtl5ystY3Uj79VaneESVbLeWUGwxjL0tEJhFWNB8SG1 5iwQ== 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=KNKf+6iBlI7pRmCUJ1OBUp/bgd3+Qb/S4MnA5jTB/NU=; fh=kGnTVGINCMm7xrDmqwX/qRTdf7Wq5odxYgzr5C4cFAk=; b=bmOz0lfno2Gkoq53LJpu8qKIXPkMgL/CSW9IJyfnLNvMrw2ZutyiOseJL5UZTANhMl 8Xn+uq6pCfqR49xtfJDA/Aa2qUEDkqqmXOjSyoMxPDreuSIiN+uBf1RqJcic4gE5lX6G ynoCGibPUbjbSM8yZ2scoVHDur4co0qP13QgHKG5e9EN09yIVK5cuOrtv+awq6FMXlk/ CSKATJTe2OR5qFSpJWNpcSNveu84Kw8sQISUa9RVAclhDSJMD45XWwGYp4/5ex0EcnVK 0NnhAtaBBnEIEd6hIqHrCzXpJtPycSho7VptX1q054CFESyy/LxutyLbDA3v+yxNGVow P+xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KeaW/zj8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h13-20020a170902f54d00b001b9e9edea43si4359162plf.552.2023.10.13.04.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KeaW/zj8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A3F8883F1CDC; Fri, 13 Oct 2023 04:38:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231354AbjJMLiO (ORCPT + 99 others); Fri, 13 Oct 2023 07:38:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbjJMLiB (ORCPT ); Fri, 13 Oct 2023 07:38:01 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 668B4D8; Fri, 13 Oct 2023 04:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697197080; x=1728733080; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ariT8CxKR/Cq66g3cxCDu1qA3Q2jySEnMOrVryK1YyE=; b=KeaW/zj8Fyo7JmVkJ9AJB/uUDUgXpt6pahieTmhUCpAwU6kbzE0MUpSC KO1e/M+4GiSy0ipHcD+gNCcfxdUiqQyi4rW9N5R47/Qrfqr/fdFZ5PRPm gCLtzzi3lDSkYyafYLqYUKyjThcaSugOFLhfqk8ftnw8RDGteSevz99ft Aun7ZmegWj4YQV4SdTe7kLetHa1+iMdjquuGD4rTueUPRNCyPfc5bICQp HhEB76Vg2U9RVenIrTsOrBwpxwcJKO+dt/LUBQtiVLo4D2iS+VnuxVMir ilGkMDAGkB0vzdk+u+tO3+uK09S6EtFKUvuHvUMkHV9QbCdjbJSsEAo/R A==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="449353365" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="449353365" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 04:38:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="754675817" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="754675817" Received: from bsankiew-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.0.114]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 04:37:56 -0700 From: Maciej Wieczor-Retman To: Andrew Morton , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 7/8] selftests/mm: Substitute attribute with a macro Date: Fri, 13 Oct 2023 13:36:31 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:38:29 -0700 (PDT) Compiling mm selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in remap_region(). Fix the wrong format specifier causing the warning. The mm selftest uses the printf attribute in its full form. Since the header file that uses it also includes kselftests.h it can use the macro defined there. Use __printf() included with kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman --- Changelog v6: - Add an explanation to the patch message on how the warning that the patch resolves was caught. (Shuah) Changelog v2: - Add this patch to the series. tools/testing/selftests/mm/mremap_test.c | 2 +- tools/testing/selftests/mm/pkey-helpers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5c3773de9f0f..1dbfcf6df255 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -338,7 +338,7 @@ static long long remap_region(struct config c, unsigned int threshold_mb, char c = (char) rand(); if (((char *) dest_addr)[i] != c) { - ksft_print_msg("Data after remap doesn't match at offset %d\n", + ksft_print_msg("Data after remap doesn't match at offset %llu\n", i); ksft_print_msg("Expected: %#x\t Got: %#x\n", c & 0xff, ((char *) dest_addr)[i] & 0xff); diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index 92f3be3dd8e5..1af3156a9db8 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -34,7 +34,7 @@ extern int test_nr; extern int iteration_nr; #ifdef __GNUC__ -__attribute__((format(printf, 1, 2))) +__printf(1, 2) #endif static inline void sigsafe_printf(const char *format, ...) { -- 2.42.0