Skip to contentSkip to conversation

exynos: pinmux: remove unnecessary routine

PATCH New Minkyu Kang 3 participants 6 messages Jan 29, 2014 – Feb 5, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +1 -6
index 904177a..645c497 100644
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 	if (err)
 		return PERIPH_ID_NONE;
 
-	/* check for invalid peripheral id */
-	if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-		return cell[1];
-
-	debug(" invalid peripheral id\n");
-	return PERIPH_ID_NONE;
+	return cell[1];
 }
 
 int pinmux_decode_periph_id(const void *blob, int node)
Signature · 4 lines
1.7.9.5
-- 
Thanks,
Minkyu Kang.
#1 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

Hi Minkyu Knag,

Quoted 14 lines · Minkyu Kang

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index 904177a..645c497 100644

arch/arm/cpu/armv7/exynos/pinmux.c static int exynos5_pinmux_decode_periph_id(const void *blob, int node) · line 756

Quoted 6 lines
arch/arm/cpu/armv7/exynos/pinmux.c +0 -3
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
        if (err)
                return PERIPH_ID_NONE;
 
-       /* check for invalid peripheral id */
-       if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-               return cell[1];

Cant we check if less than PERIPH_ID_COUNT, this way we can atleast cut down some wrong values.
Or value has to range between PERIPH_ID_UART0 and PERIPH_ID_COUNT

Signature · 2 lines
Regards,
Rajeshwari Shinde
Quoted 16 lines
arch/arm/cpu/armv7/exynos/pinmux.c +1 -4
-
-       debug(" invalid peripheral id\n");
-       return PERIPH_ID_NONE;
+       return cell[1];
 }
 
 int pinmux_decode_periph_id(const void *blob, int node)
--

1.7.9.5
--
Thanks,
Minkyu Kang.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

Quoted 20 lines · Rajeshwari Birje

Hi Minkyu Knag,

Quoted 17 lines · Minkyu Kang

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index 904177a..645c497 100644
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
        if (err)
                return PERIPH_ID_NONE;
 
Quoted 8 lines

arch/arm/cpu/armv7/exynos/pinmux.c static int exynos5_pinmux_decode_periph_id(const void *blob, int node) · line 756

Quoted 3 lines
arch/arm/cpu/armv7/exynos/pinmux.c +0 -3
-       /* check for invalid peripheral id */
-       if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-               return cell[1];

Cant we check if less than PERIPH_ID_COUNT, this way we can atleast cut down some wrong values.
Or value has to range between PERIPH_ID_UART0 and PERIPH_ID_COUNT

possible. but I think it's unnecessary.
It can not check error correctly.
for example, if cell[1] is 55 then it's valid but does not supported.

Thanks,
Minkyu Kang.

#4 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

In reply to Minkyu Kang
Quoted 28 lines · Minkyu Kang

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +1 -6
index 904177a..645c497 100644
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
 	if (err)
 		return PERIPH_ID_NONE;
 
-	/* check for invalid peripheral id */
-	if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-		return cell[1];
-
-	debug(" invalid peripheral id\n");
-	return PERIPH_ID_NONE;
+	return cell[1];
 }
 
 int pinmux_decode_periph_id(const void *blob, int node)
#3 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

In reply to Minkyu Kang

Hi Minkyu Kang,

Quoted 30 lines · Minkyu Kang
Quoted 20 lines · Rajeshwari Birje

Hi Minkyu Knag,

Quoted 17 lines · Minkyu Kang

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index 904177a..645c497 100644
@@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
        if (err)
                return PERIPH_ID_NONE;
 
Quoted 8 lines

arch/arm/cpu/armv7/exynos/pinmux.c static int exynos5_pinmux_decode_periph_id(const void *blob, int node) · line 756

Quoted 3 lines
arch/arm/cpu/armv7/exynos/pinmux.c +0 -3
-       /* check for invalid peripheral id */
-       if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
-               return cell[1];

Cant we check if less than PERIPH_ID_COUNT, this way we can atleast cut down some wrong values.
Or value has to range between PERIPH_ID_UART0 and PERIPH_ID_COUNT

Quoted 3 lines

possible. but I think it's unnecessary.
It can not check error correctly.
for example, if cell[1] is 55 then it's valid but does not supported.

Ok the point seems valid.

Quoted 4 lines

Thanks,
Minkyu Kang.

Signature · 2 lines
Regards,
Rajeshwari Shinde
#5 lore raw

PATCH 3/3 exynos: pinmux: remove unnecessary routine

In reply to Minkyu Kang
Quoted 9 lines · Minkyu Kang

Because of the list of peripherals is not sequential,
such a routine does not check for valid correctly.
Error check will be done when call the exynos_pinmux_config function.

---
 arch/arm/cpu/armv7/exynos/pinmux.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

applied to u-boot-samsung.

Minkyu Kang.