From patchwork Mon Jul 31 08:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 709527 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F2C1C04A94 for ; Mon, 31 Jul 2023 08:06:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjGaIGY (ORCPT ); Mon, 31 Jul 2023 04:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbjGaIEe (ORCPT ); Mon, 31 Jul 2023 04:04:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C409E1A6; Mon, 31 Jul 2023 01:03:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6170B60F33; Mon, 31 Jul 2023 08:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 882C2C433C9; Mon, 31 Jul 2023 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690790586; bh=+2+5Tnk3+q3dIP9/bYUXB3vDyW94Doym0JZK1jfkQpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fkoKyimKveikThTww6CG4ac9bXEwuyUSo1neOBMVcQrK84SM2A80Qhb7TEr9ptBhX CWHxlZWvIp7ntSAIW1ifiJBHuY94tsuBJ/erROBMHJd1f8le+MAAh/raO9wBH1zmai RM2BDg0tDqzaFQtKpW4YrlCBtgCH3cmtygr8nb0uuISuKevTLvGELTzZSKh+VHXGJb cNHnXHIKHwJock1jDKepc5AbC+TIqW6gACjRUBwyTWs7IZMZdzkUN9wQee0a9dIdzs gHZVixrhMnnt3YoJX8wXFrMYG/cEAillAeHkFMjbIibhOTNJbrx9BIYGWJTmMO9qfP nEAYEA8ZmalTg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , Arnd Bergmann Subject: [PATCH 10/10] misc: ti-st: don't check for tty data == NULL Date: Mon, 31 Jul 2023 10:02:44 +0200 Message-ID: <20230731080244.2698-11-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731080244.2698-1-jirislaby@kernel.org> References: <20230731080244.2698-1-jirislaby@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org tty data passed to tty_ldisc_ops::receive_buf() are never NULL. Remove this check. Signed-off-by: Jiri Slaby (SUSE) Cc: Arnd Bergmann --- drivers/misc/ti-st/st_core.c | 3 +-- drivers/misc/ti-st/st_kim.c | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index e2add50b191c..3b2145722bd7 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -234,8 +234,7 @@ static void st_int_recv(void *disc_data, struct st_data_s *st_gdata = (struct st_data_s *)disc_data; unsigned long flags; - /* tty_receive sent null ? */ - if (unlikely(ptr == NULL) || (st_gdata == NULL)) { + if (st_gdata == NULL) { pr_err(" received null from TTY "); return; } diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index 8c801897ffa2..5431a89924aa 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c @@ -135,11 +135,6 @@ static void kim_int_recv(struct kim_data_s *kim_gdata, pr_debug("%s", __func__); /* Decode received bytes here */ - if (unlikely(ptr == NULL)) { - pr_err(" received null from TTY "); - return; - } - while (count) { if (kim_gdata->rx_count) { len = min_t(unsigned int, kim_gdata->rx_count, count);