[U-Boot] [PATCH 1/1] dm: tegra: correct type for tegra_xusb_padctl_lane_find_function

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Oct 12 23:29:54 UTC 2017


tegra_xusb_padctl_lane_find_function returns int and not
unsigned int.

Detecting an error (func < 0) is not possible if variable
func is defined as unsigned.

Detected by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 arch/arm/mach-tegra/xusb-padctl-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c
index c8a468a034..b2411123cb 100644
--- a/arch/arm/mach-tegra/xusb-padctl-common.c
+++ b/arch/arm/mach-tegra/xusb-padctl-common.c
@@ -152,7 +152,7 @@ tegra_xusb_padctl_group_apply(struct tegra_xusb_padctl *padctl,
 
 	for (i = 0; i < group->num_pins; i++) {
 		const struct tegra_xusb_padctl_lane *lane;
-		unsigned int func;
+		int func;
 		u32 value;
 
 		lane = tegra_xusb_padctl_find_lane(padctl, group->pins[i]);
-- 
2.14.1



More information about the U-Boot mailing list