Messages in this thread | | | From | Oliver Neukum <> | Subject | Re: question on common error-handling idiom | Date | Tue, 2 Nov 2004 22:21:55 +0100 |
| |
> but for the places that do > > err = -SOMEERROR; > if (condition) > goto out; > > err = -OTHERERROR; > if (condition) > goto out; > > I would tend to agree with you that moving the setting of the error inside > the if() would make sense.
The intention is to allow the compiler to turn the if into a simple conditional branch on the assumption that gcc is not smart enough to put the if's body out of line.
Regards Oliver - 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/
| |