From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Jeremy Kerr To: linuxppc-dev@ozlabs.org Subject: Re: [PATCH] powerpc: simplify dma_ops bug conditions References: <20060713063252.1D35867B58@ozlabs.org> <20060713063947.GD5096@rhun.ibm.com> In-Reply-To: <20060713063947.GD5096@rhun.ibm.com> MIME-Version: 1.0 Date: Mon, 17 Jul 2006 13:55:41 +1000 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200607171355.42465.jk@ozlabs.org> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Muli, > Is the BUG_ON() necessary? the next line just goes and deref's it, > which should lead to a shiny NULL pointer deref. No, it's not really necessary, more a style thing. The BUG_ON only adds an extra 3 instructions (subfic, addi and tdnei), which should be tiny compared to the indirect branch. Also, it makes it a little easier for a user to understand: "there's a bug in the kernel" vs. "invalid memory access". Jeremy