From nobody Fri Dec 19 04:02:30 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E86BDE784B2 for ; Mon, 2 Oct 2023 09:49:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236260AbjJBJtL (ORCPT ); Mon, 2 Oct 2023 05:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236208AbjJBJtG (ORCPT ); Mon, 2 Oct 2023 05:49:06 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB0808E; Mon, 2 Oct 2023 02:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696240143; x=1727776143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h2w4jLDwnHjcUapV1jkntv5pgIa6zmfErB3TZ/IGgk8=; b=dvpec/0Hl2zo6uRGNXfo2EJOZpQCk1NpFhuG/O+7kFxR+p3D+bgPI/G2 yyLRU63/rmyjEwlOWmO3A7pTYMQScDllXrb3c8ikYqlPl8fFyToyqn27n 9LBibQQ2l7zu+jaAKMPJRhDJZ4ytK+wjsBB/CmYWqUUitOjDyfohx+aqI e1klEH1Xg3LueA29bm19oWYVU0rMne3K9iGUxCUnVdonUutgY+RPrQiz9 2Q5Ug6KgRNpoaZ5XGq7+xLHU0cOemf16mNUEPpQs+RfB/UJh9X6MyT0KM Vq2jlDyo58c6A9zpRg4PefyJH6QontK1yMZoP06oAlOYHCN91Fcc1HgOB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="381495416" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="381495416" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:49:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="820840348" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="820840348" Received: from aanantha-mobl.gar.corp.intel.com (HELO localhost) ([10.251.221.191]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:48:59 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , =?UTF-8?q?Maciej=20Wiecz=C3=B3r-Retman?= , Shaopeng Tan Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v4 4/7] selftests/resctrl: Move _GNU_SOURCE define into Makefile Date: Mon, 2 Oct 2023 12:48:10 +0300 Message-Id: <20231002094813.6633-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231002094813.6633-1-ilpo.jarvinen@linux.intel.com> References: <20231002094813.6633-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org _GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE has a large impact on what gets defined when including headers either before or after it. This can result in compile failures if .c file decides to include a standard header file before resctrl.h. It is safer to define _GNU_SOURCE in Makefile so it is always defined regardless of in which order includes are done. Signed-off-by: Ilpo J=C3=A4rvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: --- tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/resctrl/resctrl.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selft= ests/resctrl/Makefile index 5073dbc96125..2deac2031de9 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 =20 -CFLAGS =3D -g -Wall -O2 -D_FORTIFY_SOURCE=3D2 +CFLAGS =3D -g -Wall -O2 -D_FORTIFY_SOURCE=3D2 -D_GNU_SOURCE CFLAGS +=3D $(KHDR_INCLUDES) =20 TEST_GEN_PROGS :=3D resctrl_tests diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/self= tests/resctrl/resctrl.h index dd07463cdf48..d9b5df95849d 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -1,5 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE #ifndef RESCTRL_H #define RESCTRL_H #include --=20 2.30.2