From mboxrd@z Thu Jan 1 00:00:00 1970 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 4901FC433F5 for ; Fri, 19 Nov 2021 23:35:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0E2D6B0071; Fri, 19 Nov 2021 18:35:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B96006B0072; Fri, 19 Nov 2021 18:35:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A37946B0073; Fri, 19 Nov 2021 18:35:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 9123B6B0071 for ; Fri, 19 Nov 2021 18:35:43 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4F7A31850DD22 for ; Fri, 19 Nov 2021 23:35:33 +0000 (UTC) X-FDA: 78827288946.28.02A02C0 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by imf23.hostedemail.com (Postfix) with ESMTP id 2B410900038D for ; Fri, 19 Nov 2021 23:35:29 +0000 (UTC) Received: by mail-oi1-f177.google.com with SMTP id n66so24663368oia.9 for ; Fri, 19 Nov 2021 15:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XRzO0YvFGAtk5YREG47xrVTYPSFw40hn1uKe/8jJr+k=; b=ApZC2sLye9kxqGuPPP3rFlzbGoT4LoJhYKWVJAXC0aFTIRQNWKmpCp/ld3fNP9zQU1 c/fucWMqyWFKXfXOXrnHk8ML/iSWCIOoDn2OJn9EAHQPdftRyf1EiuM2OKsV7Mzdatm/ rEWWnx1qUxOgVjteffpcWfHsILng4QueB1tFk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XRzO0YvFGAtk5YREG47xrVTYPSFw40hn1uKe/8jJr+k=; b=togPZVW+Uo44ZOD8NUga6i5H3Iq1wlkTOeH4J7tdBlgAZzoUqNsZntpG03reWoWzj8 Sm+VKFWpr71g4jCnvInoDDQPVni7plWxWGl+58H/kU4xJjITGj2JSPYGhpqDvpMbmIyr ZaYQSMuCAT7VprpbOencklku+FHewbzDWuhFbNusYiwMehs1DxZHn06BQ1HRZLZ6xvr5 i+X6epkn469FicDaTLd21/fmclQjvHwZw+IFZBHAvMJfW0v9jmZTSgPK6bBkeFgNzFtw Vnezs+ewNWDNhC3sbuarCqJgu4I5UjQnMkvprJuhe7/D9bAGtFqNZElOqdKRolpD0bT/ 3xiQ== X-Gm-Message-State: AOAM5339A6hfRJg6T6Hp+ekRbtt76blCrvUBNrfyE/8sTREBNnBE9YhX b1yLEPts73sB1PDHwxb9NuYuDg== X-Google-Smtp-Source: ABdhPJw67Npt7XkzT6Hjk/qatZCYLdRp17IOT0NWtd9/vmynrsOX2X4guiM/e1r1V1/iqrkJ5LsODw== X-Received: by 2002:aca:d05:: with SMTP id 5mr3476846oin.142.1637364931960; Fri, 19 Nov 2021 15:35:31 -0800 (PST) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id c9sm271619oog.43.2021.11.19.15.35.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 15:35:29 -0800 (PST) Subject: Re: [PATCH v3 1/2] selftests: kselftest.h: mark functions with 'noreturn' To: Anders Roxell , shuah@kernel.org Cc: fenghua.yu@intel.com, reinette.chatre@intel.com, john.stultz@linaro.org, tglx@linutronix.de, akpm@linux-foundation.org, nathan@kernel.org, ndesaulniers@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, llvm@lists.linux.dev, christian@brauner.io, Shuah Khan References: <20211118095852.616256-1-anders.roxell@linaro.org> From: Shuah Khan Message-ID: <02a096ba-ed6e-4728-c6c1-1b6597ec062f@linuxfoundation.org> Date: Fri, 19 Nov 2021 16:35:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20211118095852.616256-1-anders.roxell@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2B410900038D X-Stat-Signature: xhmk8b1smqui99xdfxx6x67u88s4nh76 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=ApZC2sLy; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf23.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.167.177 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1637364929-995170 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: On 11/18/21 2:58 AM, Anders Roxell wrote: > When building kselftests/capabilities the following warning shows up: > > clang -O2 -g -std=gnu99 -Wall test_execve.c -lcap-ng -lrt -ldl -o test_execve > test_execve.c:121:13: warning: variable 'have_outer_privilege' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] > } else if (unshare(CLONE_NEWUSER | CLONE_NEWNS) == 0) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > test_execve.c:136:9: note: uninitialized use occurs here > return have_outer_privilege; > ^~~~~~~~~~~~~~~~~~~~ > test_execve.c:121:9: note: remove the 'if' if its condition is always true > } else if (unshare(CLONE_NEWUSER | CLONE_NEWNS) == 0) { > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > test_execve.c:94:27: note: initialize the variable 'have_outer_privilege' to silence this warning > bool have_outer_privilege; > ^ > = false > > Rework so all the ksft_exit_*() functions have attribue > '__attribute__((noreturn))' so the compiler knows that there wont be won't be > any return from the function. That said, without > '__attribute__((noreturn))' the compiler warns about the above issue > since it thinks that it will get back from the ksft_exit_skip() > function, which it wont. > Cleaning up the callers that rely on ksft_exit_*() return code, since > the functions ksft_exit_*() have never returned anything. > > Signed-off-by: Anders Roxell > Reviewed-by: Nick Desaulniers > --- My commit script failed due to checkpatch warns. Run checkpatchp.l --strict to find the problems and send me v4 thanks, -- Shuah