No, I don't think you can do it this way.
At a minimum, you'd need to test that the result is word-aligned.
Preferably 8-byte aligned. We literally have stuff that knows about these
things and uses the low bits in the pointer to keep extra data.
(That said, I didn't check whether we actually kmalloc() the data, but I
think we do - things like "struct key" etc).
Now, maybe those things always have a 8-byte-aligned size, and it works
out, but I'd be worried.
Of course, there migth be other (even more subtle) cases where we just
assume certain alignment, and depend on the fact that we just _happen_ to
get it. Who knows..
Linus
-