mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-22 05:00:08 +02:00
nvmutil: simplify a few else statements
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -198,10 +198,9 @@ void
|
|||||||
nvmalloc(void)
|
nvmalloc(void)
|
||||||
{
|
{
|
||||||
/* same operations need the full block, others only 128 bytes */
|
/* same operations need the full block, others only 128 bytes */
|
||||||
|
nf = NVM_SIZE;
|
||||||
if ((cmd == cmd_swap) || (cmd == cmd_copy))
|
if ((cmd == cmd_swap) || (cmd == cmd_copy))
|
||||||
nf = SIZE_4KB;
|
nf = SIZE_4KB;
|
||||||
else
|
|
||||||
nf = NVM_SIZE;
|
|
||||||
|
|
||||||
/* only read the part specified, for copy/setchecksum/brick */
|
/* only read the part specified, for copy/setchecksum/brick */
|
||||||
if ((cmd == cmd_copy) || (cmd == cmd_setchecksum) || (cmd == cmd_brick))
|
if ((cmd == cmd_copy) || (cmd == cmd_setchecksum) || (cmd == cmd_brick))
|
||||||
@@ -307,8 +306,7 @@ hextonum(char ch)
|
|||||||
return ch - 'a' + 10;
|
return ch - 'a' + 10;
|
||||||
else if ((ch == '?') || (ch == 'x') || (ch == 'X'))
|
else if ((ch == '?') || (ch == 'x') || (ch == 'X'))
|
||||||
return rhex(); /* random hex value */
|
return rhex(); /* random hex value */
|
||||||
else
|
return 16; /* error: invalid character */
|
||||||
return 16; /* error: invalid character */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
|
|||||||
Reference in New Issue
Block a user