common/spi_flash_reg.c: Format with clang-format
BRANCH=none
TEST=none
@@ -107,8 +107,9 @@ int spi_flash_reg_to_protect(uint8_t sr1, uint8_t sr2, unsigned int *start,
cmp = (sr2 & SPI_FLASH_SR2_CMP) ? 1 : 0;
sec = (sr1 & SPI_FLASH_SR1_SEC) ? 1 : 0;
tb = (sr1 & SPI_FLASH_SR1_TB) ? 1 : 0;
- bp = (sr1 & (SPI_FLASH_SR1_BP2 | SPI_FLASH_SR1_BP1 | SPI_FLASH_SR1_BP0))
- >> 2;
+ bp = (sr1 &
+ (SPI_FLASH_SR1_BP2 | SPI_FLASH_SR1_BP1 | SPI_FLASH_SR1_BP0)) >>
+ 2;
/* Bad pointers or invalid data */
if (!start || !len || sr1 == 0xff || sr2 == 0xff)
@@ -174,12 +175,10 @@ int spi_flash_protect_to_reg(unsigned int start, unsigned int len, uint8_t *sr1,
sec = GET_BIT(range->sec);
tb = GET_BIT(range->tb);
bp = GET_BIT(range->bp[0]) << 2 |
- GET_BIT(range->bp[1]) << 1 |
- GET_BIT(range->bp[2]);
+ GET_BIT(range->bp[1]) << 1 | GET_BIT(range->bp[2]);
*sr1 = (sec ? SPI_FLASH_SR1_SEC : 0) |
- (tb ? SPI_FLASH_SR1_TB : 0) |
- (bp << 2);
+ (tb ? SPI_FLASH_SR1_TB : 0) | (bp << 2);
*sr2 = (cmp ? SPI_FLASH_SR2_CMP : 0);
return EC_SUCCESS;
}
