Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2665270rdb; Fri, 22 Sep 2023 05:28:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiHrLBjXoqUcw04pibZaftEwQ5HGW7+qgOo+UPK2RrMdEk006iTEb16vWqGEQO44IJ04Zv X-Received: by 2002:a17:902:e848:b0:1b6:bced:1dc2 with SMTP id t8-20020a170902e84800b001b6bced1dc2mr9233047plg.0.1695385708761; Fri, 22 Sep 2023 05:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695385708; cv=none; d=google.com; s=arc-20160816; b=cI72lVG9RaXVjeld1MKq9qrjpCBELT21gbM0+TjWNdaQtf5UrqyGzleWjPuZ9mrDCc GcyFgtNotnkXXO4FUyhwxLBoZ8+fqp2pGr+JICSWgisnJinMympWe3VXP+JMTKaA0Xnd f4FUXvDJ7u7EN2bHoMjvMHZ6TQoQH/Ji7a+8NE//+5bEVXAxATpBfJBG43Hryj6yx7Xp OEZjnmh4bEfUBtWLBJNi2RaGTGT5akxRsN6/apHQ4feS9IiMi26gLaZOZ5b+9RwEVLRJ tEKJqiuKU0uU+KZ1ILntqMZh5hNE4e9Ghapws2xBC55FEn92eJcT3LvfDfyym4M03iTU c/Ww== 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=CIhjWNnajDWYuzBtFKoPL07kX8k/zgXizs7+EgMGZV8Ayv9+2MHQTMtqOe7xyzoR6+ iu5q5hQDNdE1LV/DTGgxq73v4ob0fu5koh6Rnvdb+VwmcTZVF5vbcmgjFhZtnD04WIye STkw4hPAjeMNtNNu3GsvlPGR3vyzDz0EvV1PMca8UrlYJDi41XCt0kcKb8lqkE0IHGRD T7WFZnhh1IzYzJrew4ULn9BY9FA3GlHgDUKGo68ZDqojPdG8QMzwwWwTU3K15PhcDuQE WleZ7QMp0FRPcxBpF+l5PBAjWtW3mjQGrjBiiBFIEiz/1Efe2+IVqFP4u68hxGIjvDBt 0brA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=To0Sf8hr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b10-20020a170902650a00b001b8b4330585si3590098plk.510.2023.09.22.05.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 05:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=To0Sf8hr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 18C15832DA57; Fri, 22 Sep 2023 02:08:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232904AbjIVJIA (ORCPT + 99 others); Fri, 22 Sep 2023 05:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232895AbjIVJHx (ORCPT ); Fri, 22 Sep 2023 05:07:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6CFCD5; Fri, 22 Sep 2023 02:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373665; x=1726909665; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w0rSpTX77wKswH6vd54/bHP7hpBLDH5K7yc41Vt6tdc=; b=To0Sf8hrdH/czv8Sxtzi9w12PM4OkJJRzREBuIMRYHcB5dKh2dpqfXYQ 7+oKhpQCMxvJH3R8ou5Zva4Xm1E5re9FRTHaOgZqZyeWwPj7vZRQ7JzGY aKqrVtPD+cI1ymSh0qXpy56CDiRKXqaJFluf0g0uSc4gHkRFsuMwMk9Mv SIxQ8fasMbGgz4NCgCoXFK9YCklviBqbs70uM11JE330jFdZ7vlwfSeGa F4qQeBMaKHxC0FSAlNBFth+BDGmTM8SFTiIdkzFqXRoUxgtveuSx/TPmY JEEBucZB+5dliMOmiGZR9fQBYgqIE9FSpp5+5V3yWsdez0rR7S4KKi0EZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070903" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070903" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 02:07:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663935" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663935" Received: from bmatwiej-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.8.2]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 02:07:38 -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 v3 6/8] selftests/kvm: Replace attribute with macro Date: Fri, 22 Sep 2023 11:06:42 +0200 Message-ID: <99d54721208ed4f9ef302905f7e7fea76e895865.1695373131.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=-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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Fri, 22 Sep 2023 02:08:01 -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. 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