summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/alignedmem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-07-25 13:18:42 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-07-25 13:18:42 -0700
commit17baa442864254cb2aadf3a4d668c0f81d2f07c5 (patch)
tree49fe525f402cecaab84d804963314f6967c5dcce /drivers/firmware/efi/libstub/alignedmem.c
parent7cb3a5c5f6478ac0c14d01e35bc49e0ba7525e21 (diff)
parent74f85551666fe40bd739e95b5ecb20f53f8ad4df (diff)
downloadlinux-17baa442864254cb2aadf3a4d668c0f81d2f07c5.tar.gz
linux-17baa442864254cb2aadf3a4d668c0f81d2f07c5.tar.bz2
linux-17baa442864254cb2aadf3a4d668c0f81d2f07c5.zip
Merge tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
Pull EFI fixes from Ingo Molnar: "Various EFI fixes: - Fix the layering violation in the use of the EFI runtime services availability mask in users of the 'efivars' abstraction - Revert build fix for GCC v4.8 which is no longer supported - Clean up some x86 EFI stub details, some of which are borderline bugs that copy around garbage into padding fields - let's fix these out of caution. - Fix build issues while working on RISC-V support - Avoid --whole-archive when linking the stub on arm64" * tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: Revert "efi/x86: Fix build with gcc 4" efi/efivars: Expose RT service availability via efivars abstraction efi/libstub: Move the function prototypes to header file efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds efi/libstub/arm64: link stub lib.a conditionally efi/x86: Only copy upto the end of setup_header efi/x86: Remove unused variables
Diffstat (limited to 'drivers/firmware/efi/libstub/alignedmem.c')
-rw-r--r--drivers/firmware/efi/libstub/alignedmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/alignedmem.c b/drivers/firmware/efi/libstub/alignedmem.c
index cc89c4d6196f..1de9878ddd3a 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);