As opposed to passing a cookie (struct resource) and an offset, and letting
the compiler do the addition it'd do anyway or eliminate the cookie directly
on platforms where this is suitable.
> Case 2:
> You carry around bus number information all throughout
> each driver
Eh? Who said anything about bus number info? Just the information in the
resource structure.
> You keep putting it on/off the stack
Why should I want to do that? You've got to keep the base address of your
resource space somewhere anyway, so you could just replace it with a pointer
to the resource struct (which you've already got). Plus, I can pass this in a
register to any behind the scenes function.
In my example code, in the really simple cases (most of them), there were no
pushes and pops.
> You keep it in structures
Doesn't everyone? Apart from those that use global variables, I suppose, but
surely they're limited in reusability.
> You do complex generic locking for hotplug 'just in case'
Eh? No I wasn't, but under some circumstances one might have to do that
anyway, and so the out-of-line functions may be the best place to do that.
David
-
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/