Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2604423pxj; Mon, 10 May 2021 06:51:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCn7YOLQDWnch6/gQt/UAIb1sFHFwv8P7gqsq+QlKLRpSYcUvjwaaaT6YxDjOZVmH61df5 X-Received: by 2002:a50:ee86:: with SMTP id f6mr29659518edr.154.1620654700727; Mon, 10 May 2021 06:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620654700; cv=none; d=google.com; s=arc-20160816; b=kIzZr1hqGWvuNHx9slC1D/rd8FFnGxKMm6wP+x9CMgWwSbpDeVhWABy+GKg5k/VVUu o+j1HPU0yoMS1cczoVwGV6p+iIx1M9ZmQRCC+8OBFJ4Kz6355dCBQSUX5dC2LoyJtZST B2c+LSaYXQGjiI025GJQlnRhCm1YOXoungJ4ZGHExFzDGkLq1beAGv0aCU9SX2OEQyIs UT/oZLOw+otnR8VmczWozMmUWH8aOn8myEPfz8/6znBA6yW0bxiXSOLlzbOelTa3kH9g GQKHWItr+0kJfBAFzYeith7UF3TRYXQHNjwjEfUzLgHOgMM0uxO42Lgi9l3LuIl5yvJP OQ6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=D5pVHxCq7we3YYmwUSfUvrLBxCKjJNUz9a/CQBrYn7Y=; b=XKza3Bib2Yfg1z8055JZyF8choTBrDWaXgWUGH1KCBNhXNfYIVtD0+Dj3omo44AcrE fCeXBCRtPiuj8ww5HaESBwJysJJjaXOOi8nMcJ6DSwodPdAoVgcWqp621pmfI0yyPJUW jAH7ax17qUffmLeSvKmVQVyKiLTm5Ccyoaq4Zm1xQVJ008f6ZsoIZ4oK5N2GF+20Uusa m0skd7lVvdiZuN5Odeltn9f8wXLuZPJsBScVFxrBJ9/CCOKMy5ndf5jbpbS50JIU8kP9 hkWavojkTVVEX2Pyvi4f1ohZ0qnsA7Yu88mFs2rxwu8mrAdIIMN7nxhltDOg2Qm7cbnV FYag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si13961563eja.369.2021.05.10.06.51.17; Mon, 10 May 2021 06:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240193AbhEJNuC (ORCPT + 99 others); Mon, 10 May 2021 09:50:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:51552 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241357AbhEJNor (ORCPT ); Mon, 10 May 2021 09:44:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1CEF1AF33; Mon, 10 May 2021 13:43:31 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 49BE9DB226; Mon, 10 May 2021 15:41:02 +0200 (CEST) Date: Mon, 10 May 2021 15:41:02 +0200 From: David Sterba To: Jiapeng Chong Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: Remove redundant assignment to ret Message-ID: <20210510134102.GV7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Jiapeng Chong , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <1620470329-27792-1-git-send-email-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1620470329-27792-1-git-send-email-jiapeng.chong@linux.alibaba.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 08, 2021 at 06:38:49PM +0800, Jiapeng Chong wrote: > Variable ret is set to zero, but this value is never read as it is > overwritten or not used later on, hence it is a redundant assignment > and can be removed. > > Clean up the following clang-analyzer warning: > > fs/btrfs/extent_io.c:5357:4: warning: Value stored to 'ret' is never > read [clang-analyzer-deadcode.DeadStores]. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > fs/btrfs/extent_io.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index 074a78a..cea58be 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -5354,7 +5354,6 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, > goto out_free; > if (ret) > flags |= FIEMAP_EXTENT_SHARED; > - ret = 0; This leaves the scope where the value of 'ret' has been used for something and it's reset to 0 for clarity. This is a pattern that we use and will not change it just to silence clang analyzer.