The kernel version detection in alsa-driver ebuild uses shell commands outside of a function. For argumentation on not doing it this way, please refer to comment 4 to bug 517 by Daniel Robbins. This bug depends on the resolution of bug 599.
see media-video/nvidia-kernel for an example of how we need to do it.
The ebuild currently uses the symlink of /usr/src/linux to figure out what set of kernel files to use. It also uses that symlink to determine where to move the modules after they are built (assumption). This will cause problems if they are not the same. I suggest using include/linux/version.h "UTS_RELEASE: definition or something similar to determine where to put them.
IMO it's even more probable to have linux headers from a version of kernel, older than the one currently running. [There is an idea that the kernel headers should be the same as the ones, against which libc was compiled.] As another idea, perhaps we should let the user easily override the automatic kernel version detection by, say, setting an environment variable at build time.
I don't have alsa on my system or USE flag, because i use arts/kde... So i'm of little use for this bug.