[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <159545812117.4006.8365184793527804218.tip-bot2@tip-bot2>
Date: Wed, 22 Jul 2020 22:48:41 -0000
From: "tip-bot2 for Atish Patra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Atish Patra <atish.patra@....com>,
Ard Biesheuvel <ardb@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: efi/urgent] efi/libstub: Fix gcc error around __umoddi3 for 32
bit builds
The following commit has been merged into the efi/urgent branch of tip:
Commit-ID: 950accbabd4cfa83519fa920f99428bcc131c3c9
Gitweb: https://git.kernel.org/tip/950accbabd4cfa83519fa920f99428bcc131c3c9
Author: Atish Patra <atish.patra@....com>
AuthorDate: Thu, 25 Jun 2020 16:45:06 -07:00
Committer: Ard Biesheuvel <ardb@...nel.org>
CommitterDate: Thu, 09 Jul 2020 09:45:09 +03:00
efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds
32bit gcc doesn't support modulo operation on 64 bit data. It results in
a __umoddi3 error while building EFI for 32 bit.
Use bitwise operations instead of modulo operations to fix the issue.
Signed-off-by: Atish Patra <atish.patra@....com>
Link: https://lore.kernel.org/r/20200625234516.31406-2-atish.patra@wdc.com
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
---
drivers/firmware/efi/libstub/alignedmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/libstub/alignedmem.c b/drivers/firmware/efi/libstub/alignedmem.c
index cc89c4d..1de9878 100644
--- a/drivers/firmware/efi/libstub/alignedmem.c
+++ b/drivers/firmware/efi/libstub/alignedmem.c
@@ -44,7 +44,7 @@ efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr,
*addr = ALIGN((unsigned long)alloc_addr, align);
if (slack > 0) {
- int l = (alloc_addr % align) / EFI_PAGE_SIZE;
+ int l = (alloc_addr & (align - 1)) / EFI_PAGE_SIZE;
if (l) {
efi_bs_call(free_pages, alloc_addr, slack - l + 1);
Powered by blists - more mailing lists