From patchwork Tue May 7 21:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657821 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FFE413C3D9 for ; Tue, 7 May 2024 21:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118299; cv=none; b=q5N/BLqTtowU1DhEgHTbUgVt6vy5iEKgMG7+TBLC2ZfqgDnJ5w51fQMuZOKU4Ot4LbzpEbJRrfQyO8RPz1jHeAhMMlcPO3XLau+YiigOoQG+cJV7uhchax7QePqjXYTQQYcGn967tAh2M9s75r9uLB17+q4e/0NyJHPlwqnjyR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118299; c=relaxed/simple; bh=uNS5SgTdf5Lqki4ZbkJSsqctuLHtwyYyPdiI8DfFaoc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qSGnym9TrfInM00w9bRHVfUhhEH+6Rac+2fX5owHvh1gCo1c+hr/zpf9VoVF0K2iRcLadZv/5wMi7HRvLSYEMYdMEik3bcgk6IAF6CmMyXJc9YhkLbPJR+HCPgUO/kFiapBTY/R1qtc6g4HRPxatw9gXRf4D+nZLnsIGwomaZxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=b25Je7L2; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="b25Je7L2" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-61bea0ca5e2so66669437b3.2 for ; Tue, 07 May 2024 14:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118296; x=1715723096; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; b=b25Je7L2Quzfv3n/I6HkRWZWcA/958eViIpE7eBFiZOQIEdBVFejtYX6J7JOcIj8GQ W32hZpavJhwVOJcxeSFosJx/Ov0MC7KMyzdIV7Ahu3E1dPNZRHIfxOmzzxb2qX4yDXSf g6TzlrTztE7gJwArtUsIdKTACHu5VfSQQ0A6u+D+1SiRNKf08pufhYA0sXNA3/qXedNM TFtW2e+lLCtgIhQMT9C7oWxlGCFN8tpQdWpvapchtmLGdk4HJgZkIzZiWlmAapXiFahC MEP3eSgvRLnClvgynwYzfsSPzqg6hs7iP4WWY4O7v7a+RgETr2XXajQ9RUjo6NWc/nzY 72AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118296; x=1715723096; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FLG6gbZomB6DmPXjYL98l5fNcPQGk+fw1rCWyau0VTc=; b=eUQuDSNp1oXRI4xH3UDkMX7iw+wwhQhqLM8VaRAkFeaa3eScYrB+ZT+mYwxCd/vUbH 7s3NHzrpuJnzB88nelcCRWfIRb9BCtYfYoKIdbG0bAw4nGCPMk3mN+SPliQg6eYYsiEd 16R323jPLzYOXOSaDHiuFrGm16H7J4hhWMGJDg+v78MTDRULNo1Ac9y3YPOfA0F4AVU0 djRHJG3g1D7ZIwlC/XhuEEuSuxpZRjO7KiijdwV4w48kUqN6hOXSQ6x9AWZu9furBIzx d4D945g/dHs7UTXYvcIHe2ctIvTdGaGwHKU16W3dM+vg4vPpJ8/u2Bm/ROr1DcjZgTFy ebsg== X-Forwarded-Encrypted: i=1; AJvYcCW4PTXf6/vgdq3dqxvWCMw2XS/EfwckR38x7+yr2TGGKqty2r/niyrn0xhvi4blC8Y5INrhDfGQ24Gd849JAXG1Dedlxes1DIsKrfc856qA X-Gm-Message-State: AOJu0YyditypTV2ltCiztOFOFR1qL+2tV1G9MsJZ6iwJZS/xIdf6nTkx ChEciQ9xTyEpqCqAAtlV4lke4z0ofQibadfc1jvhByllOk3T4mKfQ8ngn8MRTHEUmRankUQITei IWQ== X-Google-Smtp-Source: AGHT+IFDRufPRd20hhB8IsmwhuIIZ1gDaiY3aRkAgAGU63hP6Y69UhIvyGPjEABNQz9R7M3kyPQJ53ZX+tk= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a81:a189:0:b0:61d:4701:5e65 with SMTP id 00721157ae682-62085c5c5fbmr2405797b3.2.1715118295730; Tue, 07 May 2024 14:44:55 -0700 (PDT) Date: Tue, 7 May 2024 21:38:26 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-2-edliaw@google.com> Subject: [PATCH v2 1/5] selftests: Compile kselftest headers with -D_GNU_SOURCE From: Edward Liaw To: shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , " =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= " , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , " =?utf-8?q?Andreas_F=C3=A4rber?= " , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Muhammad Usama Anjum , Edward Liaw Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org, kernel test robot Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a central location. 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler. Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Reviewed-by: Mark Brown Reviewed-by: John Hubbard --- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/lib.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index e1504833654d..ed012a7f0786 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -161,11 +161,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index d98702b6955d..b2a1b6343896 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -51,7 +51,7 @@ #define __KSELFTEST_HARNESS_H #ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined"); #endif #include #include diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index da2cade3bab0..2503dc732b4d 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -45,7 +45,7 @@ selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST)))) top_srcdir = $(selfdir)/../../.. ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # The following are built by lib.mk common compile rules. From patchwork Tue May 7 21:38:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657822 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A16C78B4C for ; Tue, 7 May 2024 21:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118339; cv=none; b=qkvKKR9t6OmQbQjyKlg0dMwTkBzqgtnwczwow9AxIzaoySphHOhkZFt4IQbfWQrP2uo//xd4oX6d3ZcF5HDOh6PWy9sSScuj+VezMpQlZHC/+bBFtDgyoTj+vkY8oScki0S2lmNl4eInlrXYieLmb75jp7kCLFO3e/nqkzsuZKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118339; c=relaxed/simple; bh=u1WhBmcckAt2rdhPGlHMEW1L6rz0lHqek1WxWKv+Lpk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qRHQhLmFsgId3RZjMXlZz122JC5AVZ/BuN+XlCJAoqr9yzI86kRwENgrM1JE+GC3UbME3jLQKNq7LWvh3D8En8lZiWhe8HfGU+hGv4nSI27GAC9VL+WNl/6fMkKLV5L87d1P9oOR5i4wEkte6Pvj8pZg4ADmc+0esSVxuwSYDjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EAOb0VTr; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EAOb0VTr" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61bd64c9eadso64757917b3.3 for ; Tue, 07 May 2024 14:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118336; x=1715723136; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PxqkolGdAHnL6PdsZ65UERLJRMYbiNDsN8K6maFf6SM=; b=EAOb0VTrPa0tgInHil+vnvBckQGZucDqfwvtGJfDLsKxwUt6aDMz9FzfrLNEiKUiWx A82FDY5UaQ3tDdNFRZxcjHUsG41rlv92k4eKKpZYWkYoWQsOO/xh7oRNXBkIT7COUfwN Wqiu85thMq9c2nhmYYFmQ7jwvh0zx8Vn1B+Vxb88WGBqDtCl5BDXOnxGVrZlODe0VFnh HnjqSQ3H5IkMdC+93OwNMVM52Pfid1yMsQyVoJjGrPgHTZgsDcH9TN39O1Xst2WX10ZQ c15OvAuaaV6COMyBPjRJyQ1xTAusna1000y7vafImuBeX/te9uk9Q0HIehMo19kbpOTI y5rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118336; x=1715723136; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PxqkolGdAHnL6PdsZ65UERLJRMYbiNDsN8K6maFf6SM=; b=D9lrWkrzYbTPpPpQGbH6RFRyO1rzo6YOBNWmtgTccDVw5SujQ6Y6stfKWncgcZfapQ Tf1mCbSNHlseiRRYweiRdnVSs2NunSuK9G0dWz6P8lS4vBhI/2GaMd4qRw9BAuUtsIMn BGD22ngtMMvoq6DR/sNC/3hTKH9cQ/jN4JSC18l93vzmyB/Kn5u2MH/pjJy9xBSAEPWh +90MV4KO7Qe79tGLjG9Wv+C02NivAJdtsNhyPEG8IlzKZjK0FssIKHNwu6/gZY49LaoK Fd+iC/SVCs388OGnbv3cwL5gUxd3VJg/ZRtjHfp6vuvNkpMujZiB1QuZwRIT1Zw8GLm2 jZew== X-Forwarded-Encrypted: i=1; AJvYcCVIM8nRgafjRsuYH9ov5MLi2iBC5VXdDIBevKsDmtIMhWET+Wyy2bSnQnZ/olImFnuAXbxS7Y3rG92vdlU99JrYiwMNqKG4Y04LCAVLcCc1 X-Gm-Message-State: AOJu0Yy3e0x2PS+N/VjA9+6lu5tjussky4YIVUBGKAW38MawXHMKnEYo X7j1T4avFJuM3qbxutw23rqnVZlpBF9XqZieL4NlF3B794EjoFIl3p4W2PO6E8C8CCJnMe044ww 7mg== X-Google-Smtp-Source: AGHT+IGJgoOMG1JaBSE0UtHVyyig8KidzCIEzcvbINCcSvOASMpuIMj9uEKB71a44HvjahOWnOHiagC8tKE= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:6902:1007:b0:deb:8bc5:eb5b with SMTP id 3f1490d57ef6-debb9d87cd3mr271839276.5.1715118336096; Tue, 07 May 2024 14:45:36 -0700 (PDT) Date: Tue, 7 May 2024 21:38:27 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-3-edliaw@google.com> Subject: [PATCH v2 2/5] selftests/sgx: Include KHDR_INCLUDES in Makefile From: Edward Liaw To: shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , " =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= " , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , " =?utf-8?q?Andreas_F=C3=A4rber?= " , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Muhammad Usama Anjum , Edward Liaw Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org, kernel test robot Add KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE). Also, remove redefinitions of _GNU_SOURCE in the source code. Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Acked-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Reviewed-by: John Hubbard --- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile index 867f88ce2570..26ea30fae23c 100644 --- a/tools/testing/selftests/sgx/Makefile +++ b/tools/testing/selftests/sgx/Makefile @@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES) diff --git a/tools/testing/selftests/sgx/sigstruct.c b/tools/testing/selftests/sgx/sigstruct.c index d73b29becf5b..200034a0fee5 100644 --- a/tools/testing/selftests/sgx/sigstruct.c +++ b/tools/testing/selftests/sgx/sigstruct.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2016-20 Intel Corporation. */ -#define _GNU_SOURCE #include #include #include From patchwork Tue May 7 21:38:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657857 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0050813C3D9 for ; Tue, 7 May 2024 21:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118381; cv=none; b=iH5j7VkFJv+UwBsbT8h3ztSRjbyWB1uTffne/J+pT0IBxxxZgysQIEGCiy/aotS+T+v5rxqrdrlUA+kxXVSRDEy2Im9Bk1UjFUqs8LNWVT5VxDPUfFOT+HXyuT8uXBOF3Kz4FXQmQSbDM4nG46mQ94RCGcBRsvSWh7jEd15i06E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118381; c=relaxed/simple; bh=GVSC37q+WVUBvHotgiC9ngmMYaMRXiMQyXyyILui2QY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ADTHq6z72M+skfbdTf2UX6YdoU854Q+FfP3MCmdIeat8RqHswA2IPdQIapYS6rwrJQAM0pyFiUJc7uKUCYAZ6oOa5hZ9bnQodYCJ7CKDmr0jo4wLWftXHxggfiWQ3w6xqaGoSyHZQO20N5OkT4g7pyS0XJCU2dyqxEtdYW5JLxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qbCt4CZ+; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qbCt4CZ+" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2b2738ce656so3054902a91.0 for ; Tue, 07 May 2024 14:46:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118377; x=1715723177; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DviObgEc5the5KsTWi1wuA8Jrbq5crnmfaITqe27r7c=; b=qbCt4CZ+bklyFSSW9hAZzEVD2hb+vUYovoFB6mo9TyF0prG9XbU9PPK5EhkJkasbra mYel77QzyGlU5cP+fICfhmbZ0eZ1b2mAFWOjxJyiv+cGqMoJ9Zjgqd3l6wUsfbVtxSjm SMRu6XHE2DIcc65kRWrRKaNRHK/V0ySJvCP7Mux2gcnpg+Lie7ckHLVZaO5cMU2oHDLr uFh6VIstiCfI/MwNref+XdABr0ZP69AFzsvI2A3rk0+E+QjVRMgEOFDCS9vI/fxFkoqk Tsh3Zs6tHNtCH+2ejoIrStJx722szFv09p4JIyryIzZyy9xbJJEAVR/SM7Cv+itpwoZm nFdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118377; x=1715723177; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DviObgEc5the5KsTWi1wuA8Jrbq5crnmfaITqe27r7c=; b=YFiBCXWaYKT+fkEdMAk1N83tqhKSIENLAr9UDt8DOs0zK65oXxyqD04eIqgoiKKGXl X2GG0LYVu/xIElEhwqmT8h9WJUIqAuI7SlekKHhyIY2nbccliPMm1Ru3Rww6FeElt1Co YwoasVH3SXBM0qfrgFW5/DqDoAn2+aNqu+apbQIo+MA4x5rMrhoKc0cP+9ApTLEyoUIL B2Tu3nbkhWLu91iU+OWczQq9KnQfGYOH8KKvW6rz1kwEEXzMhCyxr3x1hnypiWP3AP7x GeWysBmHmJc2iq3e5mCjPYUJ6VRdUX3rjIvD/fbxx2FAD76VUL1cbgy/4za082SPjTCA IwHw== X-Forwarded-Encrypted: i=1; AJvYcCWURrPs7kAftbcMSdfuPTkTxeGdu3YC5EI9kJW9LpEZCtHzaYAZcFv0t6w3LYbkNX+IQw0QmpvAV1Q77SuUI/dfyDIpmJEEMqnxx09kLrHS X-Gm-Message-State: AOJu0YyoAuP14KO2/KD/Mml8yD2Ay8ak0YHQBssBo0nWOagzd0hKUoap 0mzWU19/I5OobDbIaMvIQF1EUfuTegsj6Eu0dsLa8EMb5DQsUGOcveu7ABLPHzBuM/X+FRc60U2 cZQ== X-Google-Smtp-Source: AGHT+IEulH29x3uOVFbknFwsLl4WcM9naThMz9i2Ajy3QsMZqnbNUGap0hB8s9HU3OrwMNMNVbdGuRXxZUs= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a17:90a:5913:b0:29b:c2b7:7d29 with SMTP id 98e67ed59e1d1-2b616ad9f91mr3776a91.9.1715118376985; Tue, 07 May 2024 14:46:16 -0700 (PDT) Date: Tue, 7 May 2024 21:38:28 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-4-edliaw@google.com> Subject: [PATCH v2 3/5] selftests: Include KHDR_INCLUDES in Makefile From: Edward Liaw To: shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , " =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= " , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , " =?utf-8?q?Andreas_F=C3=A4rber?= " , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Muhammad Usama Anjum , Edward Liaw Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org Add KHDR_INCLUDES to CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE). Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") Signed-off-by: Edward Liaw Reviewed-by: Jarkko Sakkinen Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/alsa/Makefile | 2 +- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/exec/Makefile | 2 +- tools/testing/selftests/filesystems/overlayfs/Makefile | 2 +- tools/testing/selftests/hid/Makefile | 2 +- tools/testing/selftests/nci/Makefile | 2 +- tools/testing/selftests/prctl/Makefile | 2 ++ tools/testing/selftests/proc/Makefile | 2 +- tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rtc/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile index 5af9ba8a4645..9a0ef194522c 100644 --- a/tools/testing/selftests/alsa/Makefile +++ b/tools/testing/selftests/alsa/Makefile @@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa) ifeq ($(LDLIBS),) LDLIBS += -lasound endif -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./ +CFLAGS += $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ LDLIBS+=-lpthread diff --git a/tools/testing/selftests/arm64/signal/Makefile b/tools/testing/selftests/arm64/signal/Makefile index 8f5febaf1a9a..ae682ade615d 100644 --- a/tools/testing/selftests/arm64/signal/Makefile +++ b/tools/testing/selftests/arm64/signal/Makefile @@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS)) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index fb4472ddffd8..15e78ec7c55e 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regular diff --git a/tools/testing/selftests/filesystems/overlayfs/Makefile b/tools/testing/selftests/filesystems/overlayfs/Makefile index 56b2b48a765b..6c29c963c7a8 100644 --- a/tools/testing/selftests/filesystems/overlayfs/Makefile +++ b/tools/testing/selftests/filesystems/overlayfs/Makefile @@ -2,6 +2,6 @@ TEST_GEN_PROGS := dev_in_maps -CFLAGS := -Wall -Werror +CFLAGS := -Wall -Werror $(KHDR_INCLUDES) include ../../lib.mk diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile index 2b5ea18bde38..0661b34488ef 100644 --- a/tools/testing/selftests/hid/Makefile +++ b/tools/testing/selftests/hid/Makefile @@ -21,7 +21,7 @@ CXX ?= $(CROSS_COMPILE)g++ HOSTPKG_CONFIG := pkg-config -CFLAGS += -g -O0 -rdynamic -Wall -Werror -I$(OUTPUT) +CFLAGS += -g -O0 -rdynamic -Wall -Werror $(KHDR_INCLUDES) -I$(OUTPUT) CFLAGS += -I$(OUTPUT)/tools/include LDLIBS += -lelf -lz -lrt -lpthread diff --git a/tools/testing/selftests/nci/Makefile b/tools/testing/selftests/nci/Makefile index 47669a1d6a59..bbc5b8ec3b17 100644 --- a/tools/testing/selftests/nci/Makefile +++ b/tools/testing/selftests/nci/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -Wl,-no-as-needed -Wall +CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDFLAGS += -lpthread TEST_GEN_PROGS := nci_dev diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile index 01dc90fbb509..1a0aefec9d6f 100644 --- a/tools/testing/selftests/prctl/Makefile +++ b/tools/testing/selftests/prctl/Makefile @@ -6,6 +6,8 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ disable-tsc-test set-anon-vma-name-test set-process-name + +CFLAGS += $(KHDR_INCLUDES) all: $(TEST_PROGS) include ../lib.mk diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile index cd95369254c0..9596014c10a0 100644 --- a/tools/testing/selftests/proc/Makefile +++ b/tools/testing/selftests/proc/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) LDFLAGS += -pthread TEST_GEN_PROGS := diff --git a/tools/testing/selftests/riscv/mm/Makefile b/tools/testing/selftests/riscv/mm/Makefile index c333263f2b27..715a21241113 100644 --- a/tools/testing/selftests/riscv/mm/Makefile +++ b/tools/testing/selftests/riscv/mm/Makefile @@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += $(KHDR_INCLUDES) -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomup diff --git a/tools/testing/selftests/rtc/Makefile b/tools/testing/selftests/rtc/Makefile index 55198ecc04db..654f9d58da3c 100644 --- a/tools/testing/selftests/rtc/Makefile +++ b/tools/testing/selftests/rtc/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS += -O3 -Wl,-no-as-needed -Wall +CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm TEST_GEN_PROGS = rtctest diff --git a/tools/testing/selftests/tmpfs/Makefile b/tools/testing/selftests/tmpfs/Makefile index aa11ccc92e5b..bcdc1bb6d2e6 100644 --- a/tools/testing/selftests/tmpfs/Makefile +++ b/tools/testing/selftests/tmpfs/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE +CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile From patchwork Tue May 7 21:38:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657858 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9E7178B4C for ; Tue, 7 May 2024 21:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118426; cv=none; b=uiN/aE9QvOguceinYYRZype9rRDDqqD+vyVnJgI94S5wQ5ZGdAh4rwM72yUhXcIA0bEym/7pQk6nyA8PKLw986rtV59H0x8wxHW/Ek3+z3W/M+mY8QTGcLJsWi4Fh/t8MG6+efxZ8Mtu7E6JcGBmSMK1qHeJ7jQZVg6+ZFE68d8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118426; c=relaxed/simple; bh=6wd9XXKp/F9+RN97/iVEpqg8IvPBR45oIGddQ5vgYTE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OlZz5BqXITXzLqKwCLvW1uPkR/egtQ72bSnFvQdPrH5u9xMkKz1IRgZ6EMdglOcRXLMRtXAQfL17S/kt60JZNaDTQ2Nh89q9te8QzM+9rRRtbQ8YkHtgwtJ96TVBQX6a2t6U2JyS1bLZAy5OD7TwzR25mTpQ16Vp3y5BqUw3o8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rjB54Yo6; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rjB54Yo6" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-61c943c18a8so3729384a12.0 for ; Tue, 07 May 2024 14:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118416; x=1715723216; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=fwixclVc/MIdLnDhs1my7rEF5JQ1jn9lRG5Ys2em8yU=; b=rjB54Yo6SQDBQOU0wYB8PEihPHaMokJuZYEffjiAIyELS3r0Lu8ilV8Lgmk0rlItxt SFGZBXl6oPKHdgANeorPMj6uUPRryeWgf1+bhbZqGgzNn0EEC2mN4z1u1iUPnr+9+S7j iCbWYDQQLdUONXmOZA9LqJXquXdL0fv1K+6sJTtMP6ExTxlG78Z5OzpcckYgWMnrcdZk H2owd7Nkp1WQ9pXVqzJEIJEpFrHvEYZoimHbyxmGWJnO/agDy+dwLR1aMmGcwbM0V0w9 XdVELfOvL+7+yGO2iyBFiLtIZk/xmBPzIgBvPplMhilHU/0V3mS/RlrQcUVJdvHHOOrJ sL3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118416; x=1715723216; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=fwixclVc/MIdLnDhs1my7rEF5JQ1jn9lRG5Ys2em8yU=; b=sRzid1/CVTb0Nr2dFokkj2Jgb2643hSFx0UliQC+Wl9vYlBsrfNQFKFDahGEPGzA5n xQ/F5nnSEQo4pyOnKWbXlxSF/kewmpgHvV7UZxrlk3jCMi1ijRveFYzXEw3lapWATTZ8 Xon2tgw8KAPUdcalzpF2eOqqrycJEM7S/+j4skbY/z0vkq0QZQ6I3vLTyiDz9zviSt4x wctoimRUlNlq6JZ9pn9BwpNEQludRr7w21DyQz9dtnY8IkIXyh4IBrWkqu80ewaO1eLY HiouJyOLDirJU2+bEikfNNa3boW4A0vZG0Nadzqs8H+a/5bFP65wVMWvp22qY0zLMaWW CsRw== X-Forwarded-Encrypted: i=1; AJvYcCVDiqbBXTcL5OJnhWAdg1SzC+cYBFEOFO7wWLqTwo6iiabsQc2e/kmed5ye/mD1StZ/BWCpaH+wTxPjIc34khUyfn1ZAkYs7ZM2cKvq5bmB X-Gm-Message-State: AOJu0Yyd546FX3i6J+8Es7zSEQWTusalm2Rux1EJdAbncxHiAoOFGI/t K0SVTqa6TCAFycpTUhDhuEItR5LfiHCcO/PEOUaJMiQyO5EvC5JOtyFXVVNLYa4/S8kIZZ+Rmif eeA== X-Google-Smtp-Source: AGHT+IHkhjcrQlH2dbu1uBYeh6T4yp53AoVxos6bQlX/+YHEwzQ+ADvYAWw9pJvlBrGSNgToejv//TuA+ik= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a17:902:ce8d:b0:1e9:490:cd73 with SMTP id d9443c01a7336-1eeb059763fmr103185ad.10.1715118415737; Tue, 07 May 2024 14:46:55 -0700 (PDT) Date: Tue, 7 May 2024 21:38:29 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-5-edliaw@google.com> Subject: [PATCH v2 4/5] selftests: Drop define _GNU_SOURCE From: Edward Liaw To: shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , " =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= " , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , " =?utf-8?q?Andreas_F=C3=A4rber?= " , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Muhammad Usama Anjum , Edward Liaw Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org _GNU_SOURCE is provided by KHDR_INCLUDES, so it should be dropped to prevent _GNU_SOURCE redefined warnings. Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX") Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Reviewed-by: John Hubbard --- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kvm/aarch64/arch_timer.c | 2 -- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 1 - tools/testing/selftests/kvm/aarch64/psci_test.c | 3 --- tools/testing/selftests/kvm/aarch64/vgic_init.c | 1 - tools/testing/selftests/kvm/arch_timer.c | 3 --- tools/testing/selftests/kvm/demand_paging_test.c | 3 --- tools/testing/selftests/kvm/dirty_log_test.c | 3 --- tools/testing/selftests/kvm/guest_memfd_test.c | 2 -- tools/testing/selftests/kvm/hardware_disable_test.c | 3 --- tools/testing/selftests/kvm/include/userfaultfd_util.h | 3 --- tools/testing/selftests/kvm/kvm_binary_stats_test.c | 2 -- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 2 -- tools/testing/selftests/kvm/kvm_page_table_test.c | 3 --- tools/testing/selftests/kvm/lib/assert.c | 3 --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 -- tools/testing/selftests/kvm/lib/memstress.c | 2 -- tools/testing/selftests/kvm/lib/test_util.c | 2 -- tools/testing/selftests/kvm/lib/userfaultfd_util.c | 3 --- tools/testing/selftests/kvm/lib/x86_64/sev.c | 1 - tools/testing/selftests/kvm/max_guest_memory_test.c | 2 -- .../testing/selftests/kvm/memslot_modification_stress_test.c | 3 --- tools/testing/selftests/kvm/riscv/arch_timer.c | 3 --- tools/testing/selftests/kvm/rseq_test.c | 1 - tools/testing/selftests/kvm/s390x/cmma_test.c | 2 -- tools/testing/selftests/kvm/s390x/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/set_memory_region_test.c | 1 - tools/testing/selftests/kvm/steal_time.c | 1 - tools/testing/selftests/kvm/x86_64/amx_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_ipi.c | 2 -- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 1 - tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c | 2 -- tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c | 2 -- tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 3 --- tools/testing/selftests/kvm/x86_64/platform_info_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_counters_test.c | 2 -- tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 3 --- .../selftests/kvm/x86_64/private_mem_conversions_test.c | 1 - tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 1 - tools/testing/selftests/kvm/x86_64/set_sregs_test.c | 1 - .../selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 3 --- tools/testing/selftests/kvm/x86_64/smm_test.c | 1 - tools/testing/selftests/kvm/x86_64/state_test.c | 1 - tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 2 -- tools/testing/selftests/kvm/x86_64/ucna_injection_test.c | 2 -- tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c | 3 --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 1 - .../testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c | 1 - tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c | 2 -- tools/testing/selftests/kvm/x86_64/xapic_state_test.c | 1 - tools/testing/selftests/kvm/x86_64/xss_msr_test.c | 2 -- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 198 files changed, 405 deletions(-) diff --git a/tools/testing/selftests/cachestat/test_cachestat.c b/tools/testing/selftests/cachestat/test_cachestat.c index b171fd53b004..c1a6ce7b0912 100644 --- a/tools/testing/selftests/cachestat/test_cachestat.c +++ b/tools/testing/selftests/cachestat/test_cachestat.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c index 7cde07a5df78..e3954b88c3ee 100644 --- a/tools/testing/selftests/capabilities/test_execve.c +++ b/tools/testing/selftests/capabilities/test_execve.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c index 3c9bf0cd82a8..3c5e45dae617 100644 --- a/tools/testing/selftests/clone3/clone3.c +++ b/tools/testing/selftests/clone3/clone3.c @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Based on Christian Brauner's clone3() example */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c index 31b56d625655..bb99ea20f7d5 100644 --- a/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +++ b/tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c @@ -7,8 +7,6 @@ */ /* capabilities related code based on selftests/bpf/test_verifier.c */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c index 54a8b2445be9..50336d56db6b 100644 --- a/tools/testing/selftests/clone3/clone3_clear_sighand.c +++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c @@ -1,6 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/clone3/clone3_selftests.h b/tools/testing/selftests/clone3/clone3_selftests.h index 3d2663fe50ba..172e19d5515f 100644 --- a/tools/testing/selftests/clone3/clone3_selftests.h +++ b/tools/testing/selftests/clone3/clone3_selftests.h @@ -3,7 +3,6 @@ #ifndef _CLONE3_SELFTESTS_H #define _CLONE3_SELFTESTS_H -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c index ed785afb6077..8b5ed4484ee6 100644 --- a/tools/testing/selftests/clone3/clone3_set_tid.c +++ b/tools/testing/selftests/clone3/clone3_set_tid.c @@ -5,8 +5,6 @@ * These tests are assuming to be running in the host's * PID namespace. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/core/close_range_test.c b/tools/testing/selftests/core/close_range_test.c index c59e4adb905d..1c2902bcc913 100644 --- a/tools/testing/selftests/core/close_range_test.c +++ b/tools/testing/selftests/core/close_range_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/drivers/dma-buf/udmabuf.c b/tools/testing/selftests/drivers/dma-buf/udmabuf.c index c812080e304e..7c8dbab8ac44 100644 --- a/tools/testing/selftests/drivers/dma-buf/udmabuf.c +++ b/tools/testing/selftests/drivers/dma-buf/udmabuf.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include diff --git a/tools/testing/selftests/fchmodat2/fchmodat2_test.c b/tools/testing/selftests/fchmodat2/fchmodat2_test.c index e0319417124d..6b411859c2cd 100644 --- a/tools/testing/selftests/fchmodat2/fchmodat2_test.c +++ b/tools/testing/selftests/fchmodat2/fchmodat2_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c index 5f362c0fd890..fca693db1b09 100644 --- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c +++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/devpts_pts.c b/tools/testing/selftests/filesystems/devpts_pts.c index b1fc9b916ace..73766447eeb0 100644 --- a/tools/testing/selftests/filesystems/devpts_pts.c +++ b/tools/testing/selftests/filesystems/devpts_pts.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/dnotify_test.c b/tools/testing/selftests/filesystems/dnotify_test.c index c0a9b2d3302d..05367a70b963 100644 --- a/tools/testing/selftests/filesystems/dnotify_test.c +++ b/tools/testing/selftests/filesystems/dnotify_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE /* needed to get the defines */ #include /* in glibc 2.2 this has the needed values defined */ #include diff --git a/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c b/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c index 65ede506305c..9bc2ddad7e92 100644 --- a/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +++ b/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c index f142a137526c..17935f42fbc9 100644 --- a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c +++ b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/fat/rename_exchange.c b/tools/testing/selftests/filesystems/fat/rename_exchange.c index e488ad354fce..56cf3ad8640d 100644 --- a/tools/testing/selftests/filesystems/fat/rename_exchange.c +++ b/tools/testing/selftests/filesystems/fat/rename_exchange.c @@ -6,8 +6,6 @@ * Copyright 2022 Red Hat Inc. * Author: Javier Martinez Canillas */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c b/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c index 759f86e7d263..b58a80bde95a 100644 --- a/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +++ b/tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/selftests/filesystems/statmount/statmount_test.c index 3eafd7da58e2..d1cefd1b7d16 100644 --- a/tools/testing/selftests/filesystems/statmount/statmount_test.c +++ b/tools/testing/selftests/filesystems/statmount/statmount_test.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c index 7f3ca5c78df1..8e41f9fe784c 100644 --- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c @@ -16,9 +16,6 @@ * 2009-Nov-6: futex test adaptation by Darren Hart * *****************************************************************************/ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c index 656c43c24044..291c81d59a9d 100644 --- a/tools/testing/selftests/ipc/msgque.c +++ b/tools/testing/selftests/ipc/msgque.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c index 25110c7c0b3e..885c9e943cee 100644 --- a/tools/testing/selftests/kcmp/kcmp_test.c +++ b/tools/testing/selftests/kcmp/kcmp_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c index 4eaba83cdcf3..5369959e9fc2 100644 --- a/tools/testing/selftests/kvm/aarch64/arch_timer.c +++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c @@ -5,8 +5,6 @@ * * Copyright (c) 2021, Google LLC. */ -#define _GNU_SOURCE - #include "arch_timer.h" #include "delay.h" #include "gic.h" diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c index 5972905275cf..79e99f47a9fe 100644 --- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c +++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c @@ -7,7 +7,6 @@ * hugetlbfs with a hole). It checks that the expected handling method is * called (e.g., uffd faults with the right address and write/read flag). */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kvm/aarch64/psci_test.c b/tools/testing/selftests/kvm/aarch64/psci_test.c index 9b004905d1d3..1c8c6f0c1ca3 100644 --- a/tools/testing/selftests/kvm/aarch64/psci_test.c +++ b/tools/testing/selftests/kvm/aarch64/psci_test.c @@ -10,9 +10,6 @@ * - A test for KVM's handling of PSCI SYSTEM_SUSPEND and the associated * KVM_SYSTEM_EVENT_SUSPEND UAPI. */ - -#define _GNU_SOURCE - #include #include "kvm_util.h" diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c b/tools/testing/selftests/kvm/aarch64/vgic_init.c index ca917c71ff60..b3b5fb0ff0a9 100644 --- a/tools/testing/selftests/kvm/aarch64/vgic_init.c +++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c @@ -4,7 +4,6 @@ * * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kvm/arch_timer.c b/tools/testing/selftests/kvm/arch_timer.c index ae1f1a6d8312..fcebd8d81ce4 100644 --- a/tools/testing/selftests/kvm/arch_timer.c +++ b/tools/testing/selftests/kvm/arch_timer.c @@ -19,9 +19,6 @@ * * Copyright (c) 2021, Google LLC. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/kvm/demand_paging_test.c b/tools/testing/selftests/kvm/demand_paging_test.c index bf3609f71854..0c4d3b6afbf8 100644 --- a/tools/testing/selftests/kvm/demand_paging_test.c +++ b/tools/testing/selftests/kvm/demand_paging_test.c @@ -6,9 +6,6 @@ * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019, Google, Inc. */ - -#define _GNU_SOURCE /* for pipe2 */ - #include #include #include diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c index eaad5b20854c..bf1ebc29f22a 100644 --- a/tools/testing/selftests/kvm/dirty_log_test.c +++ b/tools/testing/selftests/kvm/dirty_log_test.c @@ -4,9 +4,6 @@ * * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE /* for program_invocation_name */ - #include #include #include diff --git a/tools/testing/selftests/kvm/guest_memfd_test.c b/tools/testing/selftests/kvm/guest_memfd_test.c index 92eae206baa6..309fe84b84ad 100644 --- a/tools/testing/selftests/kvm/guest_memfd_test.c +++ b/tools/testing/selftests/kvm/guest_memfd_test.c @@ -4,8 +4,6 @@ * * Author: Chao Peng */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c index decc521fc760..bce73bcb973c 100644 --- a/tools/testing/selftests/kvm/hardware_disable_test.c +++ b/tools/testing/selftests/kvm/hardware_disable_test.c @@ -4,9 +4,6 @@ * kvm_arch_hardware_disable is called and it attempts to unregister the user * return notifiers. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/kvm/include/userfaultfd_util.h b/tools/testing/selftests/kvm/include/userfaultfd_util.h index 877449c34592..a9d97c213584 100644 --- a/tools/testing/selftests/kvm/include/userfaultfd_util.h +++ b/tools/testing/selftests/kvm/include/userfaultfd_util.h @@ -5,9 +5,6 @@ * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE /* for pipe2 */ - #include #include #include diff --git a/tools/testing/selftests/kvm/kvm_binary_stats_test.c b/tools/testing/selftests/kvm/kvm_binary_stats_test.c index 698c1cfa3111..f02355c3c4c2 100644 --- a/tools/testing/selftests/kvm/kvm_binary_stats_test.c +++ b/tools/testing/selftests/kvm/kvm_binary_stats_test.c @@ -6,8 +6,6 @@ * * Test the fd-based interface for KVM statistics. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c index b9e23265e4b3..c78f34699f73 100644 --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c @@ -6,8 +6,6 @@ * * Test for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_VCPU_ID. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/kvm_page_table_test.c b/tools/testing/selftests/kvm/kvm_page_table_test.c index e0ba97ac1c56..7759c685086b 100644 --- a/tools/testing/selftests/kvm/kvm_page_table_test.c +++ b/tools/testing/selftests/kvm/kvm_page_table_test.c @@ -8,9 +8,6 @@ * page size have been pre-allocated on your system, if you are planning to * use hugepages to back the guest memory for testing. */ - -#define _GNU_SOURCE /* for program_invocation_name */ - #include #include #include diff --git a/tools/testing/selftests/kvm/lib/assert.c b/tools/testing/selftests/kvm/lib/assert.c index 2bd25b191d15..b49690658c60 100644 --- a/tools/testing/selftests/kvm/lib/assert.c +++ b/tools/testing/selftests/kvm/lib/assert.c @@ -4,9 +4,6 @@ * * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE /* for getline(3) and strchrnul(3)*/ - #include "test_util.h" #include diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index b2262b5fad9e..1eaf001d0ad4 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -4,8 +4,6 @@ * * Copyright (C) 2018, Google LLC. */ - -#define _GNU_SOURCE /* for program_invocation_name */ #include "test_util.h" #include "kvm_util.h" #include "processor.h" diff --git a/tools/testing/selftests/kvm/lib/memstress.c b/tools/testing/selftests/kvm/lib/memstress.c index cf2c73971308..555e3932e529 100644 --- a/tools/testing/selftests/kvm/lib/memstress.c +++ b/tools/testing/selftests/kvm/lib/memstress.c @@ -2,8 +2,6 @@ /* * Copyright (C) 2020, Google LLC. */ -#define _GNU_SOURCE - #include #include diff --git a/tools/testing/selftests/kvm/lib/test_util.c b/tools/testing/selftests/kvm/lib/test_util.c index 5a8f8becb129..8ed0b74ae837 100644 --- a/tools/testing/selftests/kvm/lib/test_util.c +++ b/tools/testing/selftests/kvm/lib/test_util.c @@ -4,8 +4,6 @@ * * Copyright (C) 2020, Google LLC. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kvm/lib/userfaultfd_util.c b/tools/testing/selftests/kvm/lib/userfaultfd_util.c index f4eef6eb2dc2..bd07568a5240 100644 --- a/tools/testing/selftests/kvm/lib/userfaultfd_util.c +++ b/tools/testing/selftests/kvm/lib/userfaultfd_util.c @@ -6,9 +6,6 @@ * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2019-2022 Google LLC */ - -#define _GNU_SOURCE /* for pipe2 */ - #include #include #include diff --git a/tools/testing/selftests/kvm/lib/x86_64/sev.c b/tools/testing/selftests/kvm/lib/x86_64/sev.c index e248d3364b9c..e83809febae1 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/sev.c +++ b/tools/testing/selftests/kvm/lib/x86_64/sev.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c index 1a6da7389bf1..0b9678858b6d 100644 --- a/tools/testing/selftests/kvm/max_guest_memory_test.c +++ b/tools/testing/selftests/kvm/max_guest_memory_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c index 156361966612..05fcf902e067 100644 --- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c +++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c @@ -6,9 +6,6 @@ * Copyright (C) 2018, Red Hat, Inc. * Copyright (C) 2020, Google, Inc. */ - -#define _GNU_SOURCE /* for program_invocation_name */ - #include #include #include diff --git a/tools/testing/selftests/kvm/riscv/arch_timer.c b/tools/testing/selftests/kvm/riscv/arch_timer.c index 0f9cabd99fd4..4b5004ef9c6b 100644 --- a/tools/testing/selftests/kvm/riscv/arch_timer.c +++ b/tools/testing/selftests/kvm/riscv/arch_timer.c @@ -7,9 +7,6 @@ * * Copyright (c) 2024, Intel Corporation. */ - -#define _GNU_SOURCE - #include "arch_timer.h" #include "kvm_util.h" #include "processor.h" diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c index 28f97fb52044..b3536400f9ac 100644 --- a/tools/testing/selftests/kvm/rseq_test.c +++ b/tools/testing/selftests/kvm/rseq_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/s390x/cmma_test.c b/tools/testing/selftests/kvm/s390x/cmma_test.c index 626a2b8a2037..84ba79c42ab1 100644 --- a/tools/testing/selftests/kvm/s390x/cmma_test.c +++ b/tools/testing/selftests/kvm/s390x/cmma_test.c @@ -7,8 +7,6 @@ * Authors: * Nico Boehr */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/s390x/sync_regs_test.c b/tools/testing/selftests/kvm/s390x/sync_regs_test.c index 43fb25ddc3ec..53def355ccba 100644 --- a/tools/testing/selftests/kvm/s390x/sync_regs_test.c +++ b/tools/testing/selftests/kvm/s390x/sync_regs_test.c @@ -10,8 +10,6 @@ * * Test expected behavior of the KVM_CAP_SYNC_REGS functionality. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c index bd57d991e27d..214ff84f6fdb 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c index bae0c5026f82..e9231387c589 100644 --- a/tools/testing/selftests/kvm/steal_time.c +++ b/tools/testing/selftests/kvm/steal_time.c @@ -4,7 +4,6 @@ * * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/amx_test.c b/tools/testing/selftests/kvm/x86_64/amx_test.c index eae521f050e0..8e5713e36d4b 100644 --- a/tools/testing/selftests/kvm/x86_64/amx_test.c +++ b/tools/testing/selftests/kvm/x86_64/amx_test.c @@ -6,8 +6,6 @@ * * Tests for amx #NM exception and save/restore. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c b/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c index 6c2e5e0ceb1f..9c21b6bccc38 100644 --- a/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +++ b/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c @@ -4,9 +4,6 @@ * * Test for KVM_CAP_EXIT_ON_EMULATION_FAILURE. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ - #include "flds_emulation.h" #include "test_util.h" diff --git a/tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c b/tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c index df351ae17029..10b1b0ba374e 100644 --- a/tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c +++ b/tools/testing/selftests/kvm/x86_64/hwcr_msr_test.c @@ -2,8 +2,6 @@ /* * Copyright (C) 2023, Google LLC. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include "test_util.h" diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c b/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c index 5c27efbf405e..4f5881d4ef66 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_cpuid.c @@ -7,8 +7,6 @@ * This work is licensed under the terms of the GNU GPL, version 2. * */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c b/tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c index 4c7257ecd2a6..4f3f3a9b038b 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c @@ -4,7 +4,6 @@ * * Tests for Enlightened VMCS, including nested guest state. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_ipi.c b/tools/testing/selftests/kvm/x86_64/hyperv_ipi.c index f1617762c22f..8206f5ef42dd 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_ipi.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_ipi.c @@ -5,8 +5,6 @@ * Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c index c9b18707edc0..b987a3d79715 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c @@ -4,7 +4,6 @@ * * Tests for Hyper-V extensions to SVM. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c b/tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c index 05b56095cf76..077cd0ec3040 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_tlb_flush.c @@ -5,8 +5,6 @@ * Copyright (C) 2022, Red Hat, Inc. * */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c b/tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c index 3670331adf21..3eb0313ffa39 100644 --- a/tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c +++ b/tools/testing/selftests/kvm/x86_64/nested_exceptions_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE /* for program_invocation_short_name */ - #include "test_util.h" #include "kvm_util.h" #include "processor.h" diff --git a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c index 17bbb96fc4df..e7efb2b35f8b 100644 --- a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c +++ b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c @@ -5,9 +5,6 @@ * * Copyright (C) 2022, Google LLC. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/platform_info_test.c b/tools/testing/selftests/kvm/x86_64/platform_info_test.c index 87011965dc41..2165b1ad8b38 100644 --- a/tools/testing/selftests/kvm/x86_64/platform_info_test.c +++ b/tools/testing/selftests/kvm/x86_64/platform_info_test.c @@ -9,8 +9,6 @@ * Verifies expected behavior of controlling guest access to * MSR_PLATFORM_INFO. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c b/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c index 26c85815f7e9..77f14138594e 100644 --- a/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c +++ b/tools/testing/selftests/kvm/x86_64/pmu_counters_test.c @@ -2,8 +2,6 @@ /* * Copyright (C) 2023, Tencent, Inc. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include "pmu.h" diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c index 3c85d1ae9893..5ce53b8c46e0 100644 --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c @@ -9,9 +9,6 @@ * Verifies the expected behavior of allow lists and deny lists for * virtual PMU events. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ - #include "kvm_util.h" #include "pmu.h" #include "processor.h" diff --git a/tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c b/tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c index e0f642d2a3c4..82a8d88b5338 100644 --- a/tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c +++ b/tools/testing/selftests/kvm/x86_64/private_mem_conversions_test.c @@ -2,7 +2,6 @@ /* * Copyright (C) 2022, Google LLC. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c index 366cf18600bc..d691d86e5bc3 100644 --- a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +++ b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c @@ -4,7 +4,6 @@ * * Copyright (C) 2020, Red Hat, Inc. */ -#define _GNU_SOURCE /* for program_invocation_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/set_sregs_test.c b/tools/testing/selftests/kvm/x86_64/set_sregs_test.c index 3610981d9162..c021c0795a96 100644 --- a/tools/testing/selftests/kvm/x86_64/set_sregs_test.c +++ b/tools/testing/selftests/kvm/x86_64/set_sregs_test.c @@ -10,7 +10,6 @@ * That bug allowed a user-mode program that called the KVM_SET_SREGS * ioctl to put a VCPU's local APIC into an invalid state. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c b/tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c index 416207c38a17..362be40fc00d 100644 --- a/tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c +++ b/tools/testing/selftests/kvm/x86_64/smaller_maxphyaddr_emulation_test.c @@ -5,9 +5,6 @@ * Test that KVM emulates instructions in response to EPT violations when * allow_smaller_maxphyaddr is enabled and guest.MAXPHYADDR < host.MAXPHYADDR. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ - #include "flds_emulation.h" #include "test_util.h" diff --git a/tools/testing/selftests/kvm/x86_64/smm_test.c b/tools/testing/selftests/kvm/x86_64/smm_test.c index e18b86666e1f..55c88d664a94 100644 --- a/tools/testing/selftests/kvm/x86_64/smm_test.c +++ b/tools/testing/selftests/kvm/x86_64/smm_test.c @@ -4,7 +4,6 @@ * * Tests for SMM. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/state_test.c b/tools/testing/selftests/kvm/x86_64/state_test.c index 88b58aab7207..1c756db329e5 100644 --- a/tools/testing/selftests/kvm/x86_64/state_test.c +++ b/tools/testing/selftests/kvm/x86_64/state_test.c @@ -6,7 +6,6 @@ * * Tests for vCPU state save/restore, including nested guest state. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c index adb5593daf48..8fa3948b0170 100644 --- a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c +++ b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c @@ -8,8 +8,6 @@ * including requesting an invalid register set, updates to/from values * in kvm_run.s.regs when kvm_valid_regs and kvm_dirty_regs are toggled. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c b/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c index dcbb3c29fb8e..abe71946941f 100644 --- a/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c +++ b/tools/testing/selftests/kvm/x86_64/ucna_injection_test.c @@ -17,8 +17,6 @@ * delivered into the guest or not. * */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c b/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c index f4f61a2d2464..53afbea4df88 100644 --- a/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c +++ b/tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c @@ -4,8 +4,6 @@ * * Tests for exiting into userspace on registered MSRs */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include "kvm_test_harness.h" diff --git a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c index 977948fd52e6..fa512d033205 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_dirty_log_test.c @@ -4,9 +4,6 @@ * * Copyright (C) 2018, Red Hat, Inc. */ - -#define _GNU_SOURCE /* for program_invocation_name */ - #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c b/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c index ea0cb3cae0f7..3b93f262b797 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c @@ -10,7 +10,6 @@ * and check it can be retrieved with KVM_GET_MSR, also test * the invalid LBR formats are rejected. */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include diff --git a/tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c b/tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c index affc32800158..00dd2ac07a61 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_preemption_timer_test.c @@ -9,7 +9,6 @@ * value instead of partially decayed timer value * */ -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c b/tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c index 725c206ba0b9..c78e5f755116 100644 --- a/tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c +++ b/tools/testing/selftests/kvm/x86_64/xapic_ipi_test.c @@ -19,8 +19,6 @@ * Migration is a command line option. When used on non-numa machines will * exit with error. Test is still usefull on non-numa for testing IPIs. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/xapic_state_test.c b/tools/testing/selftests/kvm/x86_64/xapic_state_test.c index ab75b873a4ad..69849acd95b0 100644 --- a/tools/testing/selftests/kvm/x86_64/xapic_state_test.c +++ b/tools/testing/selftests/kvm/x86_64/xapic_state_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include #include diff --git a/tools/testing/selftests/kvm/x86_64/xss_msr_test.c b/tools/testing/selftests/kvm/x86_64/xss_msr_test.c index 167c97abff1b..f331a4e9bae3 100644 --- a/tools/testing/selftests/kvm/x86_64/xss_msr_test.c +++ b/tools/testing/selftests/kvm/x86_64/xss_msr_test.c @@ -4,8 +4,6 @@ * * Tests for the IA32_XSS MSR. */ - -#define _GNU_SOURCE /* for program_invocation_short_name */ #include #include "test_util.h" diff --git a/tools/testing/selftests/landlock/base_test.c b/tools/testing/selftests/landlock/base_test.c index a6f89aaea77d..bdb3955a9452 100644 --- a/tools/testing/selftests/landlock/base_test.c +++ b/tools/testing/selftests/landlock/base_test.c @@ -5,8 +5,6 @@ * Copyright © 2017-2020 Mickaël Salaün * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c index 9a6036fbf289..acec1c82c8b4 100644 --- a/tools/testing/selftests/landlock/fs_test.c +++ b/tools/testing/selftests/landlock/fs_test.c @@ -6,8 +6,6 @@ * Copyright © 2020 ANSSI * Copyright © 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/landlock/net_test.c b/tools/testing/selftests/landlock/net_test.c index f21cfbbc3638..eed040adcbac 100644 --- a/tools/testing/selftests/landlock/net_test.c +++ b/tools/testing/selftests/landlock/net_test.c @@ -5,8 +5,6 @@ * Copyright © 2022-2023 Huawei Tech. Co., Ltd. * Copyright © 2023 Microsoft Corporation */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/landlock/ptrace_test.c b/tools/testing/selftests/landlock/ptrace_test.c index a19db4d0b3bd..c831e6d03b02 100644 --- a/tools/testing/selftests/landlock/ptrace_test.c +++ b/tools/testing/selftests/landlock/ptrace_test.c @@ -5,8 +5,6 @@ * Copyright © 2017-2020 Mickaël Salaün * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/lsm/common.c b/tools/testing/selftests/lsm/common.c index 9ad258912646..1b18aac570f1 100644 --- a/tools/testing/selftests/lsm/common.c +++ b/tools/testing/selftests/lsm/common.c @@ -4,8 +4,6 @@ * * Copyright © 2023 Casey Schaufler */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c index df215e4aa63f..7465bde3f922 100644 --- a/tools/testing/selftests/lsm/lsm_get_self_attr_test.c +++ b/tools/testing/selftests/lsm/lsm_get_self_attr_test.c @@ -5,8 +5,6 @@ * * Copyright © 2022 Casey Schaufler */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/lsm/lsm_list_modules_test.c b/tools/testing/selftests/lsm/lsm_list_modules_test.c index 06d24d4679a6..a6b44e25c21f 100644 --- a/tools/testing/selftests/lsm/lsm_list_modules_test.c +++ b/tools/testing/selftests/lsm/lsm_list_modules_test.c @@ -5,8 +5,6 @@ * * Copyright © 2022 Casey Schaufler */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c index 66dec47e3ca3..110c6a07e74c 100644 --- a/tools/testing/selftests/lsm/lsm_set_self_attr_test.c +++ b/tools/testing/selftests/lsm/lsm_set_self_attr_test.c @@ -5,8 +5,6 @@ * * Copyright © 2022 Casey Schaufler */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/membarrier/membarrier_test_impl.h b/tools/testing/selftests/membarrier/membarrier_test_impl.h index af89855adb7b..a8a60b6271a5 100644 --- a/tools/testing/selftests/membarrier/membarrier_test_impl.h +++ b/tools/testing/selftests/membarrier/membarrier_test_impl.h @@ -1,5 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/membarrier/membarrier_test_multi_thread.c b/tools/testing/selftests/membarrier/membarrier_test_multi_thread.c index a9cc17facfb3..b4651e2ade00 100644 --- a/tools/testing/selftests/membarrier/membarrier_test_multi_thread.c +++ b/tools/testing/selftests/membarrier/membarrier_test_multi_thread.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/membarrier/membarrier_test_single_thread.c b/tools/testing/selftests/membarrier/membarrier_test_single_thread.c index 4cdc8b1d124c..17ae5199b916 100644 --- a/tools/testing/selftests/membarrier/membarrier_test_single_thread.c +++ b/tools/testing/selftests/membarrier/membarrier_test_single_thread.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/memfd/common.c b/tools/testing/selftests/memfd/common.c index 8eb3d75f6e60..879d4f4c66fa 100644 --- a/tools/testing/selftests/memfd/common.c +++ b/tools/testing/selftests/memfd/common.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing/selftests/memfd/fuse_test.c index 93798c8c5d54..15bc189bf831 100644 --- a/tools/testing/selftests/memfd/fuse_test.c +++ b/tools/testing/selftests/memfd/fuse_test.c @@ -12,8 +12,6 @@ * the read() syscall with our memory-mapped memfd object as receive buffer to * force the kernel to write into our memfd object. */ - -#define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 18f585684e20..5172c27a8748 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 363bf5f801be..6f1a36d51f19 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -6,7 +6,6 @@ * * Author(s): David Hildenbrand */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index ad168d35b23b..3bfd5a630081 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -6,7 +6,6 @@ * * Author(s): David Hildenbrand */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/hugepage-mmap.c b/tools/testing/selftests/mm/hugepage-mmap.c index 267eea2e0e0b..edb46888222f 100644 --- a/tools/testing/selftests/mm/hugepage-mmap.c +++ b/tools/testing/selftests/mm/hugepage-mmap.c @@ -16,7 +16,6 @@ * range. * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/hugepage-mremap.c b/tools/testing/selftests/mm/hugepage-mremap.c index c463d1c09c9b..8e22822bb754 100644 --- a/tools/testing/selftests/mm/hugepage-mremap.c +++ b/tools/testing/selftests/mm/hugepage-mremap.c @@ -11,8 +11,6 @@ * To make sure the test triggers pmd sharing and goes through the 'unshare' * path in the mremap code use 1GB (1024) or more. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index e74107185324..70c40c67bc5d 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -11,8 +11,6 @@ * filesystem. Therefore, a hugetlbfs filesystem must be mounted on some * directory. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c index ba6cc6f9cabc..6b8b41b4f754 100644 --- a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 829320a519e7..d18bf400dae6 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index d615767e396b..1deae905c42e 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -6,7 +6,6 @@ * * Author(s): David Hildenbrand */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c index 17bcb07f19f3..d19ad13ffd7e 100644 --- a/tools/testing/selftests/mm/madv_populate.c +++ b/tools/testing/selftests/mm/madv_populate.c @@ -6,7 +6,6 @@ * * Author(s): David Hildenbrand */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/map_populate.c b/tools/testing/selftests/mm/map_populate.c index 5c8a53869b1b..ff4d4079bd0e 100644 --- a/tools/testing/selftests/mm/map_populate.c +++ b/tools/testing/selftests/mm/map_populate.c @@ -4,8 +4,6 @@ * * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/mdwe_test.c b/tools/testing/selftests/mm/mdwe_test.c index 1e01d3ddc11c..200bedcdc32e 100644 --- a/tools/testing/selftests/mm/mdwe_test.c +++ b/tools/testing/selftests/mm/mdwe_test.c @@ -7,7 +7,6 @@ #include #include -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/memfd_secret.c b/tools/testing/selftests/mm/memfd_secret.c index 9b298f6a04b3..750adede2816 100644 --- a/tools/testing/selftests/mm/memfd_secret.c +++ b/tools/testing/selftests/mm/memfd_secret.c @@ -4,8 +4,6 @@ * * Author: Mike Rapoport */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c index 26f744188ad0..42574290d728 100644 --- a/tools/testing/selftests/mm/mlock2-tests.c +++ b/tools/testing/selftests/mm/mlock2-tests.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/mrelease_test.c b/tools/testing/selftests/mm/mrelease_test.c index 100370a7111d..d78bf686e99f 100644 --- a/tools/testing/selftests/mm/mrelease_test.c +++ b/tools/testing/selftests/mm/mrelease_test.c @@ -2,7 +2,6 @@ /* * Copyright 2022 Google LLC */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/mremap_dontunmap.c b/tools/testing/selftests/mm/mremap_dontunmap.c index 1d75084b9ca5..934fa6b441b2 100644 --- a/tools/testing/selftests/mm/mremap_dontunmap.c +++ b/tools/testing/selftests/mm/mremap_dontunmap.c @@ -5,7 +5,6 @@ * * Copyright 2020, Brian Geffon */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 2f8b991f78cb..e057154630e0 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -2,8 +2,6 @@ /* * Copyright 2020 Google LLC */ -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index d59517ed3d48..2a18b5d276f0 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index 1af3156a9db8..37d6b01ce90a 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H #define _PKEYS_HELPER_H -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 48dc151f8fca..9f7de92caeda 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -21,7 +21,6 @@ * gcc -mxsave -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm * gcc -mxsave -m32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm */ -#define _GNU_SOURCE #define __SANE_USERSPACE_TYPES__ #include #include diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index d3c7f5fb3e7b..ae6ac950d7a1 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -3,8 +3,6 @@ * A test of splitting PMD THPs and PTE-mapped THPs from a specified virtual * address range in a process via /split_huge_pages interface. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index ea7fd8fe2876..28a5c31bd791 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -12,8 +12,6 @@ ipcrm -m by hand, like this sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ - -#define _GNU_SOURCE 1 #include #include #include diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h index cc5629c3d2aa..abb44319264a 100644 --- a/tools/testing/selftests/mm/uffd-common.h +++ b/tools/testing/selftests/mm/uffd-common.h @@ -7,7 +7,6 @@ #ifndef __UFFD_COMMON_H__ #define __UFFD_COMMON_H__ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/mount_setattr/mount_setattr_test.c b/tools/testing/selftests/mount_setattr/mount_setattr_test.c index c6a8c732b802..d894417134b6 100644 --- a/tools/testing/selftests/mount_setattr/mount_setattr_test.c +++ b/tools/testing/selftests/mount_setattr/mount_setattr_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c b/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c index bcf51d785a37..bd975670f61d 100644 --- a/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c +++ b/tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/af_unix/diag_uid.c b/tools/testing/selftests/net/af_unix/diag_uid.c index 79a3dd75590e..279d0c5f70d3 100644 --- a/tools/testing/selftests/net/af_unix/diag_uid.c +++ b/tools/testing/selftests/net/af_unix/diag_uid.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE #include #include diff --git a/tools/testing/selftests/net/af_unix/scm_pidfd.c b/tools/testing/selftests/net/af_unix/scm_pidfd.c index 7e534594167e..2986b8cd0418 100644 --- a/tools/testing/selftests/net/af_unix/scm_pidfd.c +++ b/tools/testing/selftests/net/af_unix/scm_pidfd.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 OR MIT -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/af_unix/unix_connect.c b/tools/testing/selftests/net/af_unix/unix_connect.c index d799fd8f5c7c..34e816862cc7 100644 --- a/tools/testing/selftests/net/af_unix/unix_connect.c +++ b/tools/testing/selftests/net/af_unix/unix_connect.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include diff --git a/tools/testing/selftests/net/csum.c b/tools/testing/selftests/net/csum.c index 90eb06fefa59..8262aa862331 100644 --- a/tools/testing/selftests/net/csum.c +++ b/tools/testing/selftests/net/csum.c @@ -58,9 +58,6 @@ * different seed for each run (and logs this for reproducibility). It * is advised to enable this for extra coverage in continuous testing. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/gro.c b/tools/testing/selftests/net/gro.c index 353e1e867fbb..f5d7032e6466 100644 --- a/tools/testing/selftests/net/gro.c +++ b/tools/testing/selftests/net/gro.c @@ -34,9 +34,6 @@ * flakiness is to be expected. * */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/ip_defrag.c b/tools/testing/selftests/net/ip_defrag.c index f9ed749fd8c7..80c9e567a3d8 100644 --- a/tools/testing/selftests/net/ip_defrag.c +++ b/tools/testing/selftests/net/ip_defrag.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/ipsec.c b/tools/testing/selftests/net/ipsec.c index be4a30a0d02a..04aa06d26b09 100644 --- a/tools/testing/selftests/net/ipsec.c +++ b/tools/testing/selftests/net/ipsec.c @@ -3,9 +3,6 @@ * ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/ipv6_flowlabel.c b/tools/testing/selftests/net/ipv6_flowlabel.c index 708a9822259d..b7e0c3c02e20 100644 --- a/tools/testing/selftests/net/ipv6_flowlabel.c +++ b/tools/testing/selftests/net/ipv6_flowlabel.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/ipv6_flowlabel_mgr.c b/tools/testing/selftests/net/ipv6_flowlabel_mgr.c index af95b48acea9..ebd219ba386e 100644 --- a/tools/testing/selftests/net/ipv6_flowlabel_mgr.c +++ b/tools/testing/selftests/net/ipv6_flowlabel_mgr.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index d2043ec3bf6d..ea93030ed3ec 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/mptcp/mptcp_inq.c b/tools/testing/selftests/net/mptcp/mptcp_inq.c index 218aac467321..c5bf873d76c2 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_inq.c +++ b/tools/testing/selftests/net/mptcp/mptcp_inq.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c index 926b0be87c99..7203ca9900e9 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c index bdc03a2097e8..9278bf585c80 100644 --- a/tools/testing/selftests/net/msg_zerocopy.c +++ b/tools/testing/selftests/net/msg_zerocopy.c @@ -24,9 +24,6 @@ * the kernel queues completions on the error queue for all zerocopy * transfers. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/nettest.c b/tools/testing/selftests/net/nettest.c index cd8a58097448..88e1d3b2ddf1 100644 --- a/tools/testing/selftests/net/nettest.c +++ b/tools/testing/selftests/net/nettest.c @@ -3,8 +3,6 @@ * * Copyright (c) 2013-2019 David Ahern . All rights reserved. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c index 1a736f700be4..5b2d34440ae9 100644 --- a/tools/testing/selftests/net/psock_fanout.c +++ b/tools/testing/selftests/net/psock_fanout.c @@ -26,9 +26,6 @@ * Todo: * - functionality: PACKET_FANOUT_FLAG_DEFRAG */ - -#define _GNU_SOURCE /* for sched_setaffinity */ - #include #include #include diff --git a/tools/testing/selftests/net/psock_snd.c b/tools/testing/selftests/net/psock_snd.c index edf1e6f80d41..2f29b513e18f 100644 --- a/tools/testing/selftests/net/psock_snd.c +++ b/tools/testing/selftests/net/psock_snd.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/reuseport_addr_any.c b/tools/testing/selftests/net/reuseport_addr_any.c index b8475cb29be7..9ee6ece52865 100644 --- a/tools/testing/selftests/net/reuseport_addr_any.c +++ b/tools/testing/selftests/net/reuseport_addr_any.c @@ -3,9 +3,6 @@ /* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/reuseport_bpf_cpu.c b/tools/testing/selftests/net/reuseport_bpf_cpu.c index 2d646174729f..e93e38cfb2a8 100644 --- a/tools/testing/selftests/net/reuseport_bpf_cpu.c +++ b/tools/testing/selftests/net/reuseport_bpf_cpu.c @@ -11,9 +11,6 @@ * This entire process is done for several different core id permutations * and for each IPv4/IPv6 and TCP/UDP combination. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/reuseport_bpf_numa.c b/tools/testing/selftests/net/reuseport_bpf_numa.c index c9ba36aa688e..502fdb9ce770 100644 --- a/tools/testing/selftests/net/reuseport_bpf_numa.c +++ b/tools/testing/selftests/net/reuseport_bpf_numa.c @@ -3,9 +3,6 @@ * Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/reuseport_dualstack.c b/tools/testing/selftests/net/reuseport_dualstack.c index fb7a59ed759e..d3c3d3f39f8f 100644 --- a/tools/testing/selftests/net/reuseport_dualstack.c +++ b/tools/testing/selftests/net/reuseport_dualstack.c @@ -10,9 +10,6 @@ * This test creates these mixed AF_INET/AF_INET6 sockets and asserts the * AF_INET preference for v4 packets. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/so_incoming_cpu.c b/tools/testing/selftests/net/so_incoming_cpu.c index e9fa14e10732..95bd0cdc3253 100644 --- a/tools/testing/selftests/net/so_incoming_cpu.c +++ b/tools/testing/selftests/net/so_incoming_cpu.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE #include #include diff --git a/tools/testing/selftests/net/so_netns_cookie.c b/tools/testing/selftests/net/so_netns_cookie.c index b39e87e967cd..18532d564f79 100644 --- a/tools/testing/selftests/net/so_netns_cookie.c +++ b/tools/testing/selftests/net/so_netns_cookie.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c index 8457b7ccbc09..011a24af9786 100644 --- a/tools/testing/selftests/net/so_txtime.c +++ b/tools/testing/selftests/net/so_txtime.c @@ -9,9 +9,6 @@ * the expected stream. Sender will read transmit timestamps from the error * queue. The streams can differ due to out-of-order delivery and drops. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/tap.c b/tools/testing/selftests/net/tap.c index 247c3b3ac1c9..fa78b92d9740 100644 --- a/tools/testing/selftests/net/tap.c +++ b/tools/testing/selftests/net/tap.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/tcp_fastopen_backup_key.c b/tools/testing/selftests/net/tcp_fastopen_backup_key.c index c1cb0c75156a..d30f89bb944c 100644 --- a/tools/testing/selftests/net/tcp_fastopen_backup_key.c +++ b/tools/testing/selftests/net/tcp_fastopen_backup_key.c @@ -12,7 +12,6 @@ * there are no cases in which a cookie is not accepted by verifying * that TcpExtTCPFastOpenPassiveFail remains 0. */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/tcp_inq.c b/tools/testing/selftests/net/tcp_inq.c index bd6a9c7a3e8a..71ee145f151e 100644 --- a/tools/testing/selftests/net/tcp_inq.c +++ b/tools/testing/selftests/net/tcp_inq.c @@ -5,8 +5,6 @@ * * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c index 4fcce5150850..72d5f1207ee0 100644 --- a/tools/testing/selftests/net/tcp_mmap.c +++ b/tools/testing/selftests/net/tcp_mmap.c @@ -46,7 +46,6 @@ * received 32768 MB (99.9939 % mmap'ed) in 7.43764 s, 36.9577 Gbit * cpu usage user:0.035 sys:3.467, 106.873 usec per MB, 65530 c-switches */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index f27a12d2a2c9..6dbad97d1d0a 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/toeplitz.c b/tools/testing/selftests/net/toeplitz.c index 9ba03164d73a..e2d739892ce4 100644 --- a/tools/testing/selftests/net/toeplitz.c +++ b/tools/testing/selftests/net/toeplitz.c @@ -20,9 +20,6 @@ * 5. Compute the cpu that RPS should select based on rx_hash and $rps_bitmap * 6. Compare the cpus from 4 and 5 */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/tun.c b/tools/testing/selftests/net/tun.c index fa83918b62d1..a64dcfb242c1 100644 --- a/tools/testing/selftests/net/tun.c +++ b/tools/testing/selftests/net/tun.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/txring_overwrite.c b/tools/testing/selftests/net/txring_overwrite.c index 7d9ea039450a..96972e0110a0 100644 --- a/tools/testing/selftests/net/txring_overwrite.c +++ b/tools/testing/selftests/net/txring_overwrite.c @@ -4,9 +4,6 @@ * Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/txtimestamp.c b/tools/testing/selftests/net/txtimestamp.c index ec60a16c9307..33dba9e90dea 100644 --- a/tools/testing/selftests/net/txtimestamp.c +++ b/tools/testing/selftests/net/txtimestamp.c @@ -16,9 +16,6 @@ * This test requires a dummy TCP server. * A simple `nc6 [-u] -l -p $DESTPORT` will do */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c index 85b3baa3f7f3..9dc1026a033a 100644 --- a/tools/testing/selftests/net/udpgso.c +++ b/tools/testing/selftests/net/udpgso.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/udpgso_bench_rx.c b/tools/testing/selftests/net/udpgso_bench_rx.c index 1cbadd267c96..999df1236320 100644 --- a/tools/testing/selftests/net/udpgso_bench_rx.c +++ b/tools/testing/selftests/net/udpgso_bench_rx.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/net/udpgso_bench_tx.c b/tools/testing/selftests/net/udpgso_bench_tx.c index 477392715a9a..d7632993b354 100644 --- a/tools/testing/selftests/net/udpgso_bench_tx.c +++ b/tools/testing/selftests/net/udpgso_bench_tx.c @@ -1,7 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/perf_events/remove_on_exec.c b/tools/testing/selftests/perf_events/remove_on_exec.c index 5814611a1dc7..ef4d923f4759 100644 --- a/tools/testing/selftests/perf_events/remove_on_exec.c +++ b/tools/testing/selftests/perf_events/remove_on_exec.c @@ -5,8 +5,6 @@ * Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE - /* We need the latest siginfo from the kernel repo. */ #include #include diff --git a/tools/testing/selftests/perf_events/sigtrap_threads.c b/tools/testing/selftests/perf_events/sigtrap_threads.c index d1d8483ac628..14d1a3c8cb5c 100644 --- a/tools/testing/selftests/perf_events/sigtrap_threads.c +++ b/tools/testing/selftests/perf_events/sigtrap_threads.c @@ -5,8 +5,6 @@ * Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE - /* We need the latest siginfo from the kernel repo. */ #include #include diff --git a/tools/testing/selftests/pid_namespace/regression_enomem.c b/tools/testing/selftests/pid_namespace/regression_enomem.c index 7d84097ad45c..54dc8f16d92a 100644 --- a/tools/testing/selftests/pid_namespace/regression_enomem.c +++ b/tools/testing/selftests/pid_namespace/regression_enomem.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h index 88d6830ee004..e33177b1aa41 100644 --- a/tools/testing/selftests/pidfd/pidfd.h +++ b/tools/testing/selftests/pidfd/pidfd.h @@ -3,7 +3,6 @@ #ifndef __PIDFD_H #define __PIDFD_H -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c index 01cc37bf611c..67c9dc436c71 100644 --- a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +++ b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_getfd_test.c b/tools/testing/selftests/pidfd/pidfd_getfd_test.c index cd51d547b751..b6a0e9b3d2f5 100644 --- a/tools/testing/selftests/pidfd/pidfd_getfd_test.c +++ b/tools/testing/selftests/pidfd/pidfd_getfd_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_open_test.c b/tools/testing/selftests/pidfd/pidfd_open_test.c index 8a59438ccc78..781a3931fb5a 100644 --- a/tools/testing/selftests/pidfd/pidfd_open_test.c +++ b/tools/testing/selftests/pidfd/pidfd_open_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_poll_test.c b/tools/testing/selftests/pidfd/pidfd_poll_test.c index 610811275357..a40fb27a78bb 100644 --- a/tools/testing/selftests/pidfd/pidfd_poll_test.c +++ b/tools/testing/selftests/pidfd/pidfd_poll_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_setns_test.c b/tools/testing/selftests/pidfd/pidfd_setns_test.c index 6e2f2cd400ca..49d7a78cc4fe 100644 --- a/tools/testing/selftests/pidfd/pidfd_setns_test.c +++ b/tools/testing/selftests/pidfd/pidfd_setns_test.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_test.c b/tools/testing/selftests/pidfd/pidfd_test.c index c081ae91313a..c3d52406b8fd 100644 --- a/tools/testing/selftests/pidfd/pidfd_test.c +++ b/tools/testing/selftests/pidfd/pidfd_test.c @@ -1,6 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/pidfd/pidfd_wait.c b/tools/testing/selftests/pidfd/pidfd_wait.c index 0dcb8365ddc3..54beba0983f1 100644 --- a/tools/testing/selftests/pidfd/pidfd_wait.c +++ b/tools/testing/selftests/pidfd/pidfd_wait.c @@ -1,6 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/ptrace/get_set_sud.c b/tools/testing/selftests/ptrace/get_set_sud.c index 5297b10d25c3..054a78ebe8b5 100644 --- a/tools/testing/selftests/ptrace/get_set_sud.c +++ b/tools/testing/selftests/ptrace/get_set_sud.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include "../kselftest_harness.h" #include #include diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace/peeksiginfo.c index a6884f66dc01..1b7b77190f72 100644 --- a/tools/testing/selftests/ptrace/peeksiginfo.c +++ b/tools/testing/selftests/ptrace/peeksiginfo.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c b/tools/testing/selftests/rseq/basic_percpu_ops_test.c index 2348d2c20d0a..5961c24ee1ae 100644 --- a/tools/testing/selftests/rseq/basic_percpu_ops_test.c +++ b/tools/testing/selftests/rseq/basic_percpu_ops_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/rseq/basic_test.c b/tools/testing/selftests/rseq/basic_test.c index 295eea16466f..1fed749b4bd7 100644 --- a/tools/testing/selftests/rseq/basic_test.c +++ b/tools/testing/selftests/rseq/basic_test.c @@ -2,8 +2,6 @@ /* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c index 2f37961240ca..48a55d94eb72 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 96e812bdf8a4..88602889414c 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -14,8 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c index b83099160fbc..3632a4890da9 100644 --- a/tools/testing/selftests/seccomp/seccomp_benchmark.c +++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c @@ -2,7 +2,6 @@ * Strictly speaking, this is not a test. But it can report during test * runs so relative performace can be measured. */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 783ebce8c4de..972ccc12553e 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -4,8 +4,6 @@ * * Test code for seccomp bpf. */ - -#define _GNU_SOURCE #include /* diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c index 7288a05136ba..a1f156dbbd56 100644 --- a/tools/testing/selftests/user_events/abi_test.c +++ b/tools/testing/selftests/user_events/abi_test.c @@ -4,8 +4,6 @@ * * Copyright (c) 2022 Beau Belgrave */ - -#define _GNU_SOURCE #include #include diff --git a/tools/testing/selftests/x86/amx.c b/tools/testing/selftests/x86/amx.c index d884fd69dd51..9441635fc452 100644 --- a/tools/testing/selftests/x86/amx.c +++ b/tools/testing/selftests/x86/amx.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/check_initial_reg_state.c b/tools/testing/selftests/x86/check_initial_reg_state.c index 3bc95f3ed585..0129cdae8abe 100644 --- a/tools/testing/selftests/x86/check_initial_reg_state.c +++ b/tools/testing/selftests/x86/check_initial_reg_state.c @@ -3,9 +3,6 @@ * check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE - #include unsigned long ax, bx, cx, dx, si, di, bp, sp, flags; diff --git a/tools/testing/selftests/x86/corrupt_xstate_header.c b/tools/testing/selftests/x86/corrupt_xstate_header.c index cf9ce8fbb656..d2c746149678 100644 --- a/tools/testing/selftests/x86/corrupt_xstate_header.c +++ b/tools/testing/selftests/x86/corrupt_xstate_header.c @@ -4,9 +4,6 @@ * * Based on analysis and a test case from Thomas Gleixner. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/entry_from_vm86.c b/tools/testing/selftests/x86/entry_from_vm86.c index d1e919b0c1dc..9fa9d4a847ac 100644 --- a/tools/testing/selftests/x86/entry_from_vm86.c +++ b/tools/testing/selftests/x86/entry_from_vm86.c @@ -5,9 +5,6 @@ * * This exercises a few paths that need to special-case vm86 mode. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/x86/fsgsbase.c index 8c780cce941d..348134d2cefc 100644 --- a/tools/testing/selftests/x86/fsgsbase.c +++ b/tools/testing/selftests/x86/fsgsbase.c @@ -3,8 +3,6 @@ * fsgsbase.c, an fsgsbase test * Copyright (c) 2014-2016 Andy Lutomirski */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/fsgsbase_restore.c b/tools/testing/selftests/x86/fsgsbase_restore.c index 6fffadc51579..88dce47ab8e6 100644 --- a/tools/testing/selftests/x86/fsgsbase_restore.c +++ b/tools/testing/selftests/x86/fsgsbase_restore.c @@ -12,8 +12,6 @@ * * This is not part of fsgsbase.c, because that test is 64-bit only. */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/ioperm.c b/tools/testing/selftests/x86/ioperm.c index 57ec5e99edb9..07b7c10f8d39 100644 --- a/tools/testing/selftests/x86/ioperm.c +++ b/tools/testing/selftests/x86/ioperm.c @@ -3,8 +3,6 @@ * ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/iopl.c b/tools/testing/selftests/x86/iopl.c index 7e3e09c1abac..baa691154905 100644 --- a/tools/testing/selftests/x86/iopl.c +++ b/tools/testing/selftests/x86/iopl.c @@ -3,8 +3,6 @@ * iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/lam.c b/tools/testing/selftests/x86/lam.c index 215b8150b7cc..39edfd7f6037 100644 --- a/tools/testing/selftests/x86/lam.c +++ b/tools/testing/selftests/x86/lam.c @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/ldt_gdt.c b/tools/testing/selftests/x86/ldt_gdt.c index 3a29346e1452..3b4237a85a12 100644 --- a/tools/testing/selftests/x86/ldt_gdt.c +++ b/tools/testing/selftests/x86/ldt_gdt.c @@ -3,8 +3,6 @@ * ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/mov_ss_trap.c b/tools/testing/selftests/x86/mov_ss_trap.c index cc3de6ff9fba..47ecc63220b7 100644 --- a/tools/testing/selftests/x86/mov_ss_trap.c +++ b/tools/testing/selftests/x86/mov_ss_trap.c @@ -19,8 +19,6 @@ * * This should mostly cover CVE-2018-1087 and CVE-2018-8897. */ -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/nx_stack.c b/tools/testing/selftests/x86/nx_stack.c index ea4a4e246879..97c5b34096cc 100644 --- a/tools/testing/selftests/x86/nx_stack.c +++ b/tools/testing/selftests/x86/nx_stack.c @@ -23,8 +23,6 @@ * Regular stack is completely overwritten before testing. * Test doesn't exit SIGSEGV handler after first fault at INT3. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE #undef NDEBUG #include #include diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c index 12aaa063196e..bdc81c8bd1a7 100644 --- a/tools/testing/selftests/x86/ptrace_syscall.c +++ b/tools/testing/selftests/x86/ptrace_syscall.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/sigaltstack.c b/tools/testing/selftests/x86/sigaltstack.c index f689af75e979..7f41c3a4268b 100644 --- a/tools/testing/selftests/x86/sigaltstack.c +++ b/tools/testing/selftests/x86/sigaltstack.c @@ -1,6 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-only - -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/sigreturn.c b/tools/testing/selftests/x86/sigreturn.c index 5d7961a5f7f6..2054f729b2c2 100644 --- a/tools/testing/selftests/x86/sigreturn.c +++ b/tools/testing/selftests/x86/sigreturn.c @@ -24,9 +24,6 @@ * * Do not run on outdated, unpatched kernels at risk of nasty crashes. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/single_step_syscall.c b/tools/testing/selftests/x86/single_step_syscall.c index 9a30f443e928..375f3b50a0b5 100644 --- a/tools/testing/selftests/x86/single_step_syscall.c +++ b/tools/testing/selftests/x86/single_step_syscall.c @@ -9,9 +9,6 @@ * immediately issues #DB from CPL 0. This requires special handling in * the kernel. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/syscall_arg_fault.c b/tools/testing/selftests/x86/syscall_arg_fault.c index 461fa41a4d02..10eee1bcd015 100644 --- a/tools/testing/selftests/x86/syscall_arg_fault.c +++ b/tools/testing/selftests/x86/syscall_arg_fault.c @@ -3,9 +3,6 @@ * syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/syscall_numbering.c b/tools/testing/selftests/x86/syscall_numbering.c index 991591718bb0..c72fc8aaa4d3 100644 --- a/tools/testing/selftests/x86/syscall_numbering.c +++ b/tools/testing/selftests/x86/syscall_numbering.c @@ -5,9 +5,6 @@ * * Copyright (c) 2018 Andrew Lutomirski */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/sysret_rip.c b/tools/testing/selftests/x86/sysret_rip.c index 84d74be1d902..24bc219358a5 100644 --- a/tools/testing/selftests/x86/sysret_rip.c +++ b/tools/testing/selftests/x86/sysret_rip.c @@ -3,9 +3,6 @@ * sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/sysret_ss_attrs.c b/tools/testing/selftests/x86/sysret_ss_attrs.c index 5f3d4fca440f..f8b9e0b2a0c5 100644 --- a/tools/testing/selftests/x86/sysret_ss_attrs.c +++ b/tools/testing/selftests/x86/sysret_ss_attrs.c @@ -7,9 +7,6 @@ * the hidden attributes set to an unusable state. Make sure the kernel * doesn't let this happen. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/test_FCMOV.c b/tools/testing/selftests/x86/test_FCMOV.c index 6b5036fbb735..0c9431ba7d31 100644 --- a/tools/testing/selftests/x86/test_FCMOV.c +++ b/tools/testing/selftests/x86/test_FCMOV.c @@ -1,8 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1 #include #include #include diff --git a/tools/testing/selftests/x86/test_FCOMI.c b/tools/testing/selftests/x86/test_FCOMI.c index aec6692c6dcf..ba186665918d 100644 --- a/tools/testing/selftests/x86/test_FCOMI.c +++ b/tools/testing/selftests/x86/test_FCOMI.c @@ -1,8 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1 #include #include #include diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c index 09789c0ce3e9..95580cdaaa32 100644 --- a/tools/testing/selftests/x86/test_FISTTP.c +++ b/tools/testing/selftests/x86/test_FISTTP.c @@ -1,8 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1 #include #include #include diff --git a/tools/testing/selftests/x86/test_mremap_vdso.c b/tools/testing/selftests/x86/test_mremap_vdso.c index f0d876d48277..a8bdba356682 100644 --- a/tools/testing/selftests/x86/test_mremap_vdso.c +++ b/tools/testing/selftests/x86/test_mremap_vdso.c @@ -9,7 +9,6 @@ * Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ -#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/x86/test_shadow_stack.c b/tools/testing/selftests/x86/test_shadow_stack.c index 757e6527f67e..0ceca9064cec 100644 --- a/tools/testing/selftests/x86/test_shadow_stack.c +++ b/tools/testing/selftests/x86/test_shadow_stack.c @@ -7,9 +7,6 @@ * special glibc shadow stack support (longjmp(), swapcontext(), etc). Just * stick to the basics and hope the compiler doesn't do anything strange. */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/test_syscall_vdso.c b/tools/testing/selftests/x86/test_syscall_vdso.c index 8965c311bd65..5cd13279bba5 100644 --- a/tools/testing/selftests/x86/test_syscall_vdso.c +++ b/tools/testing/selftests/x86/test_syscall_vdso.c @@ -8,10 +8,6 @@ * Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1 #include #include #include diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsyscall.c index 47cab972807c..cbf4e5012005 100644 --- a/tools/testing/selftests/x86/test_vsyscall.c +++ b/tools/testing/selftests/x86/test_vsyscall.c @@ -1,7 +1,4 @@ /* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE - #include #include #include diff --git a/tools/testing/selftests/x86/unwind_vdso.c b/tools/testing/selftests/x86/unwind_vdso.c index 4c311e1af4c7..754f5d4d425a 100644 --- a/tools/testing/selftests/x86/unwind_vdso.c +++ b/tools/testing/selftests/x86/unwind_vdso.c @@ -5,9 +5,6 @@ * * This tests __kernel_vsyscall's unwind info. */ - -#define _GNU_SOURCE - #include #include diff --git a/tools/testing/selftests/x86/vdso_restorer.c b/tools/testing/selftests/x86/vdso_restorer.c index fe99f2434155..8193de22a390 100644 --- a/tools/testing/selftests/x86/vdso_restorer.c +++ b/tools/testing/selftests/x86/vdso_restorer.c @@ -10,9 +10,6 @@ * 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ - -#define _GNU_SOURCE - #include #include #include From patchwork Tue May 7 21:38:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13657859 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034C8150999 for ; Tue, 7 May 2024 21:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118457; cv=none; b=MDoKChnXyEnggXf8eMP3EAYuQL+gvNKMwZuQJe6Dqt8YA1Zo+yIIl/yTvmqCP6uKHH2OzklqNnRhgXQZ5osuTT3uNaOo8/elYtxB85jCV3p0x9FNP8qJPp0xSHl1Ce6RSfb5m/CwFiNS6k3nG93tJZHR3WOvD7BqlMw0/WvmHzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715118457; c=relaxed/simple; bh=rWVD3Les6HNzGCMpjrx8KhL3+oCBlnrsvxNQZUeaa0A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=taiCQPoD4u6/hltr71rQ2HlqxAUAic0DZSCTT5hSyWwpU+YDV88Lp24YrmLdrxM3aVMfDhRkmdjoKkG9x2zt7zUYGa4cGdYtLN0EI2h0aRCjrg0KRfhhq+i6iCth8BYgqs2R081OJ00EzXSGmnx2pQYYSf3dONzvhn2s38RJx7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jL8djN5v; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jL8djN5v" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-6f441afba80so4404479b3a.3 for ; Tue, 07 May 2024 14:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715118454; x=1715723254; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=GxXvLzcq9DUcgwih3mSAQ78x/pV85qLBcUXkypaveog=; b=jL8djN5vEO1m7TfEJ+L81YMFiHGDVolLVgM6fa5VYQ5mX/IYtVDh+74U6/qqObTmiJ TGznpSJeelnL0XnJATpD9OKYwW4HcBEy1z6iLfyy4XigP7CDqBXeQVB4iZWUyVAaR8ul HygKiUy+MquSUbKGVV0Yy3+/sjMqKsWKsORp27ZuE5ZT2uCMb7q0Ab+auS1b/Eo4KbxS 0VgZyg4Cu3vh+Nud0IkyWZ1h3I5EUMMpbE79VNLZV5bg86NyetkRNO2JGQsA3Mv7Q3CO RQfRjJ43cqv26Y7CDw+l7cn6dUYEdkAnCOIHYaR9Ksq978wQ99DLauRRXD66BI8m90Nr BFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715118454; x=1715723254; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GxXvLzcq9DUcgwih3mSAQ78x/pV85qLBcUXkypaveog=; b=K6qrwhf5+8zO7KfAYayCGrs2E2Easvhwx6tT//IJiplwpZJIEwKZH+h8o35SDJVyqC L2cjQ4BfRT/W+EeOeKca2Dlp5B9ZZAsqYCBwfHEWp+F5oTZDTSx9Z39YLcQj+b8pskTy Tm2yWJREfY/PXKtW2tuiIjOI4LOxiskOAH/1h5vWW+0dGX0LJ5rJW1XgSeltS9WS66L/ 6YuTj3lbNlDFZMzz+lnRzKGkpSuOiW/4kpjyInMfqkD176FG21/o6vcSM07Sf3KKUe5r 3TdJxNiuHx48OB4oZjNiJlCMAygVCVtNuzTqXohqRUPUNt0zlDi51agZu1mGRgf4n+kn 16YA== X-Forwarded-Encrypted: i=1; AJvYcCVhVji1rLyW7fEssq+1Cb+2iVYyUR73Eu1eljLPCXdeLOuo91Rk1OlWxEWiQ+ZHxbk9m5Zi8Bd5SheTOfSaPQufVsr9L9qcoJvjTMm59og9 X-Gm-Message-State: AOJu0Yx80/8dFTlSjUOFaZIR+mxjHr9VKMBjQb1G/9h9pfvM9scLSam1 Fbzm2ZyeI+ctxN4yhO1qgja9a1J/A1E/ZNa4Nbx7nOHS8FwdEipw0oJdItTg/2Q+t6Y0ux1DP9m cOw== X-Google-Smtp-Source: AGHT+IGyIuHby3YDnVxOzNzbbaEdY9qKdq7MpmWxi3fRJ7Znvf9dmfYdSTbgOYiGfgZmNPwJBeWALvgDPEM= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:6a00:1803:b0:6ec:f406:ab4b with SMTP id d2e1a72fcca58-6f49c30a0e9mr48385b3a.4.1715118454141; Tue, 07 May 2024 14:47:34 -0700 (PDT) Date: Tue, 7 May 2024 21:38:30 +0000 In-Reply-To: <20240507214254.2787305-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240507214254.2787305-1-edliaw@google.com> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog Message-ID: <20240507214254.2787305-6-edliaw@google.com> Subject: [PATCH v2 5/5] selftests: Drop duplicate -D_GNU_SOURCE From: Edward Liaw To: shuah@kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Catalin Marinas , Will Deacon , Nhat Pham , Johannes Weiner , Christian Brauner , Eric Biederman , Kees Cook , OGAWA Hirofumi , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jiri Kosina , Benjamin Tissoires , Jason Gunthorpe , Kevin Tian , Andy Lutomirski , Will Drewry , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Sean Christopherson , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , " =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= " , Paul Moore , James Morris , "Serge E. Hallyn" , Andrew Morton , Seth Forshee , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Herbert Xu , " =?utf-8?q?Andreas_F=C3=A4rber?= " , Manivannan Sadhasivam , Matthieu Baerts , Mat Martineau , Geliang Tang , Willem de Bruijn , Fenghua Yu , Reinette Chatre , Mathieu Desnoyers , "Paul E. McKenney" , Boqun Feng , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Muhammad Usama Anjum , Edward Liaw Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-input@vger.kernel.org, iommu@lists.linux.dev, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-actions@lists.infradead.org, mptcp@lists.linux.dev, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org, bpf@vger.kernel.org -D_GNU_SOURCE can be de-duplicated here, as it is added by KHDR_INCLUDES. Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Reviewed-by: John Hubbard --- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/resctrl/Makefile | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index a392d0917b4e..f79f9bac7918 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \ diff --git a/tools/testing/selftests/iommu/Makefile b/tools/testing/selftests/iommu/Makefile index 32c5fdfd0eef..fd6477911f24 100644 --- a/tools/testing/selftests/iommu/Makefile +++ b/tools/testing/selftests/iommu/Makefile @@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nth diff --git a/tools/testing/selftests/net/tcp_ao/Makefile b/tools/testing/selftests/net/tcp_ao/Makefile index 522d991e310e..c608b1ec02e6 100644 --- a/tools/testing/selftests/net/tcp_ao/Makefile +++ b/tools/testing/selftests/net/tcp_ao/Makefile @@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS := -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/ diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile index 2deac2031de9..5073dbc96125 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 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests