lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220902182650.83098-11-andriy.shevchenko@linux.intel.com>
Date:   Fri,  2 Sep 2022 21:26:44 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Patrick Rudolph <patrick.rudolph@...ements.com>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v1 11/17] pinctrl: cy8c95x0: Use 'default' in all switch-cases

Move the default values to the 'default' case in the switches.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 drivers/pinctrl/pinctrl-cy8c95x0.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index 55bd48c9d020..6fe442b44cab 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -279,9 +279,9 @@ static bool cy8c95x0_readable_register(struct device *dev, unsigned int reg)
 	switch (reg) {
 	case 0x24 ... 0x27:
 		return false;
+	default:
+		return true;
 	}
-
-	return true;
 }
 
 static bool cy8c95x0_writeable_register(struct device *dev, unsigned int reg)
@@ -293,9 +293,9 @@ static bool cy8c95x0_writeable_register(struct device *dev, unsigned int reg)
 		return false;
 	case 0x24 ... 0x27:
 		return false;
+	default:
+		return true;
 	}
-
-	return true;
 }
 
 static bool cy8c95x0_volatile_register(struct device *dev, unsigned int reg)
@@ -304,9 +304,9 @@ static bool cy8c95x0_volatile_register(struct device *dev, unsigned int reg)
 	case CY8C95X0_INPUT_(0) ... CY8C95X0_INPUT_(7):
 	case CY8C95X0_INTSTATUS_(0) ... CY8C95X0_INTSTATUS_(7):
 		return true;
+	default:
+		return false;
 	}
-
-	return false;
 }
 
 static bool cy8c95x0_precious_register(struct device *dev, unsigned int reg)
@@ -314,9 +314,9 @@ static bool cy8c95x0_precious_register(struct device *dev, unsigned int reg)
 	switch (reg) {
 	case CY8C95X0_INTSTATUS_(0) ... CY8C95X0_INTSTATUS_(7):
 		return true;
+	default:
+		return false;
 	}
-
-	return false;
 }
 
 static const struct reg_default cy8c95x0_reg_defaults[] = {
@@ -1244,6 +1244,8 @@ static int cy8c95x0_probe(struct i2c_client *client)
 	case 60:
 		strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE);
 		break;
+	default:
+		return -ENODEV;
 	}
 
 	reg = devm_regulator_get(&client->dev, "vdd");
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ