Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp805662rdb; Tue, 5 Dec 2023 23:41:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFB6XWSglv2QxxkqdpORkYia7RjXdhJEGh5b3gnqQyY5bRPh3hLrs/zmpSV9mdvMCCdQFTg X-Received: by 2002:a17:902:e749:b0:1cf:aff5:8934 with SMTP id p9-20020a170902e74900b001cfaff58934mr286833plf.48.1701848469900; Tue, 05 Dec 2023 23:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701848469; cv=none; d=google.com; s=arc-20160816; b=l/aH4vTDbJHfZF0av1BW8g0L0lwWzrnFlxsggemJZQI9/HFP9wf6XD4C6oTer6X6Pv nAt0gCL/hpnqIvKgF6EurknGN1UkhONs1sJxphqRcSDQV3/0ZF+xxEa3IOTQYfcTn2If y4sudrueG7XXYy92LeHUUkHAxSwyuaVKZaO0ZTHPho7Rq7hjoZUg6Vrv3jO7CKwVeq+E x9J9nQvTnvKqkNoGMXIi5myacdlf+FNb7j70XxMIrZsAxn9nrCUZPTAhOtchUhrKkIg0 Mco4UDWm/489op0Sni1q1l2MM+P7plvQOz1EnOZAOcr/hHGvJjjzlJW6j/jyplM9DRTu UHxQ== 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=Wp/k7/Ly9rA2XwhOBL6tzoDm6XBKRYZoG5LlVkouUbs=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=HPtLg0xgPWKUQ3LTD5TGdfE1W+2+Ov+8xkFpjxePqoci84ieLedjl1xutyFrMjibNX ovNVdhpttY+l4/dbnc07TsdIcqfJ4YqaWZPQ9D+8BzUW0AIDuB9KzaYuixSGmlHkNC8v vUfr6eESyRtI7hcAAizmQSv2XfemGVV+oTDhR7s1h7DbYAKjo4EpuoeeYetOU/+GS+Bi q3YVVHWs8C9puxozJp6IVt9Ghi/Hlgha/K9uzI3MS/sJfyhVq2MAkZCNRlnJsiTUvt7m LuBx7Iz0QRyLPxHPfB7eHXQEW0KPSgoqE02Qk2XTY2hP5CwnfSXPBoXE5gGpbgJ5oU25 67Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VnUYJE4W; 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 p19-20020a170902b09300b001d062135ef8si7806079plr.601.2023.12.05.23.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 23:41:09 -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=VnUYJE4W; 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 EE33980811E3; Tue, 5 Dec 2023 23:40:39 -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 S1376902AbjLFHjf (ORCPT + 99 others); Wed, 6 Dec 2023 02:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbjLFHit (ORCPT ); Wed, 6 Dec 2023 02:38:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE711FEE for ; Tue, 5 Dec 2023 23:37:58 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55489C43395; Wed, 6 Dec 2023 07:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701848278; bh=Q04vqTxy1dsmgwziXnh2z+E07djY9pp2DTirob84VpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VnUYJE4WxrpV8oP6RIh0fSZ1s3YaiBSY+FPXAeMX5AD0B1pnY73aWQScG2TfWm0E2 0N9agwCmSyijagcDcvp/YUSZDuad29IdpcHVF5fyhal8ACXmKkFz6RPAcpS5Q4s8ge wPrgJf0HYDEqLPs0B0XeZ8LHKUyFsfa1p0gEVQQyTB7Fiz/bOTFpmun8WM+eyB3LbV 7slSLbYBb5AJulDKq1GiJLxXpRY0ODLwUKZ0Q+m1fbjKAx+oJZDpeqZM//1JhWjISB 5W4PLxMGyNoR1Y5jDo2RFvQM/RJ0LZmRqexcj971xsv8iqi6w7ces6RZaoeJJuDOeu eHM5/dCLNo3KA== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 19/27] tty: n_gsm: convert to u8 and size_t Date: Wed, 6 Dec 2023 08:37:04 +0100 Message-ID: <20231206073712.17776-20-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:40:40 -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/n_gsm.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index a3ab3946e4ad..4036566febcb 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -124,8 +124,8 @@ struct gsm_msg { u8 addr; /* DLCI address + flags */ u8 ctrl; /* Control byte + flags */ unsigned int len; /* Length of data block (can be zero) */ - unsigned char *data; /* Points into buffer but not at the start */ - unsigned char buffer[]; + u8 *data; /* Points into buffer but not at the start */ + u8 buffer[]; }; enum gsm_dlci_state { @@ -283,7 +283,7 @@ struct gsm_mux { /* Bits for GSM mode decoding */ /* Framing Layer */ - unsigned char *buf; + u8 *buf; enum gsm_mux_state state; unsigned int len; unsigned int address; @@ -2856,7 +2856,7 @@ static void gsm_queue(struct gsm_mux *gsm) * Receive bytes in gsm mode 0 */ -static void gsm0_receive(struct gsm_mux *gsm, unsigned char c) +static void gsm0_receive(struct gsm_mux *gsm, u8 c) { unsigned int len; @@ -2947,7 +2947,7 @@ static void gsm0_receive(struct gsm_mux *gsm, unsigned char c) * Receive bytes in mode 1 (Advanced option) */ -static void gsm1_receive(struct gsm_mux *gsm, unsigned char c) +static void gsm1_receive(struct gsm_mux *gsm, u8 c) { /* handle XON/XOFF */ if ((c & ISO_IEC_646_MASK) == XON) { @@ -3541,7 +3541,7 @@ static void gsmld_receive_buf(struct tty_struct *tty, const u8 *cp, const u8 *fp, size_t count) { struct gsm_mux *gsm = tty->disc_data; - char flags = TTY_NORMAL; + u8 flags = TTY_NORMAL; if (debug & DBG_DATA) gsm_hex_dump_bytes(__func__, cp, count); @@ -3711,7 +3711,7 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, { struct gsm_mux *gsm = tty->disc_data; unsigned long flags; - int space; + size_t space; int ret; if (!gsm) @@ -3909,8 +3909,7 @@ static void gsm_mux_net_tx_timeout(struct net_device *net, unsigned int txqueue) net->stats.tx_errors++; } -static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, - const unsigned char *in_buf, int size) +static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, const u8 *in_buf, int size) { struct net_device *net = dlci->net; struct sk_buff *skb; -- 2.43.0