From patchwork Fri Sep 15 15:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 723797 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 46AB8EED616 for ; Fri, 15 Sep 2023 15:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236156AbjIOPpQ (ORCPT ); Fri, 15 Sep 2023 11:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236313AbjIOPpG (ORCPT ); Fri, 15 Sep 2023 11:45:06 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2768BF3; Fri, 15 Sep 2023 08:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694792701; x=1726328701; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1VrjDLRK9ilo+mpcwT7YEZEofj9q92dtdWBmOI0btQw=; b=lfL1No7npdSscFhKKk3hoxUSBLjXTICD1Pz8rtl134orJn/OtDnUA4dX sREROO7Weuc03Qucpf+j8+CeHRKgQAOr0eXCXJvlkooj63/uxWmTWzxM3 Sxv/NOFqOsNXhzwxTiAHvA0NXpsnsEXA7PCDW0vON/sZl6PZvKCGgnFHx ggDxs+lWPUKfIZrvCAm5LE9yzn102oMi1ui1CiecaZZ4s++jcNffaJYSF kqHzabPnFLKVEFTbAfX0m5aaC2c9zZlO1hQrbNjUIIDGUqXA7xWr8/FKy esNX23Gc8rx3BPJLPHdz6gpNEWzMihlJVBopWAQP2976hJ5F9FzTKysI4 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="410217313" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="410217313" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 08:45:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="991878645" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="991878645" Received: from srdoo-mobl1.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.38.99]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 08:44:58 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Reinette Chatre , Shuah Khan , Shuah Khan , linux-kselftest@vger.kernel.org, =?utf-8?q?Maciej_Wiecz=C3=B3r-Retman?= Cc: LKML , Shaopeng Tan , stable@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 3/6] selftests/resctrl: Move _GNU_SOURCE define into Makefile Date: Fri, 15 Sep 2023 18:44:35 +0300 Message-Id: <20230915154438.82931-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230915154438.82931-1-ilpo.jarvinen@linux.intel.com> References: <20230915154438.82931-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Currently, _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ärvinen Cc: Reviewed-by: Reinette Chatre --- 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/selftests/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 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/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