From patchwork Tue Jan 7 17:01:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13929388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CD27E77199 for ; Tue, 7 Jan 2025 17:01:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8541A6B0098; Tue, 7 Jan 2025 12:01:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 804236B0099; Tue, 7 Jan 2025 12:01:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F2486B00AD; Tue, 7 Jan 2025 12:01:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EF3E06B0098 for ; Tue, 7 Jan 2025 12:01:29 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B3E251C7AC8 for ; Tue, 7 Jan 2025 17:01:27 +0000 (UTC) X-FDA: 82981271814.20.DFBD64F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf20.hostedemail.com (Postfix) with ESMTP id B1AE41C0033 for ; Tue, 7 Jan 2025 17:01:21 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf20.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736269281; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5WIQSm31L3qWF7KxMnUtriHv7VQfsIQtYimBOd2epMA=; b=qqCXYmUSNkIOKGiPaIIIAPkpJcm0GMRGszHCx06DZxUPc/VXqzmOcHzub4K671M1C9Xjsz oC5ADTz9OqIVWlNhOqZTcrVeP6s6IhaxmGQSv/BrBAKh/W4Hzp0HnMTv5HeVJ42bjHWJX2 3aBIE+iph3xq+qzQzuYejFLiQ9xkdkw= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf20.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736269281; a=rsa-sha256; cv=none; b=7/1VAmD37PaDcVGpf2KLt7BgWWsSXkkvnhpVpcAOs1pZrixHeRiQ9sISdB1BmIWrVRAOt6 sdLaog1NbK/1tWSUZvmIAfG+/U4k95aGX+MBVVu1MJZPBnFs+rkIdV6umCVQxP4/bNZF37 JMvLvryBrZl8sIp3jzTFVy/kCCurYwg= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 53D5B1424; Tue, 7 Jan 2025 09:01:48 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1AD3A3F59E; Tue, 7 Jan 2025 09:01:17 -0800 (PST) From: Kevin Brodsky To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Ryan Roberts , aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: [PATCH] selftests/mm: silence unused-result warnings Date: Tue, 7 Jan 2025 17:01:10 +0000 Message-ID: <20250107170110.2819685-1-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-6-kevin.brodsky@arm.com> References: <20241209095019.1732120-6-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: B1AE41C0033 X-Stat-Signature: zmufr1uzezr9srmgngasgtsk7gto38hi X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736269281-864790 X-HE-Meta: U2FsdGVkX19uzhzYVk04RQ4JXXLWIFigeahUr8NOEPofoS/494rdF+4qBafFlWjerWUkPX+at0FeSsIq4j3aYUvUjNKh9sA1xcBI5CISSxHar/9PdVbIPA1aAKeuXcLTCbgtA8O9UR5AMJbYJVe+4mgm2AG69EBzh/3yorWbHsdGT3GEIZEiQrA5I0JzDHdrDha8soJ5KWmt7aV2VU3nIB1EM1XY2dKGnP8biomXpEISxwTYo6jCBO0PmTCFsyKOfFZ5V0mak5IgaEUt0OtYA56NjWCCmZ44YyPw2k1ThvVVQXKy66slanaf5p4GSJEz6Lb759OqyU3oVZwezN0dOjbpySvHeJimhWjgPX9bg0PEXQItXtyRqmwWXjZQFMObfrylY6FnWVZcV0jgrKI+XyBClTj+cy3/+AjRLnb39RvEd1v//N4zM7VQXom3EYuW/R2gJV8iolWUW2nAHg+LUtMF33Cn6nSNwlFEWJKEDctzwBi9MtGr/DGLJMdPUJ4Eh8Jee/Uh1+4Kao4sjax6ne0TiLTXwHDH74p5XYhqBHp6UNgG5JE6lHYO2Ss3SgfoXdhebL5wfV7fYEGkRjfJHMpPTlTA1ey8YI4NIG5yLbh4BBQ+v8BGXfUdGaoFvaBv3wI1I7i/hYUNqnewicuHXr8V6IANCQNbjw4ssPCC9m8ifoncdnPUbVpBLUj84bAtUUWjmPgIs3S3+8aZaiMXM1K4bt30S9srAfRsUgyf6hAyXci37BzEQ2iDPP62q6fWBkMt1TNbQQnuYYcvZBdKBUl5joC9IvxsHC6oegysiyL+L1vKTZaU3KVoMUQZcD7zojUqZ71SH5ZcMvtvSUvklDC1Ni0EqeWnYl3k3f6dEpr41hrouLfdC95SH8D2FVQFDeuDVLMye5C22OEdOXjQ6zv+R47jSF4TP7oPzMj/y9Dd1Jcd/+QvPdMw/kNAhyZpUiYBFk8zd8N+ZmvOkfN gms2w0bk jvNQXMRbI0WOjdn8RhkavYUS2kMUkzifAsDMnNIQOZWMMRj8tcdUbYWyRFyPxHg4sI7pwpPjX3gYyFXBSZXJGM/auqOSaY0iMcGZWnaYKqjQTzeD6FSfiQK3d9LuS71zh9w26A8ssp1kPSo4octK1d9UEzAFs6tCKMIMP61SUQvBhRAYgDAOG/x5BD3mXcI6P+n14a6Rj5oFvJ3m7bZjNMUjaT+fRk1yRkw6K5bx0vUrgSqVGy8hm5A3M8byhRbIwTILohhZifVhzWsvp18vej09Vua364RGIAbdr7kBWXpspV6r/ewfzix83uGkA64AI0A85qzpDmS+xH6T6oQyOaaIw/A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Switching to -O2 when building the mm tests has the unexpected side effect of triggering many unused-result warnings on certain distros like Ubuntu, where GCC is configured so that -O2 implies -D_FORTIFY_SOURCE. Explicitly disable FORTIFY_SOURCE to avoid those warnings. This has no effect on upstream toolchains where FORTIFY_SOURCE is not implicitly enabled. Suggested-by: Ryan Roberts Signed-off-by: Kevin Brodsky --- Hi Andrew, Could you please take this fixup patch for "selftests/mm: Build with -O2" in mm-unstable? Ryan found that building the mm kselftests on Ubuntu yields a bunch of warnings, this patch suppresses them. Cheers, - Kevin Cc: aruna.ramakrishna@oracle.com Cc: catalin.marinas@arm.com Cc: dave.hansen@linux.intel.com Cc: joey.gouly@arm.com Cc: keith.lucas@oracle.com Cc: shuah@kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kselftest@vger.kernel.org Cc: linux-mm@kvack.org Cc: x86@kernel.org --- tools/testing/selftests/mm/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index fce194a92cad..d633d6b6a6e1 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -36,6 +36,13 @@ MAKEFLAGS += --no-builtin-rules CFLAGS = -Wall -O2 -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) $(TOOLS_INCLUDES) LDLIBS = -lrt -lpthread -lm +# Some distributions (such as Ubuntu) configure GCC so that _FORTIFY_SOURCE is +# automatically enabled at -O1 or above. This triggers various unused-result +# warnings where functions such as read() or write() are called and their +# return value is not checked. Disable _FORTIFY_SOURCE to silence those +# warnings. +CFLAGS += -U_FORTIFY_SOURCE + KDIR ?= /lib/modules/$(shell uname -r)/build ifneq (,$(wildcard $(KDIR)/Module.symvers)) ifneq (,$(wildcard $(KDIR)/include/linux/page_frag_cache.h))