All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tegra20: display: fix checking of return value
@ 2014-06-11 21:12 Jeroen Hofstee
  2014-06-12 16:31 ` Stephen Warren
  0 siblings, 1 reply; 2+ messages in thread
From: Jeroen Hofstee @ 2014-06-11 21:12 UTC (permalink / raw)
  To: u-boot

The calling code seems a bit in doubt about the return
value of fdtdec_lookup_phandle. Since it returns a negative
value on error (and fdt_node_offset_by_phandle as well),
check for that.

cc: Wei Ni <wni@nvidia.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---

arch/arm/cpu/armv7/tegra20/display.c:331:26: warning: comparison
of constant 0 with boolean expression is always false
[-Wtautological-constant-out-of-range-compare]

        if (!config->panel_node < 0) {
            ~~~~~~~~~~~~~~~~~~~ ^ ~

NOT tested on hw.
---
 arch/arm/cpu/armv7/tegra20/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/tegra20/display.c b/arch/arm/cpu/armv7/tegra20/display.c
index 488f0c6..fd77f3f 100644
--- a/arch/arm/cpu/armv7/tegra20/display.c
+++ b/arch/arm/cpu/armv7/tegra20/display.c
@@ -328,7 +328,7 @@ static int tegra_display_decode_config(const void *blob,
 	rgb = fdt_subnode_offset(blob, node, "rgb");
 
 	config->panel_node = fdtdec_lookup_phandle(blob, rgb, "nvidia,panel");
-	if (!config->panel_node < 0) {
+	if (config->panel_node < 0) {
 		debug("%s: Cannot find panel information\n", __func__);
 		return -1;
 	}
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] tegra20: display: fix checking of return value
  2014-06-11 21:12 [U-Boot] [PATCH] tegra20: display: fix checking of return value Jeroen Hofstee
@ 2014-06-12 16:31 ` Stephen Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2014-06-12 16:31 UTC (permalink / raw)
  To: u-boot

On 06/11/2014 03:12 PM, Jeroen Hofstee wrote:
> The calling code seems a bit in doubt about the return
> value of fdtdec_lookup_phandle. Since it returns a negative
> value on error (and fdt_node_offset_by_phandle as well),
> check for that.

Tested-by: Stephen Warren <swarren@nvidia.com>

(On Seaboard/Springbank; booted via tegrarcm and the LCD still works)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-12 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 21:12 [U-Boot] [PATCH] tegra20: display: fix checking of return value Jeroen Hofstee
2014-06-12 16:31 ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.