Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp460013rdb; Tue, 16 Jan 2024 06:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXXK4jm+OsC2YO7sHsy55clsvwUZeQ42IcQGytifvtK8k/Qm/8gnTijK6ss/BFbbrn8iXp X-Received: by 2002:a81:ac59:0:b0:5ff:5646:283d with SMTP id z25-20020a81ac59000000b005ff5646283dmr538011ywj.76.1705413600083; Tue, 16 Jan 2024 06:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705413600; cv=none; d=google.com; s=arc-20160816; b=BulCmlxKI+hxlV9VkxydQhuY/HAzKhZVlPPKGsjagbSIMq7XkEzSGeKLPWP/UYtP6z 00t0U3Y/vVfGGPigR5UlR5zmFX0PYlYJEV+cKU71jCE+DIi/gDqgau7GKoOdtF/RSn2E ZOXLdUZ3wkwpa8lPpvEy1b67YmGikyvIjWvqRc89vZ4o5hU4dt/5grMzaNDXDJJWsfhA a1HBjrHIwxCwSEeT2xCwmKBPG6CAAeLiEcmR0euenmc3yxhASI1UPvu2yVny77Qj1ixX VPg1l2N+ZWcXHjyjgOkBaPQ5I7+XVrYBKpuSW9WBkpJwvVUogfIKQj/Uymnk+zf+NN4T w2mQ== 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:date:dkim-signature; bh=FqhlVC483d/Jp5V2BSEbp0a7wISrFNvy6LiACtWbELo=; fh=cMNnuqV5WLYmfgPWmGTwi8rFSDju2LG6010pY4IegvQ=; b=fs9xtZmfSt6N29bHh4TTB3WXYrsFLWiggs/mxsSxGsWnrDfC4747j5WSqd3tMbzQ5V s6868HiTnXBhOf6ggT/HlnWAFcfT2OWiYt/CviW6MzCg3eDPGrHmjm3znqtYol1vUpl/ bKKabdjWjfB0y8WxD6RI9fWiW6HVBH3Rb6gp2BdMP7kkCn8I0MIzpsrA53PCbJ67XMA0 XIt4iXvV0HGCwOaOqupVxe8uUdfGStEW9se0KuKz0iI54J+utAwJYsqbuGeiVuNdPO8O yLGMbMS8ZAROSfatGGwZOih7vF5ANcb3dPm4F4bQEJ/kanROVkyz70fOihm73CNzzMs+ UBzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DTMfQOaC; spf=pass (google.com: domain of linux-kernel+bounces-27442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27442-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r5-20020a0c8d05000000b0067f2b2b2468si9554167qvb.116.2024.01.16.05.59.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 06:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27442-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=@redhat.com header.s=mimecast20190719 header.b=DTMfQOaC; spf=pass (google.com: domain of linux-kernel+bounces-27442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27442-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CFAD71C23412 for ; Tue, 16 Jan 2024 13:59:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B29571BDE6; Tue, 16 Jan 2024 13:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DTMfQOaC" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 83E961BDDE for ; Tue, 16 Jan 2024 13:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705413591; 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=FqhlVC483d/Jp5V2BSEbp0a7wISrFNvy6LiACtWbELo=; b=DTMfQOaCPyr7xmMQX6fchvGuP6Ftj3FKdOih3/9wrd2QQcc3p8sQ/PySk/nZcsAfh2FhgA jWZWpATIw3+jLnpbgFD9uZQOTRVRx1WE7+G/LuoKyMt2mF/gWimmqCUP98GusZxMF9vgDQ vlUiCkW9V82LBwLAbLZORJBDwwveJJM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-l80-S4AtMuiiBeFQ4oJLsg-1; Tue, 16 Jan 2024 08:59:48 -0500 X-MC-Unique: l80-S4AtMuiiBeFQ4oJLsg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B145385CBA6; Tue, 16 Jan 2024 13:59:47 +0000 (UTC) Received: from bfoster (unknown [10.22.8.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F4193C25; Tue, 16 Jan 2024 13:59:47 +0000 (UTC) Date: Tue, 16 Jan 2024 09:01:05 -0500 From: Brian Foster To: Colin Ian King Cc: Kent Overstreet , 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: <20240116110723.2247265-1-colin.i.king@gmail.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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: Reviewed-by: Brian Foster > ; > > bch2_moving_ctxt_exit(&ctxt); > -- > 2.39.2 >