From: Jan Kara Subject: Re: [PATCH -next] reiserfs: Remove unneed check in reiserfs_write_full_page() Date: Mon, 24 May 2021 11:01:23 +0200 Message-ID: <20210524090123.GE32705@quack2.suse.cz> References: <20210523090258.27696-1-yuehaibing@huawei.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1621846884; h=from:from:reply-to: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=KyNpmtPVi73FGeb1l6Zw5sAifVTsA3JabmYau6KyfuA=; b=zYsYVoH9VhNWsgDUh6b0ZYXw8eSMiYym0dV2eQNI2KQ84vV9jxPPQl49oiqCU1SnZ3WX8o ZcvAhdkn8jL3KlUQpWNkWQ/vQeJk6crxekCclW49tydOB7YFezPMI5Y8joOOj7E46jKAkL ownrc28Lyzuo1o0sjz7CzY/9ZsKj53o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1621846884; h=from:from:reply-to: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=KyNpmtPVi73FGeb1l6Zw5sAifVTsA3JabmYau6KyfuA=; b=D89WDl5h/v+pyiNg2DvJVSqEzUzc4N+HStDLgLaKamYvZBqb9L4XDtVqpBqqFzlp67Xj9X wmyudGcgk2hOJNAA== Content-Disposition: inline In-Reply-To: <20210523090258.27696-1-yuehaibing@huawei.com> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: YueHaibing Cc: jack@suse.cz, reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org On Sun 23-05-21 17:02:58, YueHaibing wrote: > Condition !A || A && B is equivalent to !A || B. > > Generated by: scripts/coccinelle/misc/excluded_middle.cocci > > Signed-off-by: YueHaibing Fair enough. Thanks for the patch. Added to my tree. Honza > --- > fs/reiserfs/inode.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c > index 780bb90c1804..f49b72ccac4c 100644 > --- a/fs/reiserfs/inode.c > +++ b/fs/reiserfs/inode.c > @@ -2584,9 +2584,7 @@ static int reiserfs_write_full_page(struct page *page, > clear_buffer_dirty(bh); > set_buffer_uptodate(bh); > } else if ((checked || buffer_dirty(bh)) && > - (!buffer_mapped(bh) || (buffer_mapped(bh) > - && bh->b_blocknr == > - 0))) { > + (!buffer_mapped(bh) || bh->b_blocknr == 0)) { > /* > * not mapped yet, or it points to a direct item, search > * the btree for the mapping info, and log any direct > -- > 2.20.1 > -- Jan Kara SUSE Labs, CR