Message ID | 20230915154438.82931-4-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1238577vqi; Fri, 15 Sep 2023 11:21:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IED3vHfdcXoIOaKiHTvEQFN54Rq0agEvZL6i6dHSA841iTTGU+B9HYQK/R7yZm2UqzcfVPo X-Received: by 2002:a17:903:120c:b0:1c4:2641:7744 with SMTP id l12-20020a170903120c00b001c426417744mr2794268plh.25.1694802068708; Fri, 15 Sep 2023 11:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694802068; cv=none; d=google.com; s=arc-20160816; b=GzZHftZozfe72Wnzu/2MDNbWxuuEPFOgxqyaT3AjQBQnOb/DdZDGfjnWtznVedqfFI NOK4+VpssGNA/mnmVh0NxaKGg5L5qY3c1IJE1hDBnb0A2O8LpGsDcgh4o5HZDYsi6znc 6xgJX9usG2r/2wZCWQrSsgcjATzQWnYMdvwRa2cKyVG93CJcrP/biQZbgaS7mLLmrG99 T2qEb3zWZEV5mwSVOvyHSrnAIjE7sJPdHEyrHwjkdCeh53V91lXRqcptbQo1LLKqFfLZ PvtaaDoiK2JMq6PwXck/jD2+3HvLC6Xo4oeDn3QtNWpDJtwELNAbbQDRGCNtQE5b5Nwz VNlg== 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=fIIBT3at8yUz/wix8IGyhlDzrURZEye12q/xDsP41Jw=; fh=Oe5yk31AF04Qo65fz7tkP1GVCJnC7lCD9IuQIxFtXv8=; b=a6Ox3Ja7ATudsQRNcenZcNkE8NIWQKl3Nh2OEi5hWJNFuyt6gBYnHSOF/kH2gvLFIK RhojWhn6u7n/fsoCHSmC/nAYsQ7KXv8GpkTjvf9TBOPd+bIIIpfC+PWYq0d01IT9nVsh VQXUH+ccKc97CqFNT7RtXDubd+QSUqtpLtLtwji7/DozHezubaTw3oKAmLlJAGUFE8IT EDWrYrfIhhBtN2PBHptwFP8JRWEbUaoqB8j3LiU01Ab7jEnSe6w7LHB/nmHQblJ4Pamy M7fFInbGenVeUFoZnfgjaimTySW03BRT3OV1aOWM7wJ7J/1cMbr9vB8OXoqXJMats8kh tBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lfL1No7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t7-20020a1709027fc700b001b885fbe17dsi3703449plb.532.2023.09.15.11.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 11:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lfL1No7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id D1A928067B7C; Fri, 15 Sep 2023 08:45:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236319AbjIOPpa (ORCPT <rfc822;ruipengqi7@gmail.com> + 31 others); Fri, 15 Sep 2023 11:45:30 -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 <rfc822;linux-kernel@vger.kernel.org>); 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?= <ilpo.jarvinen@linux.intel.com> To: Reinette Chatre <reinette.chatre@intel.com>, Shuah Khan <shuah@kernel.org>, Shuah Khan <skhan@linuxfoundation.org>, linux-kselftest@vger.kernel.org, =?utf-8?q?Maciej_Wiecz=C3=B3r-Retman?= <maciej.wieczor-retman@intel.com> Cc: LKML <linux-kernel@vger.kernel.org>, Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>, stable@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:45:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777128774282068338 X-GMAIL-MSGID: 1777128774282068338 |
Series |
selftests/resctrl: Fixes to failing tests
|
|
Commit Message
Ilpo Järvinen
Sept. 15, 2023, 3:44 p.m. UTC
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 <ilpo.jarvinen@linux.intel.com>
Cc: <stable@vger.kernel.org>
---
tools/testing/selftests/resctrl/Makefile | 2 +-
tools/testing/selftests/resctrl/resctrl.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
Comments
Hi Ilpo, On 9/15/2023 8:44 AM, Ilpo Järvinen wrote: > Currently, _GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE nitpick: If you do submit a new version, could you please drop the "Currently". > 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 <ilpo.jarvinen@linux.intel.com> > Cc: <stable@vger.kernel.org> Thank you. Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reinette
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 <stdio.h>