memdisk/setup: Move duplicate code in int15maxres to new function