From patchwork Mon Jun 6 14:10:43 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: 12870402 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 8BC007E for ; Mon, 6 Jun 2022 14:12:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78E6BC3411F; Mon, 6 Jun 2022 14:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654524722; bh=sKbLOjcvTC3/wmYtXtfhTTJamRUWHaDSmI+uYF6/kc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iX82aC1GgIgH+mRpaBr9kO47GvUTJIvV+I0oYDV3ZK+pElUiY2AhudzCCvu3v+Lgo DU19u833X95M85CvHy5HuaRHqOtxPZDjMqfes9X8JkFq5S4Qh8Hascgg/oRa+H0Bpt zi2IOYgL+8gG5jKJ3+3yydTJK2UAu1m8e3LFg1Z5QhK/cHX3GJtEDL9u+2q1QAzIfH +QmAwwv1gYypmZ5Z/NKNCn8YQn5p0YRGRsgsC7yNT3AiZUHpScSAIEipcZdW24CAlR gN65Q0mTkDI/WO9vCW3QuTXNPNQRFbZaUDLLbchuUDnCSdWPC6M4qz/pVxi5+8SvAe M+t7bO9t3/jdQ== 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 05/13] platform/chrome: cros_ec_proto: remove redundant NULL check Date: Mon, 6 Jun 2022 14:10:43 +0000 Message-Id: <20220606141051.285823-6-tzungbi@kernel.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220606141051.285823-1-tzungbi@kernel.org> References: <20220606141051.285823-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 send_command() already checks if `ec_dev->pkt_xfer` is NULL. Remove the redundant check. Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck --- drivers/platform/chrome/cros_ec_proto.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c index 629dce3e6ab3..1b851dcd20c9 100644 --- a/drivers/platform/chrome/cros_ec_proto.c +++ b/drivers/platform/chrome/cros_ec_proto.c @@ -281,9 +281,6 @@ static int cros_ec_host_command_proto_query(struct cros_ec_device *ec_dev, */ int ret; - if (!ec_dev->pkt_xfer) - return -EPROTONOSUPPORT; - memset(msg, 0, sizeof(*msg)); msg->command = EC_CMD_PASSTHRU_OFFSET(devidx) | EC_CMD_GET_PROTOCOL_INFO; msg->insize = sizeof(struct ec_response_get_protocol_info);