From patchwork Mon Nov 27 19:14:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 13470213 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E4C6C4167B for ; Mon, 27 Nov 2023 19:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=w+T+mLur+kb59CwpVDoTwbaKRwlMo6/inTcyurqfXLw=; b=dn3Tm0KvElPJAJ jdhakgrwGK+qnPL0whar9o1Eamc5a1UEgABjaOWhHraeu16Hdq4x+DgcWss1l/UvHB8npjMKmvq5z Gm3Mp5nBg+e9dAFVmZJ5lBfIW2k2MBcbBFpP4oSF4Tewx4CgYhu53a1FrqqFChwvbZje3y7QgVZUD shkN3g3hYDuryHjqisDGlwcvquo/Ezr3IZHZ0LDIIj9n7eZibl05lU7GVQOTp4/TNcycIvXPWBJdi pGQylZfVdVr4IFxrZbhR1vrKtX1q3fhS2TgX6GZIqOh29ebEL50t/BGV1HJODAbo0SocTBvQlylzU dfOkLliFbHB/jc4Wcl/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7h43-003JoB-1a; Mon, 27 Nov 2023 19:14:39 +0000 Received: from mail11.truemail.it ([2001:4b7e:0:8::81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r7h3z-003Jm1-15; Mon, 27 Nov 2023 19:14:37 +0000 Received: from francesco-nb.corp.toradex.com (31-10-206-125.static.upc.ch [31.10.206.125]) by mail11.truemail.it (Postfix) with ESMTPA id BEC0A206D2; Mon, 27 Nov 2023 20:14:29 +0100 (CET) From: Francesco Dolcini To: Sean Wang , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Matthias Brugger , AngeloGioacchino Del Regno , Amitkumar Karwar , Neeraj Kale Cc: Francesco Dolcini , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH v1 0/3] Bluetooth: fix recv_buf() return value Date: Mon, 27 Nov 2023 20:14:05 +0100 Message-Id: <20231127191409.151254-1-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_111435_579214_96DADBD6 X-CRM114-Status: UNSURE ( 6.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Francesco Dolcini Serdev recv_buf() callback is supposed to return the amount of bytes consumed, therefore an int in between 0 and count. Do not return negative number in case of issue, just print an error and return count. This fixes a WARN in ttyport_receive_buf(). In addition to that a small cleanup patch is added on btnxpuart to remove a useless assignment. Francesco Dolcini (3): Bluetooth: btnxpuart: fix recv_buf() return value Bluetooth: btmtkuart: fix recv_buf() return value Bluetooth: btnxpuart: remove useless assignment drivers/bluetooth/btmtkuart.c | 11 +++-------- drivers/bluetooth/btnxpuart.c | 8 +++----- 2 files changed, 6 insertions(+), 13 deletions(-)