From patchwork Fri Sep 29 11:20:36 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: 146541 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp4003681vqu; Fri, 29 Sep 2023 05:53:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmbh2+pF1JySN+2hzO8q6QIfP29Rj0tgZHy3N2TJt9jpV22+qWeZR44aMf+wPy/CA66Y9o X-Received: by 2002:a05:6a20:840d:b0:159:f884:4d6e with SMTP id c13-20020a056a20840d00b00159f8844d6emr4921419pzd.40.1695992009186; Fri, 29 Sep 2023 05:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695992009; cv=none; d=google.com; s=arc-20160816; b=BUbe/5cNBkRsglPjGovCZ5sAXPkrupKpE6UXu3s4uLhQpTAC9PBVFg49NuJAJbFbye n0u+CI4VvQo2y2HvWqK5NXm2XlFPE4zzE5REeiowuQkI7oMq6Ulwqu7FncEjL62ZVyOM YohuQdv0RULpWbGglFW/vvBz45dVfDrUVMApMW1/e9ZqcAe87F7IDvAVda2Jp6ZzoyLK Dlqgv3N+tF2UfyPooHr/seP6AHLb64gbXNsTHVipGoqfKBRomdcJFf4zZYL6+gr1oBP+ 2SpIUszZHziFvIT5wNhUtdIRcLdvgpW3NPJhR2qHswToJU2dN+nvrCyEZsnWBKMz3Yqh 1X4w== 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=GnO/lvc/kh/QYffXPKp9m3qqkSWAxHDrd542m6ZW9x0=; fh=0zBAjxShfumhVJgCQ7/PrZqZq2D8mhtAJK1GC38L6Jc=; b=TG3h+EhBY1hm2v7RZAeJFdko4NRtTz8DcvbQ/SiSEVI+ijTUUTRUVXjyOTr/z7cSYr i0KNOpjnut2TDqy6v2aM/nGzroUIDZU2XFPyp5Vc2JiuMV8EbY81+GrkTjmjJCaQXL31 hoYGCSdYV57b8ZfNu0yKh4IDu1ZYFkZZN6+8Dpqzz9uYmqDp7HGyIyAhsK9b6A1vP9DT pYkHsK/MSyA7LHNbhE7VMdaD8dNdpxkwtuTuW9kUGrrtngsYxxkgJqNEeyx9Ai2Io5gL 5gaIZ0M9y9WE/zIhD54wxeDNyZiF8OtMw9OgkoPLBZ+tovMoxg516kYs/X0WPHE4kHFh 6FIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ETcwrfXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i15-20020a170902c94f00b001c0c79b3869si23309161pla.578.2023.09.29.05.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 05:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ETcwrfXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 4717F802716A; Fri, 29 Sep 2023 04:22:21 -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 S233028AbjI2LVn (ORCPT + 20 others); Fri, 29 Sep 2023 07:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233069AbjI2LVi (ORCPT ); Fri, 29 Sep 2023 07:21:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E20CC9; Fri, 29 Sep 2023 04:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695986495; x=1727522495; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h2w4jLDwnHjcUapV1jkntv5pgIa6zmfErB3TZ/IGgk8=; b=ETcwrfXg5Flq/37uv/6yJy9+liesMKOctTIKQt19CJsocEro6WYXAZ5F VdFGnRKrdlhSsh4oM/VzV6nn/7UmcSXVciPCTMfUoD78KLJ+0QyTQCdIG ugTLlHSk/+3UKbhpK7kefhCivWHbvF0oQX+yrTZTUSGBDqCcVgnacApRH XKZmxDGyZvlI0qQ186rcdgBpz+FIYaV69W8bajm5iLfNtA2f/h80gi4RK uWSch31dluaRIAG5uTxy8GBjg24l8UlSjH30h6h4c/Olkc4QYZLMAJ6+f Ks5zct/qAiGElo2boWVgWkUirDG8Ckz1ipWf6/NdkCW4rwQ+8Z5hWIv02 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="361654988" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="361654988" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:21:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="996901511" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="996901511" Received: from valeks2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.53.242]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 04:21:30 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , =?utf-8?q?Maciej_Wiecz=C3=B3r-?= =?utf-8?q?Retman?= , Shaopeng Tan Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= Subject: [PATCH v3 4/7] selftests/resctrl: Move _GNU_SOURCE define into Makefile Date: Fri, 29 Sep 2023 14:20:36 +0300 Message-Id: <20230929112039.7488-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> References: <20230929112039.7488-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 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]); Fri, 29 Sep 2023 04:22:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778376516730223180 X-GMAIL-MSGID: 1778376516730223180 _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 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/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