]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: sc16is7xx: add explicit return for some switch default cases
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Thu, 21 Dec 2023 23:18:18 +0000 (18:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jan 2024 15:30:04 +0000 (16:30 +0100)
Allows to simplify code by removing the break statement in the default
switch/case in some functions.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20231221231823.2327894-12-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sc16is7xx.c

index 6181cc6f934b8900702d626568e52550c1df41a6..da862b8efcbef1d1e46335597d67c28768c53754 100644 (file)
@@ -460,10 +460,8 @@ static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg)
        case SC16IS7XX_IOCONTROL_REG:
                return true;
        default:
-               break;
+               return false;
        }
-
-       return false;
 }
 
 static bool sc16is7xx_regmap_precious(struct device *dev, unsigned int reg)
@@ -472,10 +470,8 @@ static bool sc16is7xx_regmap_precious(struct device *dev, unsigned int reg)
        case SC16IS7XX_RHR_REG:
                return true;
        default:
-               break;
+               return false;
        }
-
-       return false;
 }
 
 static bool sc16is7xx_regmap_noinc(struct device *dev, unsigned int reg)