Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4564020rdb; Tue, 12 Dec 2023 03:18:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoTaeP8uOAjIkS2cMUsD+XP9sg2+G2MZiu9DFF3cQduhhUBvGfmyFa/U3ZlRUbbd/wBJLC X-Received: by 2002:a17:902:82c4:b0:1d0:b693:ae31 with SMTP id u4-20020a17090282c400b001d0b693ae31mr2620541plz.27.1702379894143; Tue, 12 Dec 2023 03:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702379894; cv=none; d=google.com; s=arc-20160816; b=1G0EUuqF8Zi+RlwH1cJraoSfe3r481/xZhWvtmkQ3TDXVzg9rNrf73KGKrqm0ub+H9 1QxCs4i8sP/4FimuOguuyLd48Jlsw9+AzYOI+cTn3ASMJ8SethhXslgjwjs867Ry5ydn aG5sprrJJK/x8KDg6qmRK6Sy5BF0qE8gFRed1gcoSlrvzudXndyx36ZokIoYzEiFkMn6 TxbFms2Y46DM/DU9lhs1rz6MAMlMztt1qm6aSMVSQzyDVu1ySRgwRGsjmSPI+KF1f0cm TjVlKqZfcpfx5vcfe4ty/hB87mwMhHi8nq5LPhJhoixvbihZYr2S3Jz5mE2NKkBlUmqo Q+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-filter; bh=NGgi0dcX52R2Hsj4L3+FbfcgEQzNcKvB9lQQ3MuTsMU=; fh=pXyOQNEb+817yi6tjB/1cXkb3oDI+NpZhxZJ/DMqhcM=; b=V+Rzt4YYw8hep9POSgCfhPgsp9t1dHTqoRliKmKZNNWmpXjApqYpwPhJ9/MF13jb+k +t/JEL/TFZPU6S6/DtAPWE5IxUiPyVdnbf0EDA3uFbz6q4EjU6wCl7WtMzDfliMkqXwr LV0SjIu48WJpZ7FM2uuDpMP69zvT5EMK6f/7fin2PfABXmCq3XoM0QUYYXtj6rHNp9hy pPn+KNEdLR80EpVNHE8yfL3YuEn+2AmgiaQINiXuZGsdJy5Zraro+g7CudIQTO+6YvB+ 2YRES9GLjuAZHSGEvdOsM5e8iKqf/iHgDsy0Yspxr6S7HKqX2XxXA9SOScMexiAyUPw1 lRig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=yf9uSjnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=infotecs.ru Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z16-20020a170903019000b001cc2853bfe6si7909680plg.192.2023.12.12.03.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 03:18:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=yf9uSjnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=infotecs.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CFB3F8053C7A; Tue, 12 Dec 2023 03:18:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346394AbjLLLRh (ORCPT + 99 others); Tue, 12 Dec 2023 06:17:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346325AbjLLLRX (ORCPT ); Tue, 12 Dec 2023 06:17:23 -0500 Received: from mx0.infotecs.ru (mx0.infotecs.ru [91.244.183.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C63F3 for ; Tue, 12 Dec 2023 03:17:24 -0800 (PST) Received: from mx0.infotecs-nt (localhost [127.0.0.1]) by mx0.infotecs.ru (Postfix) with ESMTP id 01A9512012CC; Tue, 12 Dec 2023 14:17:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx0.infotecs.ru 01A9512012CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infotecs.ru; s=mx; t=1702379842; bh=NGgi0dcX52R2Hsj4L3+FbfcgEQzNcKvB9lQQ3MuTsMU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=yf9uSjnfSWd9Z6nU5qzdpDu1E6K56w8q7WFPFG4TuxgPYtF2JMi4zUfPChAPYr/nA 8eb0GAF1eTAVW/7Mntf44BrvSbA0Hsrjh/nlAP3kR2IUHPPr9R7KscS7U8/9zzkS4Q atAMHnULdGJb873TXYD3d8cZGVwk/8yxi84neSNU= Received: from msk-exch-02.infotecs-nt (msk-exch-02.infotecs-nt [10.0.7.192]) by mx0.infotecs-nt (Postfix) with ESMTP id EE62D316EE01; Tue, 12 Dec 2023 14:17:21 +0300 (MSK) From: Gavrilov Ilia To: "stable@vger.kernel.org" , Greg Kroah-Hartman CC: Daniel Starke , Jiri Slaby , Russ Gorby , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" , Jiri Slaby Subject: [PATCH 5.10 2/3] tty: n_gsm, remove duplicates of parameters Thread-Topic: [PATCH 5.10 2/3] tty: n_gsm, remove duplicates of parameters Thread-Index: AQHaLOzGj9Cp/lEMc0uytGwtXjUNjQ== Date: Tue, 12 Dec 2023 11:17:21 +0000 Message-ID: <20231212111431.4064760-3-Ilia.Gavrilov@infotecs.ru> References: <20231212111431.4064760-1-Ilia.Gavrilov@infotecs.ru> In-Reply-To: <20231212111431.4064760-1-Ilia.Gavrilov@infotecs.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.17.0.10] x-exclaimer-md-config: 208ac3cd-1ed4-4982-a353-bdefac89ac0a Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KLMS-Rule-ID: 5 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, bases: 2023/12/12 08:32:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/12/12 02:27:00 #22664189 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 03:18:11 -0800 (PST) From: Jiri Slaby commit b93db97e1ca08e500305bc46b08c72e2232c4be1 upstream. dp, f, and i are only duplicates of gsmld_receive_buf's parameters. Use the parameters directly (cp, fp, and count) and delete these local variables. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210302062214.29627-41-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman Signed-off-by: Gavrilov Ilia --- drivers/tty/n_gsm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 7a883a2c0c50..2455f952e0aa 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2577,27 +2577,24 @@ static void gsmld_receive_buf(struct tty_struct *tt= y, const unsigned char *cp, char *fp, int count) { struct gsm_mux *gsm =3D tty->disc_data; - const unsigned char *dp; - char *f; - int i; char flags =3D TTY_NORMAL; =20 if (debug & 4) print_hex_dump_bytes("gsmld_receive: ", DUMP_PREFIX_OFFSET, cp, count); =20 - for (i =3D count, dp =3D cp, f =3D fp; i; i--, dp++) { - if (f) - flags =3D *f++; + for (; count; count--, cp++) { + if (fp) + flags =3D *fp++; switch (flags) { case TTY_NORMAL: - gsm->receive(gsm, *dp); + gsm->receive(gsm, *cp); break; case TTY_OVERRUN: case TTY_BREAK: case TTY_PARITY: case TTY_FRAME: - gsm_error(gsm, *dp, flags); + gsm_error(gsm, *cp, flags); break; default: WARN_ONCE(1, "%s: unknown flag %d\n", --=20 2.39.2