From mboxrd@z Thu Jan 1 00:00:00 1970 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 8FDA0C001DE for ; Thu, 10 Aug 2023 09:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjHJJQC (ORCPT ); Thu, 10 Aug 2023 05:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234502AbjHJJPe (ORCPT ); Thu, 10 Aug 2023 05:15:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0B4D2D44; Thu, 10 Aug 2023 02:15:33 -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 91192654CA; Thu, 10 Aug 2023 09:15:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E59C7C433C7; Thu, 10 Aug 2023 09:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691658933; bh=2EzU32teHPEFx7Xv34ToEm1KLNnvf7toM6OFIjfeOoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhih7r29/qbhXewjgFbenYyT2i/Tk03ucby90aVLjhlaoZrLz8LpZkRP2L5VcQYLh 3vtkYBuHxJedegGll/7s1c/Qtcz6EltHJCDHB7zQslfc3WtealRYEAgdyQDctrIf0N 6LwlnIjBpp+G1xiFV1Tt8jhhCreNIiX118NFPuRoDE4DWGz+8psZb+WiOTiIy2uOS4 SYPJBvVdds3uSRCIoeEFQ9+DmB5bXIV6hkjuzvh5XTeNM110dnJ0at/pWAesI+zHM8 sZDrriZUpIswXpybKFATqtWuBBPuQaX0VDFfa0tNi37zdUoCYZttaUtLTxzVtZLPbX 30pE8pE83t3xQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 11/36] tty: switch receive_buf() counts to size_t Date: Thu, 10 Aug 2023 11:14:45 +0200 Message-ID: <20230810091510.13006-12-jirislaby@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230810091510.13006-1-jirislaby@kernel.org> References: <20230810091510.13006-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 'size_t' is what receive_buf() expects and returns while handling count. So switch to 'size_t'. This renders both local 'count' and 'rcvd' in flush_to_ldisc() to be size_t too. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/tty_buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 42464c37125a..7182dab60fac 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -502,12 +502,12 @@ static void lookahead_bufs(struct tty_port *port, struct tty_buffer *head) } } -static int -receive_buf(struct tty_port *port, struct tty_buffer *head, int count) +static size_t +receive_buf(struct tty_port *port, struct tty_buffer *head, size_t count) { u8 *p = char_buf_ptr(head, head->read); const u8 *f = NULL; - int n; + size_t n; if (head->flags) f = flag_buf_ptr(head, head->read); @@ -539,7 +539,7 @@ static void flush_to_ldisc(struct work_struct *work) while (1) { struct tty_buffer *head = buf->head; struct tty_buffer *next; - int count, rcvd; + size_t count, rcvd; /* Ldisc or user is trying to gain exclusive access */ if (atomic_read(&buf->priority)) -- 2.41.0