From patchwork Mon Jul 29 13:35:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1138375 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="DsmalDwn"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45y10M3FWgz9sBt for ; Mon, 29 Jul 2019 23:35:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 42192C21DDC; Mon, 29 Jul 2019 13:35:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AA681C21D56; Mon, 29 Jul 2019 13:35:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 297AEC21D56; Mon, 29 Jul 2019 13:35:22 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id C3507C21CB6 for ; Mon, 29 Jul 2019 13:35:21 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id g17so61887052wrr.5 for ; Mon, 29 Jul 2019 06:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9dw1dqF8aAbWoinwQMv4KUs9iUxf43l5bSM9NBDn2Bs=; b=DsmalDwnxP7HhwZkqpKVpLtnsp1FQj/vRoa7kyWcjzNeOjf6p1uuoxQlP01h4A11wN bgDq+yf5crq4xbbi5gz2oJgXndUYNiThhdP1ckT8RP0JbyE3YNY+joooGnhITVz7ZwKW vZW/Z0ncjeFJsV/KcM896b1ihlVv+eACREmc4WDwipx7rmknpam1Z87BmLRsG2/o6lqy XMwj2+oKx1pyAL/5Rh14gQtICexN4Fwhomi3rVSnV20r5t6PHEQ00mPQ9Skju2XHL/+O BcEz6OYYCIeKwGmrQmM6Qkrcfh8PMtjod6Q2SmmCWlAJXibtZYPhjexTMYsapB1+cECY drMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9dw1dqF8aAbWoinwQMv4KUs9iUxf43l5bSM9NBDn2Bs=; b=DPBVDRRNNjIZzhsJZKppePdAsP0qsT6rlMgPPKnJ+7J2moT49AXqwqmC3uST9DUCTE 7Wt1Z4Ai2nZHD728DsFQnPZNA6op94sYIvBK81ehgBXF2AU4D2GaQiZUeaxPO4d6Jyln YD8mDHEuwGHur3QBr4RuKYX+iav9K11qyj33ggN0uM8IHJ+VaFYkpMjEBHoIfl/MFi6n 0UQKIXffiz+qvwuS9P3Ww8OfI2gybE1q72giQMOxxy1inrihLPcOdCE467IqdD2rVZ4B vCTLPbyEulXujO2MkguZJkCbuKd4866BqKz4KOxmzTJ94YG1Fa2FDQy4QP5bEEcabFRN v0ew== X-Gm-Message-State: APjAAAXDkhbhuZj+F3UV3ms/WmxLsVHCKSNeV1paqGyxeCxB2xiycVgy Q94c91XJYXFgXoVdzZFXUjuudA== X-Google-Smtp-Source: APXvYqxRpZVYS362bivrPRBHGkD6pd/szvzNbQGsgfgqr5iuGXl4OpDN2OSh3Kd/VYF2Ka0jnerwng== X-Received: by 2002:a5d:4ecc:: with SMTP id s12mr19677879wrv.157.1564407321148; Mon, 29 Jul 2019 06:35:21 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id p14sm49769677wrx.17.2019.07.29.06.35.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 06:35:20 -0700 (PDT) From: Neil Armstrong To: agust@denx.de Date: Mon, 29 Jul 2019 15:35:18 +0200 Message-Id: <20190729133518.8287-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [U-Boot] [PATCH] edid: fix edid_get_timing_validate() mode_valid lookup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a condition to the break in the modes lookup, without this when the first mode is not valid, then edid_get_timing_validate() return an error instead of checking the next modes. Fixes: 1c1ed441b0d1 ("edid: add edid_get_timing_validate() variant to filter out edid modes") Signed-off-by: Neil Armstrong --- common/edid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/edid.c b/common/edid.c index f244d26e04..f99f42dc40 100644 --- a/common/edid.c +++ b/common/edid.c @@ -202,7 +202,9 @@ int edid_get_timing_validate(u8 *buf, int buf_size, timing); else timing_done = true; - break; + + if (timing_done) + break; } } if (!timing_done)