Skip to content

Commit

Permalink
mock-variables.c: fix gcc warning
Browse files Browse the repository at this point in the history
$ make test

    ...
    mock-variables.c: In function 'mock_sv_attrs_match':
    mock-variables.c:448:23: error: conversion from 'long unsigned int' to 'UINT32'
        {aka 'unsigned int'} changes value from '18446744073709551551' to '4294967231' [-Werror=overflow]
      448 |         UINT32 mask = ~EFI_VARIABLE_APPEND_WRITE;
          |                       ^
    cc1: all warnings being treated as errors

Signed-off-by: Alexey Kodanev <[email protected]>
  • Loading branch information
akodanev authored and vathpela committed May 4, 2022
1 parent 31094e5 commit 4df989a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mock-variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ free_var(struct mock_variable *var)
static bool
mock_sv_attrs_match(UINT32 old, UINT32 new)
{
UINT32 mask = ~EFI_VARIABLE_APPEND_WRITE;
UINT32 mask = ~((UINT32)EFI_VARIABLE_APPEND_WRITE);

return (old & mask) == (new & mask);
}
Expand Down

0 comments on commit 4df989a

Please sign in to comment.