Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp878675rwl; Thu, 10 Aug 2023 03:08:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAgem9k2xZNHjYdJpjMIoGQ6K67G7Ts55EJgqT2ZdAfdTj2mMpGpTJdkUnd09DImRFFenF X-Received: by 2002:a05:6830:20da:b0:6bc:f6d0:87d4 with SMTP id z26-20020a05683020da00b006bcf6d087d4mr2079767otq.29.1691662089917; Thu, 10 Aug 2023 03:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691662089; cv=none; d=google.com; s=arc-20160816; b=zTyKYhXrzmkpQAr58wzxhXw5ZchCSypCAAOWwMf1fkAnyFK6AQ3bPHFRnguxDw7QE2 k80MarO89vKvt8CPSv/FWD72YehMxReotMN/LHwVPCx880tMncYTuVxyK16qjU5HXfte 4nDcQiGSMjT5dNjcwT08Maz8zukRcKNGzbcPHlUGN0AXfY4uhl8nfWng8rpXGOUDEklJ AEeYYTuSz1BmIs1EcW8KYBdnbt+gr7XJLqkY0B/tU3d5kmN7whbdQyUNbDOzy3UB4WhN RSdOtevoTWAbgvz1y9mQ0SpWIbLrKJtHhyTwWeYVFVmwBkY10NR2uKHb/VoC+FAr5x0w g/qw== 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=AlpaXVPCjxNLJyi62kzp6GyPj2vHX4t2eWjX3rOJIf8=; fh=kBWRHGmZE7+t4/Ec1DE53j4t4sR/ycSoo8qMrR43ev0=; b=d+DwzyMM7JJXlVJ4CfdemVr+LAbLj2uTM6WBAn8EU/sVCnBEOdhsECzCyFmk0ONVS1 5Mehy0lsIdTMK1ttbLYE9VnDYqIwG6Rw8o+hT6NoYjwPfKvf0LHIfTT3DtxqPgLDhA/I vtOpz6uKT4MEZBz91lVEJxhQM47BUQcRCUgR0KWuhuobG1EEFAb7rN7lWVpuUeuEvUAz 1D48P6OQCV0FqZP6qmCWZih1KEOxa7AO2fUSjad7yZFbuywCRPyo8z+JDEwAQh5O7vBa gc3iqikixr8za1RMQXzCLwoZs7PYyoVnWYKu5qJnI4beCf+0lVj9YdLOPSVZfqhqKUlP TflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=epDptasY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca32-20020a056a0206a000b0056513361b55si1380098pgb.126.2023.08.10.03.07.57; Thu, 10 Aug 2023 03:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=epDptasY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234917AbjHJJTE (ORCPT + 99 others); Thu, 10 Aug 2023 05:19:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234691AbjHJJSS (ORCPT ); Thu, 10 Aug 2023 05:18:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16B5147DA; Thu, 10 Aug 2023 02:16:49 -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 CC61C654D7; Thu, 10 Aug 2023 09:16:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 035AEC433C8; Thu, 10 Aug 2023 09:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691658997; bh=zJE0WmFdaYb7Ti2ERniP+fEDjSx1UljWS7VoaTirjiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=epDptasYtf71uksmyF3AyJX63Xz++gBvXiLYpnCHLr3ySfJSc4lWoArFMZ5py/yI+ IqzOEkIdZ1EyZysLGkHNohXRtxY6+GmvKCUOv15KzxMZok4lb34U+SND0eGyuyVCw6 EXR+zxw/u1ayr97tNfHhzIYjkpqryYE6j5cSVk3cho4GGU/LHLF57ukLbUKL3w2kWZ 5JwIVKnqfjekzsqRrWA/EAZVj9LUUg+zKCaMd8Te5QbRmzEylq+QtCIundpXjg8W7D Nq1kI5zvMwtVQkxeY2O2hXEK87OLU5GKMP0IO7Bg1t7cSB6UPwdlvkON8qVeql4K87 LuGeI+7lS2SYA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" , linux-staging@lists.linux.dev Subject: [PATCH 34/36] tty: gdm724x: convert counts to size_t Date: Thu, 10 Aug 2023 11:15:08 +0200 Message-ID: <20230810091510.13006-35-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Unify the type of tty_operations::write() counters with the 'count' parameter. I.e. use size_t for them. This includes changing constants to UL to keep min() and avoid min_t(). Signed-off-by: Jiri Slaby (SUSE) Cc: linux-staging@lists.linux.dev --- drivers/staging/gdm724x/gdm_tty.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index b31f2afb0286..cbaaa8fa7474 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -17,9 +17,9 @@ #define GDM_TTY_MAJOR 0 #define GDM_TTY_MINOR 32 -#define WRITE_SIZE 2048 +#define WRITE_SIZE 2048UL -#define MUX_TX_MAX_SIZE 2048 +#define MUX_TX_MAX_SIZE 2048UL static inline bool gdm_tty_ready(struct gdm *gdm) { @@ -152,9 +152,8 @@ static void gdm_tty_send_complete(void *arg) static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len) { struct gdm *gdm = tty->driver_data; - int remain = len; - int sent_len = 0; - int sending_len = 0; + size_t remain = len; + size_t sent_len = 0; if (!gdm_tty_ready(gdm)) return -ENODEV; @@ -163,7 +162,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len) return 0; while (1) { - sending_len = min(MUX_TX_MAX_SIZE, remain); + size_t sending_len = min(MUX_TX_MAX_SIZE, remain); gdm->tty_dev->send_func(gdm->tty_dev->priv_dev, (void *)(buf + sent_len), sending_len, -- 2.41.0