Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5479CEB64D9 for ; Sat, 17 Jun 2023 10:50:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A295E862FA; Sat, 17 Jun 2023 12:50:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TButr/ol"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B67AA862E8; Sat, 17 Jun 2023 12:50:21 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 74FE7862E7 for ; Sat, 17 Jun 2023 12:50:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f9002a1a9bso7253605e9.1 for ; Sat, 17 Jun 2023 03:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686999019; x=1689591019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kG5xt0Z1be10AdXke5vB+nmq74VE7Dqk7dPZmN+ZUlI=; b=TButr/olAK4r7uISh9RwK4rIVj4omsG88e5OV3AkDVFGdLZEHOOYCV2j7mtNfOp1lI OY/jO5JSsX3mrsuZZFExSmRKRUMn6QajeMM6om/NZArV0nope9Dl2T7y5TAkrR5O73+i HStqlHhw15K8NMbgI/zqM1nyt3iJzZRBKSjuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686999019; x=1689591019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kG5xt0Z1be10AdXke5vB+nmq74VE7Dqk7dPZmN+ZUlI=; b=aNbGktg99VRZDJrM/fxKPOwBnunURKxA1OCHUZ+c75bbvjCg4xSDhjkHLOsNbpYtSP CltJaJP6MRSjf4l9XTCu/FbdeWK3w1vOyemrsjDFYeeQ3PAoFSaE0S1s892Zm/TE9ymB t3pZud227DrB678uduRb/e+Ob8WRQpWyJntXWPEQL3THVnBxh75Eh6LVVsjvvN2g2AHV AOkYUJJXXHDswdo81wC+VahZbhY7XvtIy+KB92Xm+/t/yUmZLZzLyv9HLrmvt2no1kO4 S04Z9REgLfuKDHc3u3q1RiW7mX1Uwf/84bSMhsjcFCS+NC6jrJA6Gn0yjffhWvgnYHpO zlqA== X-Gm-Message-State: AC+VfDw/d/jkutOu+pFeSRlnvpzVNpgtbuF4IYxsHfIHSUh4caEZoF25 cIrgE2eb8EdrdMMQdIMuzP0LxfbeBgivN5uwOdI= X-Google-Smtp-Source: ACHHUZ5fJda4BhYeCvuHQjdEhnG68cGar5sKonbfgjVWat9eMqiNLfUEJAnffmg+aWjThVM/GnkjtA== X-Received: by 2002:a7b:cc9a:0:b0:3f8:a15:b516 with SMTP id p26-20020a7bcc9a000000b003f80a15b516mr4014897wma.7.1686999018668; Sat, 17 Jun 2023 03:50:18 -0700 (PDT) Received: from sjg1.roam.corp.google.com (79-67-123-132.dynamic.dsl.as9105.com. [79.67.123.132]) by smtp.gmail.com with ESMTPSA id l22-20020a7bc356000000b003f7e4d143cfsm4735171wmj.15.2023.06.17.03.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 03:50:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Simon Glass Subject: [PATCH 2/6] nokia_rx51: Correct tstc() implementation Date: Sat, 17 Jun 2023 11:49:49 +0100 Message-ID: <20230617104956.1402370-3-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog In-Reply-To: <20230617104956.1402370-1-sjg@chromium.org> References: <20230617104956.1402370-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This returns false even when there are keys in the buffer. Fix it. Signed-off-by: Simon Glass --- board/nokia/rx51/rx51.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 238b9637badd..138f5a811eb6 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -668,6 +668,9 @@ static int rx51_kp_tstc(struct udevice *dev) u8 intr; u8 mods; + if ((KEYBUF_SIZE + keybuf_tail - keybuf_head) % KEYBUF_SIZE) + return 1; + /* localy lock twl4030 i2c bus */ if (test_and_set_bit(0, &twl_i2c_lock)) return 0; -- 2.41.0.162.gfafddb0af9-goog