Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp892756rdg; Fri, 13 Oct 2023 04:38:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBJZllp0o+pNrtL9OyVkpcnIHna5GVtIfurxEb4RYK/0hXNZ3TzR7wx2PmehjHIfsoO1u5 X-Received: by 2002:a05:6a21:7795:b0:171:8e16:ea86 with SMTP id bd21-20020a056a21779500b001718e16ea86mr10291710pzc.31.1697197115208; 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=HUx6X8o6QOvGuT4R1TiQBj7nWAaYJJ68NVbZdqFV2Rmg44vTE2fg8VqfD+qkneSGqQ f6IUe4GOvUtl+l+XuxScFUUjRkxxJ+VUzU8652zo+RaCcOuyXi6zDQSe3y7Apk7oWZkL ++IKDgGyT7fWn956t8AA/IUGpVU4xmufGKhdpnV8whaKpKtZkvlZzzic54+d+Xr11/iS VJNpFLHQouteeBtQnW8O0nmnX02PWQvQZtjejUH44J0EZdg0siIbwBJNlKhHNawNXTsN 7ZTrPhlmVdOHsEEbFWs4kzaJ3StnqnFM4rT6T4UR5nrrSNkFROYzdu7fDCj92yAvRKSK S60w== 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=qBJ1yMt6amNE58dky7qcH9FNHj/WgtVm/PustOyFx+g=; fh=ihfoGhcnE4iklVQey8DmFcTle2KOxxNwa0O80+GJRlo=; b=ADrhIXE5BYiKcom7osi807iywamN2mm2HpFT2f6vGfnDDZwN1LhKLGX6MyqvNgR1Jt uN/Skj/Y1NVGvGa2z2d79u4FT1nzCWvNLe4wiTPuiCPfAfYM7UehdJShxrtx5uGY/qAc gSD+fhTj1ebbJAIkNSsxPf6PPqiIyA4U1F3vSv4S8jgi+KGU01xr+KIIKwHuVSiN+uU7 msD124BVNYfZydEvWcdnzgM5PKtyOFF4H93cEVD2/9prCYjgjgTew72snMQmaKiPOJy4 2z8dWj7UuTvFSXfjAhTeUE/OuLC6a/oWf+esWTl6WSva46jCkXtOHUCTonV7FHXgg/Jb 1KVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bi4gxo6u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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. [23.128.96.38]) by mx.google.com with ESMTPS id b2-20020a170902ed0200b001c9de56a7d4si3781205pld.398.2023.10.13.04.38.34 (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 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Bi4gxo6u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 7EA52839FC79; 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 S231293AbjJMLiK (ORCPT + 99 others); Fri, 13 Oct 2023 07:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjJMLh6 (ORCPT ); Fri, 13 Oct 2023 07:37:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 852A3FC; Fri, 13 Oct 2023 04:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697197075; x=1728733075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m/gVC9ZBcqpamFqERfM3Iy1qjZmLaNjWknhhTFyG1+Q=; b=Bi4gxo6ujiWMQOyhQn/CzdQjnIf2WW0k/v9OfHe4xnd/GjbiUhcMZRp0 DU8fX29ymcObL8jlH9MQFqn4H467QjqfXVC2hWXYG7HRMbsN+ga9/5+qc iUMM/eGQkGBhd3EKRLKhzoaEg7UFnDZT/odqHSdrLAAK90sdlsDpPKQkV WxTTx4tUItDeb97e5z5i+KLU2FwADyEpKdOF2fRl7aCQkb6/F9tbD2tS7 rlr2JIxN4E/Ay8Vif7e3CEAGTcouiCh/lJfrXJ5NqZYraCEx4ixTEa87V L9c6uCKnO9PdFjr2rp0Leaxv62ThvMzO2wEom4Eppq2fEb9Jc9z39aI0Z Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="449353353" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="449353353" 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:37:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="754675807" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="754675807" 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:51 -0700 From: Maciej Wieczor-Retman To: Paolo Bonzini , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 6/8] selftests/kvm: Replace attribute with macro Date: Fri, 13 Oct 2023 13:36:30 +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) The __printf() macro is used in many tools in the linux kernel to validate the format specifiers in functions that use printf. The kvm selftest uses it without putting it in a macro definition while it also imports the kselftests.h header where the macro attribute is defined. Use __printf() from kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman --- Changelog v6: - Make the motivation behind the patch more explicit in the patch message. Changelog v2: - Reword patch message. - Use __printf() on test_assert(). tools/testing/selftests/kvm/include/test_util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index 7e614adc6cf4..8e5f413a593d 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -33,7 +33,7 @@ static inline int _no_printf(const char *format, ...) { return 0; } #define pr_info(...) _no_printf(__VA_ARGS__) #endif -void print_skip(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +void __printf(1, 2) print_skip(const char *fmt, ...); #define __TEST_REQUIRE(f, fmt, ...) \ do { \ if (!(f)) \ @@ -46,9 +46,9 @@ ssize_t test_write(int fd, const void *buf, size_t count); ssize_t test_read(int fd, void *buf, size_t count); int test_seq_read(const char *path, char **bufp, size_t *sizep); -void test_assert(bool exp, const char *exp_str, - const char *file, unsigned int line, const char *fmt, ...) - __attribute__((format(printf, 5, 6))); +void __printf(5, 6) test_assert(bool exp, const char *exp_str, + const char *file, unsigned int line, + const char *fmt, ...); #define TEST_ASSERT(e, fmt, ...) \ test_assert((e), #e, __FILE__, __LINE__, fmt, ##__VA_ARGS__) -- 2.42.0