Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp805185rdb; Tue, 5 Dec 2023 23:39:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/N4ZntOftMyEkdX3hjn/SxViNC7OOb9BiwG1kmsQG2DJN201hqMO1eLAlpbL34rH5csmb X-Received: by 2002:a05:6871:491:b0:1fa:f094:5a03 with SMTP id f17-20020a056871049100b001faf0945a03mr519819oaj.12.1701848385693; Tue, 05 Dec 2023 23:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701848385; cv=none; d=google.com; s=arc-20160816; b=O48CJBAKlf/M1S+uoSTtEug1XSbw6g5WZL2IEh5ASES3kwPh37GA+9QWDIEX+Lf3rM KPfhSTl11ow84yXWM3vEBUkFchLZBAI0afXkwP24etFDeXLKKjWKnXgQryrMRtcDysFC q9TOLB8jEc3S6em6jgddyuvOPShEuHq/cZruJ/G7df3h+Re1OEybMVxNRJdLSzdHNJPA vr0STkGjRi7AJiEV2VmlxB1XDA2Nd1FbJ08+e4oVPzdxfLz7SCf4GDPweubF0hkLsBsX ZlNP34wmnEGxH5j4WvWB+HteLkH8YVPOAqefdDBCQtjBJOTAotzphwWmoS/8lUgFRA/d Selg== 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=Q/sOctRxFTfxMGfHCM66nxB/hFQBaYmCZybggJEfmSg=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=PvEjGei09BexV/oGlJ6iPbDgIQnrwugVwh8upNihA+1D2sRIhyKtpyBJYYxl7B5nXP uRTQs6B3m9QnVjgCQL8yJ00WZ0FRq/TrTPQ6u7tYlhoLs57OFqvo+ZPbGOu7d7MT5rmT eGHIPo+6fi/hibWP2UbNOz6NfJzTUvbN1XBTpZLsMuk6m3XqEL4h/pWUyl63J1OPuF4s iOH2hpmK92O4iIUbKCTwU/xm6cyneIHhJYBF3DKuI+h7jd65gvk5FHsTW1IcOSzKT/3d AY6ZiWwqdNLzlX59ty6rq8FO7fYX1K/dCOol1MAvbyLI0aefkIXjduXrOJX46y7Hoe15 W4zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AyP9uT8U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id z14-20020a63e54e000000b005c21d7d1114si11373501pgj.818.2023.12.05.23.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 23:39:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AyP9uT8U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D7D7A81A4451; Tue, 5 Dec 2023 23:39:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377038AbjLFHjI (ORCPT + 99 others); Wed, 6 Dec 2023 02:39:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjLFHid (ORCPT ); Wed, 6 Dec 2023 02:38:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60BC71FD0 for ; Tue, 5 Dec 2023 23:37:55 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583B9C433CB; Wed, 6 Dec 2023 07:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701848275; bh=omxGS8CIFs5M7dlqv12y1t6jFG26IXkN60+x4JAd2q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AyP9uT8U/FSUMpRhl+seVa3V0u89PJEz2UC/GoWxJuLZmYd3IyetkvpzjZYP838MQ zl/zeIm0Xdpq3LUfZKSocGVcgFiBB2du6R+vn6bDMITmq8HWV2G+3/vtalpS4+nvJz liMLJ89JXKDw4A4mJxtFdRN48LfOPkLu6Pi5XxWw6AqbgM9oQW3CDPs1reX/hEAgOV Sc/D2/S4fAI4OeXmHGtcXHF7WjOQV4IPWTCw8rF64I7zJuXqkTzg/l+YxuGnuXr53b AoQdeYGFwo7EYQ871WP8HMph/blBA68qHlGIeqWszOzzGEjp+9HTOdrpgybCZA+wI0 dxa9bPoNGZpyw== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 17/27] tty: moxa: convert to u8 and size_t Date: Wed, 6 Dec 2023 08:37:02 +0100 Message-ID: <20231206073712.17776-18-jirislaby@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231206073712.17776-1-jirislaby@kernel.org> References: <20231206073712.17776-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 05 Dec 2023 23:39:38 -0800 (PST) Switch character types to u8 and sizes to size_t. To conform to characters/sizes in the rest of the tty layer. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/moxa.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index bf3f87ba3a92..ebaada8db929 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -514,7 +514,7 @@ static void MoxaPortLineCtrl(struct moxa_port *, bool, bool); static void MoxaPortFlowCtrl(struct moxa_port *, int, int, int, int, int); static int MoxaPortLineStatus(struct moxa_port *); static void MoxaPortFlushData(struct moxa_port *, int); -static int MoxaPortWriteData(struct tty_struct *, const unsigned char *, int); +static ssize_t MoxaPortWriteData(struct tty_struct *, const u8 *, size_t); static int MoxaPortReadData(struct moxa_port *); static unsigned int MoxaPortTxQueue(struct moxa_port *); static int MoxaPortRxQueue(struct moxa_port *); @@ -1933,10 +1933,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode) * * Function 20: Write data. * Syntax: - * int MoxaPortWriteData(int port, unsigned char * buffer, int length); + * ssize_t MoxaPortWriteData(int port, u8 *buffer, size_t length); * int port : port number (0 - 127) - * unsigned char * buffer : pointer to write data buffer. - * int length : write data length + * u8 *buffer : pointer to write data buffer. + * size_t length : write data length * * return: 0 - length : real write data length * @@ -2163,11 +2163,12 @@ static int MoxaPortLineStatus(struct moxa_port *port) return val; } -static int MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, int len) +static ssize_t MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, + size_t len) { struct moxa_port *port = tty->driver_data; void __iomem *baseAddr, *ofsAddr, *ofs; - unsigned int c, total; + size_t c, total; u16 head, tail, tx_mask, spage, epage; u16 pageno, pageofs, bufhead; @@ -2224,8 +2225,8 @@ static int MoxaPortWriteData(struct tty_struct *tty, const u8 *buffer, int len) static int MoxaPortReadData(struct moxa_port *port) { struct tty_struct *tty = port->port.tty; - unsigned char *dst; void __iomem *baseAddr, *ofsAddr, *ofs; + u8 *dst; unsigned int count, len, total; u16 tail, rx_mask, spage, epage; u16 pageno, pageofs, bufhead, head; -- 2.43.0