]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: use ALIGN4()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 31 May 2022 18:07:30 +0000 (03:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 31 May 2022 18:41:15 +0000 (03:41 +0900)
src/boot/efi/cpio.c
src/boot/efi/stub.c

index 14957130be00bc9ba8bfec918b6610f906c53138..8a2a5afc40daa58032e198e55323b35670619ec7 100644 (file)
@@ -96,12 +96,12 @@ static EFI_STATUS pack_cpio_one(
                 return EFI_OUT_OF_RESOURCES;
 
         /* Align the whole header to 4 byte size */
-        l = ALIGN_TO(l, 4);
+        l = ALIGN4(l);
         if (l == UINTN_MAX) /* overflow check */
                 return EFI_OUT_OF_RESOURCES;
 
         /* Align the contents to 4 byte size */
-        q = ALIGN_TO(contents_size, 4);
+        q = ALIGN4(contents_size);
         if (q == UINTN_MAX) /* overflow check */
                 return EFI_OUT_OF_RESOURCES;
 
@@ -188,7 +188,7 @@ static EFI_STATUS pack_cpio_dir(
         l += path_size;
 
         /* Align the whole header to 4 byte size */
-        l = ALIGN_TO(l, 4);
+        l = ALIGN4(l);
         if (l == UINTN_MAX) /* overflow check */
                 return EFI_OUT_OF_RESOURCES;
 
index 40f615b2b363d1fdc370330e222a65fe4f094d32..afcc106b52dabeb27fa0e68bf5fb97b82e7ebd84 100644 (file)
@@ -34,7 +34,7 @@ static EFI_STATUS combine_initrd(
 
         /* Combines four initrds into one, by simple concatenation in memory */
 
-        n = ALIGN_TO(initrd_size, 4); /* main initrd might not be padded yet */
+        n = ALIGN4(initrd_size); /* main initrd might not be padded yet */
         if (credential_initrd) {
                 if (n > UINTN_MAX - credential_initrd_size)
                         return EFI_OUT_OF_RESOURCES;
@@ -71,7 +71,7 @@ static EFI_STATUS combine_initrd(
                 CopyMem(p, PHYSICAL_ADDRESS_TO_POINTER(initrd_base), initrd_size);
                 p += initrd_size;
 
-                pad = ALIGN_TO(initrd_size, 4) - initrd_size;
+                pad = ALIGN4(initrd_size) - initrd_size;
                 if (pad > 0)  {
                         ZeroMem(p, pad);
                         p += pad;