<div style="direction: ltr;">Hi,<br><br></div><div style="direction: ltr;"><span class="sg">this is a small patch that replaces an instruction with an existing helper function.<br>The same helper function is used in spgd_addr().
<br>If there's a reason not to use the helper function please explain why.<br>Also, if there are any problems in the way I submitted the patch, please point them out.<br><br></span></div><br>Use existing helper function in gpgd_addr().
<br><br>Signed-off-by: Catalin Morosan <<a href="mailto:morosancatalin@gmail.com">morosancatalin@gmail.com</a>><br><br>---<br> diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c<br>index b7a924a..85daf86 100644
<br>--- a/drivers/lguest/page_tables.c<br>+++ b/drivers/lguest/page_tables.c<br>@@ -107,7 +107,7 @@ static spte_t *spte_addr(struct lguest *lg, spgd_t spgd, unsigned long vaddr)<br> * page tables. Hence they return a Guest address. */
<br> static unsigned long gpgd_addr(struct lguest *lg, unsigned long vaddr)<br> {<br>- unsigned int index = vaddr >> (PAGE_SHIFT + PTES_PER_PAGE_SHIFT);<br>+ unsigned int index = vaddr_to_pgd_index(vaddr);
<br> return lg->pgdirs[lg->pgdidx].cr3 + index * sizeof(gpgd_t);<br> }<br> <br><br>