Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp558214rdb; Tue, 16 Jan 2024 08:33:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc3fl9xXGbJUVPngBYdH+DLGjE5nVpjQSmyXFVqTdFoS0grXPaSmil/Hmq6iZRcFhfFteI X-Received: by 2002:a05:6a00:4f88:b0:6da:cdff:840 with SMTP id ld8-20020a056a004f8800b006dacdff0840mr9862309pfb.18.1705422830004; Tue, 16 Jan 2024 08:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705422829; cv=none; d=google.com; s=arc-20160816; b=B0YOozKZzhKdO3eE4GNgG76bjb59/IdminlYmtizEnY9Waous1tdGM7gspRWLIT6qD k0HdBEuYZvHC914uq3u+nk/z1yENhQBcu4kVOa2gtbBLPB/fA7RI2dFXJGjHIusmcZZb nwx/NpsoOsaard6lFTnoxPEZL2UlgQSmh8u5uO1E5Y66ie01nlTxU1V37a2VF3KMVa/J pRB4UN1RpNOMW2P3IeComsdsj0RrrF2lS2N/+k/Asb3HZBzrrgHlW6DHk9D37gScYQVb ziQYcrcU25SpT6KOYKL+oJs1Hs90DAClfmV84O8MMo/CS1pyRX9H39BHiOPVshyQAlMz 1qZQ== ARC-Message-Signature: i=1; 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:dkim-signature:date; bh=Nmg3GNzcBPYLObsoIfvSxUxLh5vptfBkI448dFbt8lE=; fh=WhNBQaFcN4QksYY6ZFtoMCWBU98FoOtN5S2gCCO0B+A=; b=LTMkQK2JKZEEwlfFhMuRDPbI+jlMsW853V5WUWuD6u9JsksfiPp1yiYlasbINgRvHH elA+SBGmtmE9zoowdpQ46+Jp6ewrsFp3qx5zEJ+IiiwHgZq/dFzfE11kbDRATzzDKJHr 8rWHtDzvOrPicXMSvhrbLSre4E2RcMSCpGqtIsoDzDVJ7Ivw5KcV0K38zDcNR6NgTILI ApOJY30iy+vYjPHwztH9xZVB9QF753yTnE1XeGQpCQ2ylGuPM0lWfu6M1oHdd5wf8uWT +cuSKZ+KpdJdLLMC7lXQTFDINZ7xQEx0Qn0qox+1XyueuRFnew6U4vUCtoEGovx+Hc03 zAeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=j4+aRxFd; spf=pass (google.com: domain of linux-kernel+bounces-27578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ka20-20020a056a00939400b006d6faec9bf6si11686020pfb.13.2024.01.16.08.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 08:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=j4+aRxFd; spf=pass (google.com: domain of linux-kernel+bounces-27578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 0C722280C53 for ; Tue, 16 Jan 2024 16:33:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B613E18E06; Tue, 16 Jan 2024 16:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="j4+aRxFd" Received: from out-185.mta1.migadu.com (out-185.mta1.migadu.com [95.215.58.185]) (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 2B5264411 for ; Tue, 16 Jan 2024 16:33:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 16 Jan 2024 11:33:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705422815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nmg3GNzcBPYLObsoIfvSxUxLh5vptfBkI448dFbt8lE=; b=j4+aRxFdAqzj7afHUsSGmCZkGwuFsGL9Rin5g+/GIY1r1mb1khkvEhsfUHIyHIEh3B5VZK hRSGCvbE5bGVGw+o+ANcHYMj9VMFnMK5TSR/43ZwqPdhYiGP3mAEq4IGYLGeNOES5tK8Gh qij/C9YTh6Gi/+3l5ZG7Q1JelykPRWw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Brian Foster Cc: Colin Ian King , linux-bcachefs@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] bcachefs: remove redundant variable tmp Message-ID: References: <20240116110723.2247265-1-colin.i.king@gmail.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: X-Migadu-Flow: FLOW_OUT On Tue, Jan 16, 2024 at 09:01:05AM -0500, Brian Foster wrote: > On Tue, Jan 16, 2024 at 11:07:23AM +0000, Colin Ian King wrote: > > The variable tmp is being assigned a value but it isn't being > > read afterwards. The assignment is redundant and so tmp can be > > removed. > > > > I assume this intends to refer to s/tmp/ret/ ... > > > Cleans up clang scan build warning: > > warning: Although the value stored to 'ret' is used in the enclosing > > expression, the value is never actually read from 'ret' > > [deadcode.DeadStores] > > > > Signed-off-by: Colin Ian King > > --- > > fs/bcachefs/rebalance.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c > > index 95f46cb3b5bd..827316a27431 100644 > > --- a/fs/bcachefs/rebalance.c > > +++ b/fs/bcachefs/rebalance.c > > @@ -385,7 +385,6 @@ static int bch2_rebalance_thread(void *arg) > > struct bch_fs *c = arg; > > struct bch_fs_rebalance *r = &c->rebalance; > > struct moving_context ctxt; > > - int ret; > > > > set_freezable(); > > > > @@ -393,8 +392,7 @@ static int bch2_rebalance_thread(void *arg) > > writepoint_ptr(&c->rebalance_write_point), > > true); > > > > - while (!kthread_should_stop() && > > - !(ret = do_rebalance(&ctxt))) > > + while (!kthread_should_stop() && !do_rebalance(&ctxt)) > > Part of me wonders if this was intended to return ret, as that appears > to bubble back through kthread_stop(). That said, we don't check for > error there either (i.e. bch2_rebalance_stop()), so this seems > reasonable enough to me to address the warning: yeah, the only reason to return errors here is to log them, and they've already been logged at this point. Thanks, applying this