Akinobu Mita 54df2db36c sparc/srmmu: clear trailing edge of bitmap properly
srmmu_nocache_bitmap is cleared by bit_map_init().  But bit_map_init()
attempts to clear by memset(), so it can't clear the trailing edge of
bitmap properly on big-endian architecture if the number of bits is not
a multiple of BITS_PER_LONG.

Actually, the number of bits in srmmu_nocache_bitmap is not always
a multiple of BITS_PER_LONG.  It is calculated as below:

        bitmap_bits = srmmu_nocache_size >> SRMMU_NOCACHE_BITMAP_SHIFT;

srmmu_nocache_size is decided proportionally by the amount of system RAM
and it is rounded to a multiple of PAGE_SIZE.  SRMMU_NOCACHE_BITMAP_SHIFT
is defined as (PAGE_SHIFT - 4).  So it can only be said that bitmap_bits
is a multiple of 16.

This fixes the problem by using bitmap_clear() instead of memset()
in bit_map_init() and this also uses BITS_TO_LONGS() to calculate correct
size at bitmap allocation time.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-31 19:29:12 -04:00
..
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2009-02-08 22:00:55 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2011-12-04 15:59:49 +02:00
2008-05-20 00:33:44 -07:00
2008-12-09 04:09:07 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2009-02-08 22:00:55 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2008-12-09 01:07:09 -08:00
2008-12-04 09:17:19 -08:00
2008-12-04 09:17:19 -08:00
2012-05-19 15:23:57 -07:00
2008-12-04 09:17:19 -08:00