[PATCH] pinctrl: rp1: silence uninitialized variable warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This default path could probably can't be reached but Smatch can't
verify it so it complains that "arg" isn't initialized on this path.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
I didn't add a Fixes tag because this likely isn't a real bug.  Plus this
code is very new so it doesn't need to be backported anyway.

Also checkpatch complains:

	WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

But I left it that way so it's consistent with the other return in
the function.  Maybe we should change both?

 drivers/pinctrl/pinctrl-rp1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c
index d300f28c52cd..f9cc6b28994c 100644
--- a/drivers/pinctrl/pinctrl-rp1.c
+++ b/drivers/pinctrl/pinctrl-rp1.c
@@ -1524,6 +1524,8 @@ static int rp1_pinconf_get(struct pinctrl_dev *pctldev, unsigned int offset,
 		case RP1_PAD_DRIVE_12MA:
 			arg = 12;
 			break;
+		default:
+			return -ENOTSUPP;
 		}
 		break;
 	case PIN_CONFIG_BIAS_DISABLE:
-- 
2.47.2





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux