• R
    gpiolib: Refactor gpio_export · fc4e2514
    Ryan Mallon 提交于
    The gpio_export function uses nested if statements and the status
    variable to handle the failure cases. This makes the function logic
    difficult to follow. Refactor the code to abort immediately on failure
    using goto. This makes the code slightly longer, but significantly
    reduces the nesting and number of split lines and makes the code easier
    to read.
    Signed-off-by: NRyan Mallon <rmallon@gmail.com>
    Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
    fc4e2514
gpiolib.c 46.1 KB