Skip to content

Commit

Permalink
Cleanup: Remove local variables in build_assertions()
Browse files Browse the repository at this point in the history
CodeQL complains, and they're not strictly necessary.

Signed-off-by: Andrew Cooper <[email protected]>
  • Loading branch information
andyhhp committed Nov 20, 2023
1 parent f488052 commit 1c86620
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,18 +552,15 @@ asm_return_t skl_main(void)

static void __maybe_unused build_assertions(void)
{
struct boot_params b;
struct kernel_info k;

BUILD_BUG_ON(offsetof(typeof(b), tb_dev_map) != 0x0d8);
BUILD_BUG_ON(offsetof(typeof(b), syssize) != 0x1f4);
BUILD_BUG_ON(offsetof(typeof(b), version) != 0x206);
BUILD_BUG_ON(offsetof(typeof(b), code32_start) != 0x214);
BUILD_BUG_ON(offsetof(typeof(b), cmd_line_ptr) != 0x228);
BUILD_BUG_ON(offsetof(typeof(b), cmdline_size) != 0x238);
BUILD_BUG_ON(offsetof(typeof(b), payload_offset) != 0x248);
BUILD_BUG_ON(offsetof(typeof(b), payload_length) != 0x24c);
BUILD_BUG_ON(offsetof(typeof(b), kern_info_offset) != 0x268);

BUILD_BUG_ON(offsetof(typeof(k), mle_header_offset) != 0x010);
BUILD_BUG_ON(offsetof(struct boot_params, tb_dev_map) != 0x0d8);
BUILD_BUG_ON(offsetof(struct boot_params, syssize) != 0x1f4);
BUILD_BUG_ON(offsetof(struct boot_params, version) != 0x206);
BUILD_BUG_ON(offsetof(struct boot_params, code32_start) != 0x214);
BUILD_BUG_ON(offsetof(struct boot_params, cmd_line_ptr) != 0x228);
BUILD_BUG_ON(offsetof(struct boot_params, cmdline_size) != 0x238);
BUILD_BUG_ON(offsetof(struct boot_params, payload_offset) != 0x248);
BUILD_BUG_ON(offsetof(struct boot_params, payload_length) != 0x24c);
BUILD_BUG_ON(offsetof(struct boot_params, kern_info_offset) != 0x268);

BUILD_BUG_ON(offsetof(struct kernel_info, mle_header_offset) != 0x010);
}

0 comments on commit 1c86620

Please sign in to comment.