diff options
author | David S. Miller <davem@davemloft.net> | 2017-02-07 16:29:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-07 16:29:30 -0500 |
commit | 3efa70d78f218e4c9276b0bac0545e5184c1c47b (patch) | |
tree | f4abe2f05e173023d2a262afd4aebb1e89fe6985 /drivers/base/memory.c | |
parent | 76e0e70e6452b971a69cc9794ff4a6715c11f7f2 (diff) | |
parent | 926af6273fc683cd98cd0ce7bf0d04a02eed6742 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
The conflict was an interaction between a bug fix in the
netvsc driver in 'net' and an optimization of the RX path
in 'net-next'.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r-- | drivers/base/memory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index dacb6a8418aa..fa26ffd25fa6 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -389,33 +389,33 @@ static ssize_t show_valid_zones(struct device *dev, | |||
389 | { | 389 | { |
390 | struct memory_block *mem = to_memory_block(dev); | 390 | struct memory_block *mem = to_memory_block(dev); |
391 | unsigned long start_pfn, end_pfn; | 391 | unsigned long start_pfn, end_pfn; |
392 | unsigned long valid_start, valid_end, valid_pages; | ||
392 | unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; | 393 | unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; |
393 | struct page *first_page; | ||
394 | struct zone *zone; | 394 | struct zone *zone; |
395 | int zone_shift = 0; | 395 | int zone_shift = 0; |
396 | 396 | ||
397 | start_pfn = section_nr_to_pfn(mem->start_section_nr); | 397 | start_pfn = section_nr_to_pfn(mem->start_section_nr); |
398 | end_pfn = start_pfn + nr_pages; | 398 | end_pfn = start_pfn + nr_pages; |
399 | first_page = pfn_to_page(start_pfn); | ||
400 | 399 | ||
401 | /* The block contains more than one zone can not be offlined. */ | 400 | /* The block contains more than one zone can not be offlined. */ |
402 | if (!test_pages_in_a_zone(start_pfn, end_pfn)) | 401 | if (!test_pages_in_a_zone(start_pfn, end_pfn, &valid_start, &valid_end)) |
403 | return sprintf(buf, "none\n"); | 402 | return sprintf(buf, "none\n"); |
404 | 403 | ||
405 | zone = page_zone(first_page); | 404 | zone = page_zone(pfn_to_page(valid_start)); |
405 | valid_pages = valid_end - valid_start; | ||
406 | 406 | ||
407 | /* MMOP_ONLINE_KEEP */ | 407 | /* MMOP_ONLINE_KEEP */ |
408 | sprintf(buf, "%s", zone->name); | 408 | sprintf(buf, "%s", zone->name); |
409 | 409 | ||
410 | /* MMOP_ONLINE_KERNEL */ | 410 | /* MMOP_ONLINE_KERNEL */ |
411 | zone_can_shift(start_pfn, nr_pages, ZONE_NORMAL, &zone_shift); | 411 | zone_can_shift(valid_start, valid_pages, ZONE_NORMAL, &zone_shift); |
412 | if (zone_shift) { | 412 | if (zone_shift) { |
413 | strcat(buf, " "); | 413 | strcat(buf, " "); |
414 | strcat(buf, (zone + zone_shift)->name); | 414 | strcat(buf, (zone + zone_shift)->name); |
415 | } | 415 | } |
416 | 416 | ||
417 | /* MMOP_ONLINE_MOVABLE */ | 417 | /* MMOP_ONLINE_MOVABLE */ |
418 | zone_can_shift(start_pfn, nr_pages, ZONE_MOVABLE, &zone_shift); | 418 | zone_can_shift(valid_start, valid_pages, ZONE_MOVABLE, &zone_shift); |
419 | if (zone_shift) { | 419 | if (zone_shift) { |
420 | strcat(buf, " "); | 420 | strcat(buf, " "); |
421 | strcat(buf, (zone + zone_shift)->name); | 421 | strcat(buf, (zone + zone_shift)->name); |