+ drivers-base-memory-pass-a-block_id-to-init_memory_block-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: drivers/base/memory: fix a compilation warning
has been added to the -mm tree.  Its filename is
     drivers-base-memory-pass-a-block_id-to-init_memory_block-fix.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/drivers-base-memory-pass-a-block_id-to-init_memory_block-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/drivers-base-memory-pass-a-block_id-to-init_memory_block-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Qian Cai <cai@xxxxxx>
Subject: drivers/base/memory: fix a compilation warning

8553938ba3bd ("drivers/base/memory: pass a block_id to
init_memory_block()") left an unused variable,

drivers/base/memory.c: In function 'add_memory_block':
drivers/base/memory.c:697:33: warning: variable 'section_nr' set but not
used [-Wunused-but-set-variable]

Also, rework the code logic a bit.

Link: http://lkml.kernel.org/r/1559320186-28337-1-git-send-email-cai@xxxxxx
Signed-off-by: Qian Cai <cai@xxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/base/memory.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

--- a/drivers/base/memory.c~drivers-base-memory-pass-a-block_id-to-init_memory_block-fix
+++ a/drivers/base/memory.c
@@ -677,17 +677,13 @@ static int init_memory_block(struct memo
 static int add_memory_block(int base_section_nr)
 {
 	struct memory_block *mem;
-	int i, ret, section_count = 0, section_nr;
+	int i, ret, section_count = 0;
 
 	for (i = base_section_nr;
 	     i < base_section_nr + sections_per_block;
-	     i++) {
-		if (!present_section_nr(i))
-			continue;
-		if (section_count == 0)
-			section_nr = i;
-		section_count++;
-	}
+	     i++)
+		if (present_section_nr(i))
+			section_count++;
 
 	if (section_count == 0)
 		return 0;
_

Patches currently in -mm which might be from cai@xxxxxx are

iommu-intel-fix-variable-iommu-set-but-not-used.patch
drivers-base-memory-pass-a-block_id-to-init_memory_block-fix.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux