Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp415774lqp; Tue, 11 Jun 2024 08:08:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaepAdsBDSlGNvq0S0LIekh3c1mNyALsAMMUL0KY7AquHPSD7Y7pnKnvlcgeNvfKYIAYO5bWfm2Pz+LGgMkWNe73RZQS1u9leevVvrug== X-Google-Smtp-Source: AGHT+IEJG5SR2oD21+WVJUYnA7zIjCSSODWw6RorZAfUE6QOi8USJurvPm/N7wzafIGFMvIiyWWg X-Received: by 2002:a05:620a:1d85:b0:795:38d0:a884 with SMTP id af79cd13be357-7953c31c109mr1129730485a.17.1718118530645; Tue, 11 Jun 2024 08:08:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718118530; cv=pass; d=google.com; s=arc-20160816; b=j0C2KHwX2aWgmfW7PcaH1SbtI8e45Rr2Tl9Ovq5zUUxXrwgkpJo+lfgYwpu15ftBSU 4+DBYdrO6Waft3xvDGHqnCNObD4E7fzH/zmIBNGQSByFIAui9mobSt2JnnHHYjPTDWlN 7wi8wQOmq3i/tjLaXa3RO1RuZPx22hjGGkfQTVawZdmNqD2cRqKi4+DTV1R1kS1I/E12 Zyux5cW9HK0Hv7AhunAJO9929zd5GEC7xl5mkKx6znJfDy/NF/Pa+7cmjY/wHiRByAP0 6kAf6+c3EX53cI1bWUEbWD61XqXaOMDmuThDkgo09ub2OFau+ZKiIKr6pdk10tzZi9jh 2byA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=U1vw+2ACNqWtSlz7WiuesM2J8QxhMf27utzH+YpcgUU=; fh=0i5f//4UEWpZJ3qc6/w5c149RAkOIAeZ4o84xUdupMc=; b=fkzBKes6Kf2DTwZoqlBdzSsBseaLgo1XG44aTyYxPZxqtwLCOaUKpHDxy0Eb1z3XNw T+bywKjdE6V/kOWV2NdLqZMVy796j9qHxB4fDoIX1YLPmCTAj8O+poXahKaK18r12gwz kLJ/8rYNwfCqsBIHFjiI8l452AgONRSFNa7QiK1miwglvl7EjNjBPGk7SIx/eBZnCwAZ uBX2vrqaUzfMTY7RWN6R0cRbrDc5lKg7TZoZtrF1bS8DJAjpEi7OQ1aDpnEQlofhV3Cd Q63J9gRHY1D1uIbvNahsmZ5geleV7k1a+dl7qxDpxEDj3VJmELH341NSesoGytB4GuOz wcbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=f2YWHNa+; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-797d55a545asi175268785a.46.2024.06.11.08.08.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=f2YWHNa+; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EB0B71C24638 for ; Tue, 11 Jun 2024 15:07:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 226A85731B; Tue, 11 Jun 2024 15:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="f2YWHNa+" Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A372651016 for ; Tue, 11 Jun 2024 15:04:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118270; cv=none; b=RaaHPHmfgeQX3DHpWmyL6rIx8ViH7jO1O48zjlsFwW7nBIgMB2/EtCnoNnKqlbR5rAK079nDrCwkLxFvV0VyPL9rdno86vcv00p/B5xhfBKtPxmKwQ+IQYIgZqrUcB18AxLs9O0UQ51MKAfKu4qWY/H067tV7EcUKkg9vb0Lnpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118270; c=relaxed/simple; bh=AkUd3nITwa1Nsrx5FGIDh+oFc9gDF9r3YGUNfEDGOdc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ktH/zHvPAI0Tpg9BXDSMLVNOwbtBgSmJ1jZ6G9nvmytpaQPgSYjM1fhT6e9kKsS6v8GxVH/2eelYVpGkQL1oyMwCbPIRZci/PSig2zRJU2eR+UvMlgaFMvt5twdAjOgqjmRYJx4bbzuIr0M6qiz1vbdaHQrkGQHFKorwFweqmko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f2YWHNa+; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3d22323a3ccso169336b6e.1 for ; Tue, 11 Jun 2024 08:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1718118266; x=1718723066; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=U1vw+2ACNqWtSlz7WiuesM2J8QxhMf27utzH+YpcgUU=; b=f2YWHNa+NzKq6p06NcHmTrhmFPxBNtf57gmsdOhfH8ZMkjt7WXez7KiFFABFba2guQ E7R9Hk3EWcEqvvov7f37ydSrEy0UyhahCv+hphrtrbf/ghRwesyD9P3jOjFUKYTuFWkb 5VyPBtCQk4a45pX81xHF894pzb9xnol4pxoRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718118266; x=1718723066; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U1vw+2ACNqWtSlz7WiuesM2J8QxhMf27utzH+YpcgUU=; b=swf5SZzoE7Bsc+/079Sv5WufdesauU1qY5LpQtn2pxBwXpc/GezesOKoYfRt2D+lpt nXfagP910J3LoOHQtwP3CIien6puhnMuexyEXejsnqELculpAPLuKvJEXj1CFunlUMII EMk2c3bTIeD8VBC3DkCrakXAz3qC5YVrAFWyGHMdsAV8s/bAJpdIYyMCWFPI4aOvZ79M nV8lYwMtDMIEQQDYt34Io1lvF3b/Zfxoo1d2EpNTNJOJfN9ezNtJsG8VKY270IEw0vr/ Xff2d9sP+KNUJ6ArHcR5j0BIlMU9SjF9DyebedGVNZEDJCOSo9MQqlBXI3va6U10t/vh oKlw== X-Forwarded-Encrypted: i=1; AJvYcCVZgRrILmEg5FOhcl1CBCiokMpnW+4D8xULQyFAJsM/qZ8CTUF+uU7fSjDOk+taLc2dDi0nv2JZNogRz6ir+LwLR1hzQ9L53+JQqYKu X-Gm-Message-State: AOJu0YwbbySN81iGARlNtZAyOG4/+8MRNue9ptlK1Qjd44FfF1Lbh3W9 +c1gUqMtLdyubVTIXwLKIDB/vq3bnVQGgF0fa5aMcAoGu+A2h+tfiGowi5l01pY= X-Received: by 2002:a05:6808:1b08:b0:3d2:2356:d271 with SMTP id 5614622812f47-3d22356d368mr9188713b6e.1.1718118266435; Tue, 11 Jun 2024 08:04:26 -0700 (PDT) Received: from ?IPV6:2607:fb91:213b:a129:544a:cc06:ea0:4045? ([2607:fb91:213b:a129:544a:cc06:ea0:4045]) by smtp.gmail.com with ESMTPSA id 00721157ae682-62ccacadc00sm20643537b3.1.2024.06.11.08.04.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 08:04:26 -0700 (PDT) Message-ID: <0556ee55-6bdf-4392-8933-03539768f671@linuxfoundation.org> Date: Tue, 11 Jun 2024 09:04:24 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: proc: remove unreached code and fix build warning To: Alexey Dobriyan , Andrew Morton Cc: Amer Al Shanawany , Shuah Khan , Swarup Laxman Kotiaklapudi , Hugh Dickins , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, Javier Carrasco , kernel test robot , Shuah Khan References: <202404010211.ygidvMwa-lkp@intel.com> <20240603124220.33778-1-amer.shanawany@gmail.com> <14f55053-2ff8-4086-8aac-b8ee2d50a427@p183> <20240604202531.5d559ec4daed484a7a23592c@linux-foundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/7/24 09:25, Alexey Dobriyan wrote: > On Tue, Jun 04, 2024 at 08:25:31PM -0700, Andrew Morton wrote: >> On Mon, 3 Jun 2024 17:24:47 +0300 Alexey Dobriyan wrote: >> >>> On Mon, Jun 03, 2024 at 02:42:20PM +0200, Amer Al Shanawany wrote: >>>> fix the following warning: >>>> proc-empty-vm.c:385:17: warning: ignoring return value of ‘write’ >>> >>>> --- a/tools/testing/selftests/proc/proc-empty-vm.c >>>> +++ b/tools/testing/selftests/proc/proc-empty-vm.c >>>> @@ -381,9 +381,6 @@ static int test_proc_pid_statm(pid_t pid) >>> >>>> - if (0) { >>>> - write(1, buf, rv); >>>> - } >>> >>> no thanks >> >> Why not? >> >> Why does that code exist anyway? It at least needs a comment. > > OK, whatever. > > If test fails, it better record buggy output somewhere (to coredump or to terminal). +1 on reporting results - the best way to do this is to add a meaningful message for users to understand what went wrong. Please suggest how you would like this warning addressed and report the error. thanks, -- Shuah