From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zach Brown Subject: Re: [PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5] Date: Thu, 25 Oct 2007 16:09:09 -0700 Message-ID: <47212215.8080003@oracle.com> References: <20071025163352.5057.59344.stgit@warthog.procyon.org.uk> <20071025163357.5057.35399.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: David Howells Return-path: Received: from tetsuo.zabbo.net ([207.173.201.20]:40563 "EHLO tetsuo.zabbo.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754400AbXJYXJJ (ORCPT ); Thu, 25 Oct 2007 19:09:09 -0400 In-Reply-To: <20071025163357.5057.35399.stgit@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org > + * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type > + * @ptr: The pointer to cast. > + * > + * Explicitly cast an error-valued pointer to another pointer type in such a > + * way as to make it clear that's what's going on. > + */ > +static inline void *ERR_CAST(const void *ptr) > +{ > + return (void *) ptr; > +} Just to nit, surely you don't need the cast inside the function. The casting happens at the call site between the argument and returned pointer. - z