Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp498146iof; Mon, 6 Jun 2022 07:26:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO05786+nZVPeec2XKtzvhP0vC97+3DxyA9nggog0AOl94BBGrWIQ4vR4RScLpYVFfN/rW X-Received: by 2002:a17:902:7b8b:b0:166:332f:2490 with SMTP id w11-20020a1709027b8b00b00166332f2490mr24037323pll.68.1654525618648; Mon, 06 Jun 2022 07:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654525618; cv=none; d=google.com; s=arc-20160816; b=jMrm8CxjG2CIh0yz+js4XjNUaX+/DRZXy7I8FyyQFVRsAr4LwFXwuHA6vknrtTV4wT b35vPkgeDbveMOfAGVQAjnApC72mYybaVAcb6woFDvKes8i8y0kz3DOczwPR+bG06BUD AcAWnn0q0l9nQ9kBi/YrN5DRE3Il2bAhmDebYSemJjOqNb+1vkI4wHycwuwGi0eSxh0F ps8Ho/+ZOZsjVPazksvGDkl2WGzq8tKiCPrejZmP6Tk20sfC0u+QgvqwlAK+yM3FWqu6 JFFNm3meqNC2dA/etRkOPEiLg4vFQWBpkycg7V8bNWlQ8kKuDfWNR+AoQnOuTu5pgiRU R75g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CI4vC+y3H1dfN5HMJlK31S6c3TypWpqPHsY6uOVRqWo=; b=tfd4vK2z02bEOdy5Oe+KOO39o4GSIaAS+0bYqLCl0i92Yfn+5YfsUw18qOahky/3r6 KYjMRO26SlOPlV3yWbTHn566Y8sRS7QC31/CXD0IyVX3W+x2mRoOjbmVMYGuYihuizKz PV0MWUs5vdB8mx2CvYQ9Q5vX2eilOZ7iRODqozt/Y/AAJcaTWT9AvnOeo0ixX1ZnI7VZ LG/10rvyNr+KVpIyyu2DOwD6in70SgqCl0DshMYJN0PcvfB+lC7cXWI/kNemkO7SA7MT gDIE0bvEwPK/o/U7hYI/66adRsjbe3L+w08rT5z82qtiABH1iP7WIXUm3R87KD5KsqbK pLqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iX82aC1G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x64-20020a638643000000b003db74ac9a75si5701823pgd.464.2022.06.06.07.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 07:26:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iX82aC1G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 952ED1C13D; Mon, 6 Jun 2022 07:12:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239650AbiFFOM2 (ORCPT + 99 others); Mon, 6 Jun 2022 10:12:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239622AbiFFOME (ORCPT ); Mon, 6 Jun 2022 10:12:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E62C286D3 for ; Mon, 6 Jun 2022 07:12:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1D6F61381 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org send_command() already checks if `ec_dev->pkt_xfer` is NULL. Remove the redundant check. Signed-off-by: Tzung-Bi Shih --- 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); -- 2.36.1.255.ge46751e96f-goog