Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1519022lqp; Mon, 15 Apr 2024 08:41:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUD+YPF357xV1sJjs3EcVBR7GCD5N0Mq061jLzxIm6GSi1aLejCzuT65LsE1Fq3pPqyy/hYENTDSWY0yWtN4bML7Mh4MQk6av+8ERxWwA== X-Google-Smtp-Source: AGHT+IHmDpFrbGsZv3UzS3mIKFZvoWzfRfzweNFHd3mryYOUmbhlE5F3zMhzVx6sFwucrqtgwFbj X-Received: by 2002:a05:6a20:6a20:b0:1a9:22b9:754a with SMTP id p32-20020a056a206a2000b001a922b9754amr10444633pzk.7.1713195676221; Mon, 15 Apr 2024 08:41:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713195676; cv=pass; d=google.com; s=arc-20160816; b=ZTp+NachK6alwj48800/J01ZLBDK9v9LcKZ2xTHYPPfeoOdlbVyS7mjmYg9+LUCw8M 33VGPTBJLWY9ceWs4kpQzLj3HGGimhXNQCFOvrAx9QyXEobuSTgajan51y5kht0b55gi tdm8Z4eY7S5b/L+xAlnXCX2+7nIdoMfdz3f+s75/bK+U4vhRItAkNrVpU4KcXdx9BEdS WwyjKnhiQMdHtfmX4Zx5yxLtryka2Pqc2h3iw4s4YsH7Ubfv1QWwIhm2hT+KfzybTlCY fk6iJcelD3Iu3qEUl6oQNyW5FWVNUKtBFzeZKAVhRqZszzxRckvm92Aa2/Anc87PFL8T mEnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=w/R1VscH3TE1Jc63za/sixCPkrp6m6OHHYirJrpeeN0=; fh=qFMI7Nhcz4h8HKQxPzDTKEcWQ5gT3QoHx5Ikk9n6XGk=; b=Wc/9fNcrDSGmcWAcS3sdGUTt9rZ85QCTYjCKYcjVpOFjGKbl8zgyqjJJMZNpod9aou 6l7pPup6eEsUDjO/96z2aZldx5l1nZWAPePqLk+pDulBVp9DdT+Hl6LfnzKhqzK52mXI zcD8e3U6uv48LFBa6cksbUISx1BAAaN/y/t2Nwzn8GqAbqLXVJKYiiGIy0AfGgsZBMS3 aUKxz1OVCiPvjm3qER6ukiOpZOLQRPnkXAjD9dbJZBek75ukPY2MheJH8tiJBUbVbgr6 3qH+FrB1tryiOvAurWKWF6n/JfcMTJGwIvx11LwQESC+WVY4kL/2/lpNJFyNDxIxnW62 BKyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HCY/+aPN"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145477-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fb35-20020a056a002da300b006ed5655a03csi8232458pfb.125.2024.04.15.08.41.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 08:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145477-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HCY/+aPN"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145477-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DFF1928374C for ; Mon, 15 Apr 2024 15:41:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07F3B7A724; Mon, 15 Apr 2024 15:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HCY/+aPN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D31529414; Mon, 15 Apr 2024 15:41:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713195670; cv=none; b=SfcWY8DshH3Dw8jX1SuxGiM8tHHbL5BaIq1+llL/BJs8E8Alj2MBAe9IhvH8Q45mwSvM3V04B8OkVoPk6Bqqo/yw/rXJFluColOMpZTDnWx3G1TY3NwrnyO14X2nO/Ub3E5ZQRAfczdk5CSmrzvCwL3V5aIi2xBZQtP0lfOzKEw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713195670; c=relaxed/simple; bh=N2K0841GuIJ8SV/t+zW+SSNdUh4znSgAVrClu7AbEKA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OKN29OQw20apaVWaEh0raW3GYe6Y9rXOexyQ8z1tobha4DcaUj3l8TBmXRjsVoQVZGw2T/3QH60KH6C6rD8NK+dbhYz4q07mBIeiIdVvC6q8j1+5j81bDmECnN5CYnnJKc9RPtYZAh2qkqo/Rs8jI6B9LszvhUH0XSi2itn2y/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HCY/+aPN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13F40C2BD10; Mon, 15 Apr 2024 15:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713195669; bh=N2K0841GuIJ8SV/t+zW+SSNdUh4znSgAVrClu7AbEKA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HCY/+aPNDzJ3kJ0ach2dL/tLmcZjIQh+avVO7xzHj1/b2dgaU+m8zBywLawHqUTid Xk5dnjF85kQCG+Vxq49+wj9+qoNNF+j8YbexTvtUrW7LWE37UGgLM1Q0OrH/sujYTB kEwHOh5+tu9UTJEGwgCeRBvfyJ9CYr6QJuVNr54i+U9etjkKf5fea/8wRcl5TY2W9i lN4u3LYkAEGJDwZOwJoyQkMgIAqVfVEEF3Oi5TDeFLipa0vnK5uVRXAbAutJ1ZDWnC TtWt1ppQJUeKPo0dzmjvuRiPxC6vDJ9yBN5iK/NYa3Iu4K8B7JZXjj6TYyKsPbuXfp 5HJuEnQIk2MdQ== Date: Mon, 15 Apr 2024 08:41:07 -0700 From: Nathan Chancellor To: Muhammad Usama Anjum Cc: Shuah Khan , Nick Desaulniers , Bill Wendling , Justin Stitt , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] selftests: Mark ksft_exit_fail_perror() as __noreturn Message-ID: <20240415154107.GA1538232@dev-arch.thelio-3990X> References: <20240414062653.666919-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240414062653.666919-1-usama.anjum@collabora.com> On Sun, Apr 14, 2024 at 11:26:53AM +0500, Muhammad Usama Anjum wrote: > 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 Reviewed-by: Nathan Chancellor > --- > 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 > >