From patchwork Wed Apr 17 07:55:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13632960 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 BCF51C4345F for ; Wed, 17 Apr 2024 07:55:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C0F16B0083; Wed, 17 Apr 2024 03:55:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 270AF6B0085; Wed, 17 Apr 2024 03:55:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15F1F6B0087; Wed, 17 Apr 2024 03:55:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id ECC3C6B0083 for ; Wed, 17 Apr 2024 03:55:07 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 775054101C for ; Wed, 17 Apr 2024 07:55:07 +0000 (UTC) X-FDA: 82018263054.14.321AEBF Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf29.hostedemail.com (Postfix) with ESMTP id AFCC312001F for ; Wed, 17 Apr 2024 07:55:05 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=3yTtksiP; spf=pass (imf29.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713340506; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=bygQ5qUi9bE+33fZ6WG7hZvQFI2Sagq7AUwKISsHPXw=; b=VlMflxz6e8Fe5kDj4hxxO52786VVgXS2OV9VYVkEWDMncJNAoSHbgjg/CIT/ErVykdMXDh aP++6aYYOLu1xpTX/ivSUHf+Zpc5/z2pqwZ8Ii2xU8Qt9gv05enoIuf7DMQLePnDCgIEph afLYIVfxuzm+WhnKjvXoMpMmhILpcYM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713340506; a=rsa-sha256; cv=none; b=hNTPjbCk8fJUJkc4NYRK378tbKqnSwhI0QfAWGjN5z+OXaZePOLrY5F/am5tmsak8DgM4F UyClhg/iFWFulp9tWmGyM5ORWB1jxwf6uq4bbbcuo/tblLRKjqiDk9D+6AknfSWoK0nHUV bWs5R1nN+WVhuWzVAI3hYIV5pKt0Nfw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=3yTtksiP; spf=pass (imf29.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713340504; bh=eyDrtd8fUNME9ytWdgxZfVi8GNq/KoV62xE9EnUFfHE=; h=From:To:Cc:Subject:Date:From; b=3yTtksiPCVFoeSAS+27BkLyLucN3NoGrPOyo4ISVg1IdQID/8bNhxbfqx0Y76DQxC zOyFT+u4zHXHXsMsYGTC7gi4LfLyxIirfsTyO4iRNYUgZOpgJxIJHkHIm7/Nxnj1gR kaTL/ceRYWj4T/2XbMCEdUM2jRdMk/ryPlvefbjqix96ZHI2PX4Mm2xgKi/d8EsdTD 3YDdrN2zv/PHEOUtr4eA9Z8nOKdagCyhL/OCQD2kgHBPw5UZ5s//T672VUPwtdy4Ot 3W1JKgwBX0ne2uj0e3VMipN7HhNnaDlpkTN5Dq7t+SPyBggeDyiSIRZTnoVE4HEKc1 r4uf+1xqjCH2A== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 1EEFE3780629; Wed, 17 Apr 2024 07:55:00 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] selftests: mm: Fix undeclared function error Date: Wed, 17 Apr 2024 12:55:30 +0500 Message-Id: <20240417075530.3807625-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: AFCC312001F X-Stat-Signature: tiegp6hsqs7jf1n33cyynpkamcm43mio X-Rspam-User: X-HE-Tag: 1713340505-883257 X-HE-Meta: U2FsdGVkX1/OLOU2dYK+F9P6KCI4/AFggIL9ld15YGWsjISTqxJcIho+xPzvyILbUO/lEo8G6XzcgO5wx602gI3a3FULgN+IHH8DoyL5sVJOKYxzeXE+84lMLNNo2N6jQ3Y0Fmlfj+BKaeOP4QM1cz21LOFQDH68WYBROZ1OZCx81pA4wLAnAapJnKRYUD3eyS1QcDH7ATroNCGUtwt0gg2pwFzrxCVr2xehox+BA20Fse+uKFUNBHckf9+6g4YAd6k1jvpbl6QehzmX0Rd1JrtaCxstEuSEHot7uL6xuj99eOcO5WHjfizLOLfYL7fvQGD0aEW/ns8C68KrZdlDTV3PD1nAu0AonsnRTpN0tDmg/4JJti6n60YIIXgntiu6/USA9SAfHC5x0KS/rGdKqwaxl1Y5IhTzn75ipxK2crkOURJ7ql7eZhtC+SicSGRL6XoYaoIXhl1I5Bxlprx5/c3yv/ovnH8zob2+2hT4pYsC0SDtWsNMgjyi4z8QnGuiB7uqWAJa7Y01lej+6NrzN59PWzycqfpH8NQjxTncVZAUvLhvm5ntBKrC1Uaz8RWtHWYVSMKViZdREVj79VUUn1ga4/eplrsUTR6/ZYrQT9csKU+GFTLgAMDuXNpWUnYmdwHjAKA8TZj1KiAbHF3S6sxcMzI6RYD6SciliZ5NdiU1Pw+DGoOCDm89qwoymvWes6apGNSq0IrYq+Ps7nF2os1WToHaBV+7mfsSEGlTF+dCGCs3h3E335/HNUT00/VGObq9gXh9wQhFEtTrY0+jOyYp++PnmjjG8l9hlHqGQXgp9rLhMz8hFGZgWjAmftpTIB5M954gP7G+VIfA+kFe3YWWF8EEn/xPRJQXKDcDuwpsvpZDfaHDENNqjKhnQy8JfavWt1V9g0R/NCvDx7/Pal34PPJ5yZRWuOrvhywHpexBGejwl0Pi0u/uObFpGdyCjSyMCmoU1Y9jukEk3ly hPk7AO5+ PkqpWJMFb2BdsxQA/pVoMkczchEO92oUoSKr67RttUN1xzKMqscjT5jRKj7pR+EwwxvknBJtA7pLVrPpLhpWIylsa2APcCDQoBs8wLrE1irI8LvSjnRvnmYBQLo+wz/YrlE0XeQqAzvrZcETOd88dOUc/8czQJu+AEJVDQOLxidwAePPYc+auLSp7dIc6pmKanIw9CZX9Z+qgeGXNw2XjoHS0oHQf33Utrjaakl1oFk+cxB8c3ejJPkNczMsEhDRIDHm1a7CoCFQQNywUSUNIdfOzMvBgr/mBNfOzEzVzu93vODLYhIZLB4/zyqvBI//qcNv2 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: Fix the error reported by clang: In file included from mdwe_test.c:17: ./../kselftest_harness.h:1169:2: error: call to undeclared function 'asprintf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1169 | asprintf(&test_name, "%s%s%s.%s", f->name, | ^ 1 warning generated. The gcc reports it as warning: In file included from mdwe_test.c:17: ../kselftest_harness.h: In function ‘__run_test’: ../kselftest_harness.h:1169:9: warning: implicit declaration of function ‘asprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration] 1169 | asprintf(&test_name, "%s%s%s.%s", f->name, | ^~~~~~~~ | vsprintf Fix this by setting _GNU_SOURCE macro needed to get exposure to the asprintf(). Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mdwe_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/mdwe_test.c b/tools/testing/selftests/mm/mdwe_test.c index 200bedcdc32e9..1e01d3ddc11c5 100644 --- a/tools/testing/selftests/mm/mdwe_test.c +++ b/tools/testing/selftests/mm/mdwe_test.c @@ -7,6 +7,7 @@ #include #include +#define _GNU_SOURCE #include #include #include