From: Dave Kleikamp Subject: Re: [PATCH 07/30] IGET: Stop BEFS from using iget() and read_inode() Date: Tue, 02 Oct 2007 13:02:12 +0000 Message-ID: <1191330132.11136.2.camel@norville.austin.ibm.com> References: <963DCFBD-9E68-488E-BD2C-D8B751E65BDF@zabbo.net> <20071001130921.29339.72876.stgit@warthog.procyon.org.uk> <20071001130958.29339.31669.stgit@warthog.procyon.org.uk> <20071001173930.GA7718@mami.zabbo.net> <20071001180601.GA9417@infradead.org> <11826.1191328350@redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Zach Brown , Linus Torvalds , Christoph Hellwig , viro@ftp.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: David Howells Return-path: Received: from e3.ny.us.ibm.com ([32.97.182.143]:52227 "EHLO e3.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbXJBNFh (ORCPT ); Tue, 2 Oct 2007 09:05:37 -0400 In-Reply-To: <11826.1191328350@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2007-10-02 at 13:32 +0100, David Howells wrote: > Zach Brown wrote: > > > /* haha, continuing the fine tradition of terrible names in this api.. */ > > static inline void *PTR_PTR(void *err_ptr) { > > BUG_ON(!IS_ERR(err_ptr) || !err_ptr); > > return err_ptr; > > } > > How about ERR_CAST() instead? Or maybe CAST_ERR()? It's a better name than PTR_PTR(). :-) > > struct dentry *blah(...) > { > struct inode *inode; > > inode = thing(...); > if (IS_ERR(inode)) > return ERR_CAST(inode); > } > > Where ERR_CAST is defined as: > > static inline void *ERR_CAST(const void *error) > { > return (void *) x; > } Of course, the cast is unnecessary, and I'm sure you meant to return error: static inline void *ERR_CAST(const void *error) { return error; } Shaggy -- David Kleikamp IBM Linux Technology Center