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

Message ID 20171012232954.16249-1-xypron.glpk@gmx.de
State New
Delegated to: Tom Warren
Headers show
Series
  • [U-Boot,1/1] dm: tegra: correct type for tegra_xusb_padctl_lane_find_function
Related show

Commit Message

Heinrich Schuchardt Oct. 12, 2017, 11:29 p.m.
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@gmx.de>
---
 arch/arm/mach-tegra/xusb-padctl-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

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]);