[PATCH] powerpc: simplify dma_ops bug conditions

Jeremy Kerr jk at ozlabs.org
Mon Jul 17 13:55:41 EST 2006


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



More information about the Linuxppc-dev mailing list