summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-07-18 15:57:40 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-18 17:08:06 -0700
commit90ec010fe0d690665852d6bac21643e9ae7affd8 (patch)
treee733ef6ca3f3c637689b41720f1f914f5c9a6d34
parent2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7 (diff)
downloadlinux-90ec010fe0d690665852d6bac21643e9ae7affd8.tar.bz2
drivers/base/memory: use "unsigned long" for block ids
Block ids are just shifted section numbers, so let's also use "unsigned long" for them, too. Link: http://lkml.kernel.org/r/20190614100114.311-3-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/base/memory.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 5947b5a5686d..c54e80fd25a8 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -34,12 +34,12 @@ static DEFINE_MUTEX(mem_sysfs_mutex);
static int sections_per_block;
-static inline int base_memory_block_id(unsigned long section_nr)
+static inline unsigned long base_memory_block_id(unsigned long section_nr)
{
return section_nr / sections_per_block;
}
-static inline int pfn_to_block_id(unsigned long pfn)
+static inline unsigned long pfn_to_block_id(unsigned long pfn)
{
return base_memory_block_id(pfn_to_section_nr(pfn));
}
@@ -587,7 +587,7 @@ int __weak arch_get_memory_phys_device(unsigned long start_pfn)
* A reference for the returned object is held and the reference for the
* hinted object is released.
*/
-static struct memory_block *find_memory_block_by_id(int block_id,
+static struct memory_block *find_memory_block_by_id(unsigned long block_id,
struct memory_block *hint)
{
struct device *hintdev = hint ? &hint->dev : NULL;
@@ -604,7 +604,7 @@ static struct memory_block *find_memory_block_by_id(int block_id,
struct memory_block *find_memory_block_hinted(struct mem_section *section,
struct memory_block *hint)
{
- int block_id = base_memory_block_id(__section_nr(section));
+ unsigned long block_id = base_memory_block_id(__section_nr(section));
return find_memory_block_by_id(block_id, hint);
}
@@ -663,8 +663,8 @@ int register_memory(struct memory_block *memory)
return ret;
}
-static int init_memory_block(struct memory_block **memory, int block_id,
- unsigned long state)
+static int init_memory_block(struct memory_block **memory,
+ unsigned long block_id, unsigned long state)
{
struct memory_block *mem;
unsigned long start_pfn;
@@ -729,8 +729,8 @@ static void unregister_memory(struct memory_block *memory)
*/
int create_memory_block_devices(unsigned long start, unsigned long size)
{
- const int start_block_id = pfn_to_block_id(PFN_DOWN(start));
- int end_block_id = pfn_to_block_id(PFN_DOWN(start + size));
+ const unsigned long start_block_id = pfn_to_block_id(PFN_DOWN(start));
+ unsigned long end_block_id = pfn_to_block_id(PFN_DOWN(start + size));
struct memory_block *mem;
unsigned long block_id;
int ret = 0;
@@ -766,10 +766,10 @@ int create_memory_block_devices(unsigned long start, unsigned long size)
*/
void remove_memory_block_devices(unsigned long start, unsigned long size)
{
- const int start_block_id = pfn_to_block_id(PFN_DOWN(start));
- const int end_block_id = pfn_to_block_id(PFN_DOWN(start + size));
+ const unsigned long start_block_id = pfn_to_block_id(PFN_DOWN(start));
+ const unsigned long end_block_id = pfn_to_block_id(PFN_DOWN(start + size));
struct memory_block *mem;
- int block_id;
+ unsigned long block_id;
if (WARN_ON_ONCE(!IS_ALIGNED(start, memory_block_size_bytes()) ||
!IS_ALIGNED(size, memory_block_size_bytes())))