Commit c36cf3b5 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] Fix overflow on machines with >4GB

From Marcelo E Magallon.
parent 4a0ea4c3
......@@ -106,7 +106,11 @@ static int agp_find_max(void)
{
long memory, index, result;
memory = (num_physpages << PAGE_SHIFT) >> 20;
#if PAGE_SHIFT < 20
memory = num_physpages >> (20 - PAGE_SHIFT);
#else
memory = num_physpages << (PAGE_SHIFT - 20);
#endif
index = 1;
while ((memory > maxes_table[index].mem) && (index < 8))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment