From: Jan Kara Subject: Re: [PATCH] ext2_free_inode(): remove useless call to brelse() Date: Thu, 8 Apr 2010 11:57:48 +0200 Message-ID: <20100408095747.GB20488@quack.suse.cz> References: <38b2ab8a1003260607p42382139te0be1a4ba4b3b8bc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Francis Moreau Return-path: Received: from cantor.suse.de ([195.135.220.2]:48101 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758476Ab0DHJ5j (ORCPT ); Thu, 8 Apr 2010 05:57:39 -0400 Content-Disposition: inline In-Reply-To: <38b2ab8a1003260607p42382139te0be1a4ba4b3b8bc@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri 26-03-10 14:07:00, Francis Moreau wrote: > This patch removes a useless call to brelse(bitmap_bh) since at that > point bitmap_bh is NULL. > > It also converts the last brelse(bitmap_bh) into a __brelse(bitmap_bh) > since at that point bitmap_bh is no more NULL. The cleanup looks fine. Only I'd use normal brelse instead of __brelse at the end. The compiler should figure out itself that the check is unnecessary (if not, the cost of extra test is negligible in that path anyway) and you don't have to think twice when looking at the function. Also you don't have to initialize bitmap_bh to NULL after your cleanups. So I've taken your patch with these two minor changes. Honza -- Jan Kara SUSE Labs, CR