[PATCH v2 07/12] mtd: nand: denali: use more FIELD_PREP / FIELD_GET where appropriate

2017-09-21 Thread Masahiro Yamada
In several places in this driver, the register fields are retrieved as follows: val = reg & FOO_MASK; Then, modified as follows: reg &= ~FOO_MASK; reg |= val; This code relies on its shift is 0, which we will never know until we check the definition of FOO_MASK. Use FIELD_PREP /

[PATCH v2 07/12] mtd: nand: denali: use more FIELD_PREP / FIELD_GET where appropriate

2017-09-21 Thread Masahiro Yamada
In several places in this driver, the register fields are retrieved as follows: val = reg & FOO_MASK; Then, modified as follows: reg &= ~FOO_MASK; reg |= val; This code relies on its shift is 0, which we will never know until we check the definition of FOO_MASK. Use FIELD_PREP /