Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp803141lqp; Sat, 13 Apr 2024 23:26:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEJ1RT7vgwOQqixrkpH9SU10IQDTV6v0+yJOWd1CCkiAb6kyRYaJW1tLSLpznJfgj08tzcIh7UtmXYekISI7ZUyCJnvkN+Zi4D+E4Xjg== X-Google-Smtp-Source: AGHT+IGYfiZKGa1pzwkH90WBOLwqHnT0iWIDyYzE01Mpeaj21Lwl2i5OF7cGZaOZ8o15tN8U+63D X-Received: by 2002:a17:902:e544:b0:1e2:b75e:37a9 with SMTP id n4-20020a170902e54400b001e2b75e37a9mr9521742plf.61.1713076013035; Sat, 13 Apr 2024 23:26:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713076013; cv=pass; d=google.com; s=arc-20160816; b=DBGEe3ZNJjLsiIfIfQmUBSujz1ZtgFtSzK2SLltl78cQqpVKF3VatACF+sBR2FGvLj QMKQxUdgmFXa6qqpxMpryqq15XkzQgBWWAPpeQgVUZ/Gr/frvohNX/uQKz7gYa5CB/7j cFuC/OAf3RNhoNAeyBUbFYSzVX1bEQM/wIrCpBk0scQuIH3Q6cbV/2uo4hBy10A/NT9A 3NUBwQDAkO88yv4FI7z7MaBfCBexF0IJmZpYxpi2TW99LbnoPoZdANn2cfRcZGci0luS 4YlhTnSeeAw3zhOn1WgzAAZKM2lYuAdc6kVR/7TJVsFuN4SsdU5Vn5B3Y6Rvd395q1ZY 8ExA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=KM/1YmJa/+QglaGUqpNBH0eHp8KH2gtwJPzLq/W2fGg=; fh=7g63tUi21USbfq1JaO723Z6rMq9AigOlEG29fMNgps0=; b=B1J2ijqvSwDK1AY9sPoTbCHQ49M8EFfnh1dasImPNVBpKiBRchBoJ2+a8BREDS2c/w 9Xd/00a+o2jC5Bs1NMbujm2fmUvQLAmfZ/Ae9qR0cuxOIFiWANxN/gASC3LE6aFdho2n zgse/mZ6vaylOaDyMPLqMO8rDJg3ofZYZc+q6nh6f2+BrvuKm/VClUdfQlOvL3iVfnkN FirTdxpLz0KJZSfO9D8WX2mLAa0ibaYVG9GvOMO2oeZ0VtnQ79AijEK6t1EtbJsM1frw o72/T19TcaLXo91dnVlnZOzMLw/BeDcqi5MhGgAzBYSXV2auHYRyGycPT8HL7Ds0bjst GKdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=wW6aXA+N; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-144002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w18-20020a170902e89200b001e3d3ae4d74si6091141plg.28.2024.04.13.23.26.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 23:26:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=wW6aXA+N; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-144002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5CF56B210AE for ; Sun, 14 Apr 2024 06:26:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BD341CAA8; Sun, 14 Apr 2024 06:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="wW6aXA+N" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 406801BF35; Sun, 14 Apr 2024 06:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713076002; cv=none; b=rQPO3dM0AHQMH8slv1uJaR6Yncn+PfaCmJWgZ7kEji2gFkNae6b+k2BgVgAaRlKvAQYAAgON3sJVmwUf4H/CnaJayNWL4kkEmNimRk0EaV6Ji2W2RDUprkcIDQvvzcCO2MsscfNyDvVAPi5lDaNafZAX/dby3uDPnp48Q5xgL4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713076002; c=relaxed/simple; bh=32hefK5w2vixpj4ztrF6kNZlbFfsN97FKuhX9UHWdHQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=dkDpT8zy1HVBhfjWT37Y8lMI/0efE/5DmYNYRk3YrbiQQK5vfNJS2brre0USg3ywiSrApOj5wvCePVHDW00mJOHvCB04C4lOqD/IvpjzbAkhq+uurR15IJk1o2dTgOXhR5LdDGhCNefKExZeTjLq04Zr4Y6xvwh8uoviD8gb4Nk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=wW6aXA+N; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713075993; bh=32hefK5w2vixpj4ztrF6kNZlbFfsN97FKuhX9UHWdHQ=; h=From:To:Cc:Subject:Date:From; b=wW6aXA+NtlGzcqNL+Eufq/ez8kViP+T+S/wz7eoaLyAYY3VvF/lw50OkwCDp+nAes QrGFKCnrSezT661irTwjH6MFZ4M9F19cRErnltLF+Xz37ahfhswSFJqOdFaL2N7cXt eAnFpZ8s+xuZI0UOOx0MYtJgkbKIuC2XMZdSYHXj873uaXaVF0RjEPRI+gXdYizR5w dq+0zwnDw97OYTpcNr/BBBVTtuJlkCH/jfS7kqIH0Or1z8p/ETLsOLt5ugiJ3tvUM5 K8oWfLXdP79INLzNL4YgaqCpgj9h1huRoWFCp4bsZOM/AvgJTn4E3HbyfRqgtcSfEN ro8U24LnPHqNw== Received: from localhost.localdomain (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 33CCA378042B; Sun, 14 Apr 2024 06:26:28 +0000 (UTC) From: Muhammad Usama Anjum To: Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] selftests: Mark ksft_exit_fail_perror() as __noreturn Date: Sun, 14 Apr 2024 11:26:53 +0500 Message-Id: <20240414062653.666919-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Let the compilers (clang) know that this function would just call exit() and would never return. It is needed to avoid false positive static analysis errors. All similar functions calling exit() unconditionally have been marked as __noreturn. Signed-off-by: Muhammad Usama Anjum --- This patch has been suggested [1] and tested on top of the following patches: - f07041728422 ("selftests: add ksft_exit_fail_perror()") which is in kselftest tree already - ("kselftest: Mark functions that unconditionally call exit() as __noreturn") would appear in tip/timers/urgent [1] https://lore.kernel.org/all/8254ab4d-9cb6-402e-80dd-d9ec70d77de5@linuxfoundation.org --- tools/testing/selftests/kselftest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 050c5fd018400..b43a7a7ca4b40 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -372,7 +372,7 @@ static inline __printf(1, 2) int ksft_exit_fail_msg(const char *msg, ...) exit(KSFT_FAIL); } -static inline void ksft_exit_fail_perror(const char *msg) +static inline __noreturn void ksft_exit_fail_perror(const char *msg) { #ifndef NOLIBC ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno); -- 2.39.2