Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965106AbXADWS3 (ORCPT ); Thu, 4 Jan 2007 17:18:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965105AbXADWS2 (ORCPT ); Thu, 4 Jan 2007 17:18:28 -0500 Received: from gaz.sfgoth.com ([69.36.241.230]:52545 "EHLO gaz.sfgoth.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965103AbXADWS1 (ORCPT ); Thu, 4 Jan 2007 17:18:27 -0500 Date: Thu, 4 Jan 2007 14:38:56 -0800 From: Mitchell Blank Jr To: Al Viro Cc: Linus Torvalds , Eric Sandeen , Andrew Morton , Linux Kernel Mailing List , Al Viro Subject: Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values Message-ID: <20070104223856.GA79126@gaz.sfgoth.com> References: <20070104105430.1de994a7.akpm@osdl.org> <20070104191451.GW17561@ftp.linux.org.uk> <20070104202412.GY17561@ftp.linux.org.uk> <20070104215206.GZ17561@ftp.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070104215206.GZ17561@ftp.linux.org.uk> User-Agent: Mutt/1.4.2.1i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.2.2 (gaz.sfgoth.com [127.0.0.1]); Thu, 04 Jan 2007 14:38:57 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 749 Lines: 21 Al Viro wrote: > At least 3 versions, unless you want to mess with ifdefs to reduce them to > two. I don't think you need to do fancy #ifdef's: static s32 return_eio_32(void) { return -EIO; } static s64 return_eio_64(void) { return -EIO; } extern void return_eio_unknown(void); /* Doesn't exist */ #define return_eio(type) ((sizeof(type) == 4) \ ? ((void *) return_eio_32) \ : ((sizeof(type) == 8) \ ? ((void *) return_eio_64) \ : ((void *) return_eio_unknown))) -Mitch - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/