Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp655705rdg; Wed, 11 Oct 2023 01:26:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGE3t16pr4BA+d3PX+O+85Naw00eQHVglecUSDbrk4yXChd3ylDWEHH82hV2mPjjrp4HQ12 X-Received: by 2002:a05:6a00:1ac6:b0:690:2818:a4ce with SMTP id f6-20020a056a001ac600b006902818a4cemr27641205pfv.7.1697012796556; Wed, 11 Oct 2023 01:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697012796; cv=none; d=google.com; s=arc-20160816; b=RFpNNJBV+2V1SJzCQRNIkO4xaXL1u3FY1mf13eWZANDf/K/gk/j77PnPpwM/zBigvD xRsjd6VU5h+TQDn/3tz7IUfUdN9NcLvLlSQ5XW2DUs12E/t4AuPgs1HdNrwKr4SGONgG LNcECwHJoLCi5PAUFAQw2H+OZ/ZGRsUJtv0oBTPLlEG/He8ECP95saO2GHO51xSQB6gp 2KCdaFrw5GLGTvY4p1iLJlzRAFEcpSnxr6C5FREuhPRVxgaUpWsvMKBxMtxKGYhjOl6g aTcxPXKl307XAsU/gDyZzHsw9R9zHYEwuunbIGMM2t6TJvOG8obPzJEGqrv+cKapuz3L gX4g== 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=iAvGwgd/Q87vBtsypepBzmUVv9cFMcZESwh6WeaBETc=; fh=ihfoGhcnE4iklVQey8DmFcTle2KOxxNwa0O80+GJRlo=; b=vkNNb20QJ1WUK36W5Qylwu8gWW/c748kf/Jfhp4yM/F/+GTh31pPWtot2v+I8jdPmN C2nQbXPyZouUOw5L9axjY9FqDaWja0qXOG2kX9GQLibj9LTpwuOWDIC66M6DnAhSc4gk f35BQHhPJVFFlTCpE29QcgeksPIzuVbxiiDbUfL90xtcm8qFmyfOzqhPACQZsZ8oBTEX 1P89dBYYNynZm5ed3/pDih/evxAegSCo4HSJ+E4Q7glI0302ZfJHi+1ULS4EPEdFQNFu i6MjrtgA91C8N6llPwiWCqQCjLmjPwzvhaccZqZCq/IFzHg0EVgW4uKBgQdGHgHDl42f LuWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ESeywBeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y3-20020a056a00180300b0068fe0f46f27si12236021pfa.171.2023.10.11.01.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:26:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ESeywBeH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 425718087262; Wed, 11 Oct 2023 01:25:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345404AbjJKIZG (ORCPT + 99 others); Wed, 11 Oct 2023 04:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjJKIZE (ORCPT ); Wed, 11 Oct 2023 04:25:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9EA69E; Wed, 11 Oct 2023 01:25: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=1697012701; x=1728548701; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w0rSpTX77wKswH6vd54/bHP7hpBLDH5K7yc41Vt6tdc=; b=ESeywBeHDuJOHIgbLifPUxVooB/BocWj/67TGLjOdAkea9icBDuUBVZY p9UkyHd2tmIHjJJNrGRZa8O0/HReTFS5GrCvYi81tZWeDs5laaG3QBpBI mSr63Lk0Djgw9o9sJ4hSaDm4NmlOMK8PNQYgG+wVzvIz6tNMB3p86PL0c z82eKf9A9lCrBwHNNzW5oY55RwIweOxUJR7XC04Av4DSzVPvMYwxE6DhY 6+MJM3RP0Uv/MtIjfrM2/qnoMgwrd3K1DbBGgbjdrHA0JK+WiaEKBiyxt zRciq2W4VRzpBoMaW01N0QSrTJtLWclEPnOGbLxApEkw0K6VFIBJYhPNF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="3200857" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="3200857" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:25:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="730411725" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="730411725" Received: from bmatwiej-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.17.119]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:24:57 -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 v5 6/8] selftests/kvm: Replace attribute with macro Date: Wed, 11 Oct 2023 10:24:02 +0200 Message-ID: <539c482b506bee15242e12d308ecf722bc5a7de8.1697012398.git.maciej.wieczor-retman@intel.com> 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=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 01:25:22 -0700 (PDT) X-Spam-Level: ** 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. Use __printf() from kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman --- 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