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

Re: [Xen-devel] [PATCH] libxc/arm: remove useless conditional in meminit





On 03/14/2018 10:58 AM, Wei Liu wrote:
The variable named ramsize is always non-zero at that point because
there is a check for zero a few lines before.

The body of the loop has:

ramsize -= ...

We want to exit the loop either when we have no more banks left or we fulfilled all the RAM requested.

Cheers,


Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
  tools/libxc/xc_dom_arm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 5b9eca6087..5acb32148e 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -425,7 +425,7 @@ static int meminit(struct xc_dom_image *dom)
      if ( rc )
          return rc;
- for ( i = 0; ramsize && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; i < GUEST_RAM_BANKS; i++ )
      {
          uint64_t banksize = ramsize > bankmax[i] ? bankmax[i] : ramsize;

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.