From patchwork Mon Jul 18 05:09:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzung-Bi Shih X-Patchwork-Id: 12920726 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D47ADA47 for ; Mon, 18 Jul 2022 05:10:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C98B8C341D0; Mon, 18 Jul 2022 05:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658121015; bh=AiSiBQ+ZaUZkBmavl4dmYj+PPOpZmD0zS6L5wecAMb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dl6hlM84u/rIJC03z6Acjppsw5YvKJqmX/f4eXYe8cxJtRQ9a83UHYRO06bf44hSq lg95VYqHbnPrkCPsH0qb3SOGOnCJ7Aye5lI9pLx6gVK1RRtUmUeCnxS9hIJ10pS8F/ jYSlK2O3j6z4/9vCZhaI6FGbQzG8wuSBidQmiUtpAOzg8zLeZNfqr0Tg/jefx8Jo6M nQ02D8lHWq27Eoqj9S/QiTmzoNU0NztX5WDKSlwn+zF3eFiLTLtDTS1Fuqj/f6mRXh I95bHfEm2UBS//PzDg5K0IyB4CS2hZ5Tpab5ZSRreJwO0LT+aLX3XIuR2On3Q8o8Rn DZCIP6gDPk2UA== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/10] platform/chrome: cros_ec_proto: change Kunit expectation when timed out Date: Mon, 18 Jul 2022 05:09:11 +0000 Message-Id: <20220718050914.2267370-8-tzungbi@kernel.org> X-Mailer: git-send-email 2.37.0.170.g444d1eabd0-goog In-Reply-To: <20220718050914.2267370-1-tzungbi@kernel.org> References: <20220718050914.2267370-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 While EC_COMMS_STATUS_PROCESSING flag is still on after it tries EC_COMMAND_RETRIES times for sending EC_CMD_GET_COMMS_STATUS, cros_ec_wait_until_complete() doesn't return an error code. Change the expectation to an error code. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih --- Changes from v1: - Add R-b tag. drivers/platform/chrome/cros_ec_proto_test.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c index 64100fd81c6a..fbb872040711 100644 --- a/drivers/platform/chrome/cros_ec_proto_test.c +++ b/drivers/platform/chrome/cros_ec_proto_test.c @@ -1870,9 +1870,7 @@ static void cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing(st } ret = cros_ec_cmd_xfer(ec_dev, &msg); - KUNIT_EXPECT_EQ(test, ret, sizeof(struct ec_response_get_comms_status)); - - KUNIT_EXPECT_EQ(test, msg.result, EC_RES_SUCCESS); + KUNIT_EXPECT_EQ(test, ret, -EAGAIN); /* For EC_CMD_GET_COMMS_STATUS EC_COMMAND_RETRIES times. */ KUNIT_EXPECT_EQ(test, cros_kunit_ec_pkt_xfer_mock_called, 51);