I'm not completely certain what method you're following here, trying to go from 18.104.22.168 to 2.6.31rc7 however here's some general information that may help:
1) You generally need to patch in sequence, from one kernel release to the next, until you get to the version you want. Assuming you have a stock kernel archive from kernel.org, this would go something like:
2.6.26 > 2.6.27
2.6.27 > 2.6.28
2.6.28 > 2.6.29
2.6.29 > 2.6.30
2.6.30 > 2.6.31rc7 # not sure how this patch would work..
Now, that said, is there any particular problem with simply downloading the 2.6.31rc7 kernel from kernel.org/testing or wherever it is? Why do you need to do this using patch?
Finally, let's say you have a kernel archive, and you want to patch it to a higher version. You would do:
1) unpack the kernel archive.
2) copy the patch file(s) into the root of the unpacked folder.
3) execute: patch -p1 -i patchfile
# as many times as needed to go from start to finish version.
I hope this explains a little bit
but if there's still an issue here, please clarify what it is exactly, and why you need to go this route. Thanks,