From patchwork Fri Nov 11 14:25:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 18855 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp780464wru; Fri, 11 Nov 2022 06:44:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf7CcCHgsTREzf6FQjvOh/2uVzU5RYA0Qe3RGjJCaGZr0JnN48GFP9VlNJWHzkCvrVlGGJW9 X-Received: by 2002:a17:906:48d7:b0:78d:cdce:bc52 with SMTP id d23-20020a17090648d700b0078dcdcebc52mr2105054ejt.469.1668177887038; Fri, 11 Nov 2022 06:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668177887; cv=none; d=google.com; s=arc-20160816; b=n2mdopZZxnPiqaPhtA43K9ZF3b2Z7nPBpo43O9X8GLzjvs9fcIMMDZlqUX73cx1+2N aHnoWktN+Fb/+MtvB5DE5uqLkePv8HDmU2b/NjNQY3KvAh6vMLkPVZ/0NlqXVD86XrPJ 9PYKoLQEn3+8rVP+Isj2fHFyr1KVfjTTXtTTO5GX4Lvd56/LyUYQHLHxpbNrsTXmleJY NN2c22RfPOm96+l0oTqp8ywm6/Ln5jtu9oN3eib53CIR6S+MpshVjysvI7/mnY5irpzO 4Pa0i2W0l2zNhsp2SglFLSIz5/B3Hy3ZJwuv7Y0P0sgUhUiQ30FL0YS2SAE1jdmVRKMs rXUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=uUT8IxsDML9WXun4qdsLGfdM1+h64/9TjvHvFjvN4YE=; b=jaV/6x1ktYNUP1CYrQa8IBggH1rR6VDwhYRRdHK3VIy32gYzClz8YBIuKkBPsNpnyf fJfqx/dBQmlsICWrYkaNgcaOTpcsx1ltLlUgUvbAx38v+LrqKvQogjKuv6dudEALlfCQ JJbM6Zu7Z5lBDi24kx9HtZ2nXDYvKDW2BHkVv8NrZw1MjON9x3wB4+JpHS2ToAqL+ykp qm93POV32rVdp90g/tQzxL4ynmJR5H9UAcw8JrwjiExyzzI9txWcq8Wx01BhAJbbZNi1 jkH3sCTCXjrgEdlfxSpfdp/jI7STuKCvaV/mDGwYTX+996yprtF5k/2v3NFIWpH8okFt vUnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FLByUkvF; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a056402159a00b00463c5d64f30si2090145edv.557.2022.11.11.06.44.23; Fri, 11 Nov 2022 06:44:47 -0800 (PST) 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=@intel.com header.s=Intel header.b=FLByUkvF; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233984AbiKKOZv (ORCPT + 99 others); Fri, 11 Nov 2022 09:25:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234248AbiKKOZL (ORCPT ); Fri, 11 Nov 2022 09:25:11 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 894AC391E9; Fri, 11 Nov 2022 06:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668176708; x=1699712708; h=date:from:to:cc:subject:message-id:mime-version; bh=m11pAB5y0zFrcscE/1egpbuT7jD+h/gvZLDvumXx/v8=; b=FLByUkvFGnOuQXxcDdqwDP0D+3v05oeu5wS5EMhNt2+sV/QDkwViIb7J J1aAOXMgquDjMrZkT2YCineTIRToc99cdcE6hK7jZkxDUQPK3VogvTxNa 4jvtCfW7M37225wsXeIjXE59bVhH9Jt3IEyyLxitXVb5vI/VCPJgqGThh quWOmxWAudTyIdYiwgVw2ipOBO6AQaa8o0LZKkz2w3a+APdVls4pxY1fl /mpSU5gNG8j2iiBysnVGWIhTW9RjKr/eQhws5YxUILjLaU2+Zm1rOcuWz 3itqtAeQl3wtXurMCjVy53YUHgvVG2dSmYXuwHcWWo3DmccagIEj5Z8D5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="292007805" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="292007805" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 06:25:08 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="632044092" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="632044092" Received: from iglushko-mobl1.ger.corp.intel.com ([10.249.44.68]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 06:25:05 -0800 Date: Fri, 11 Nov 2022 16:25:02 +0200 (EET) From: =?iso-8859-15?q?Ilpo_J=E4rvinen?= To: linux-serial , Greg Kroah-Hartman , Jiri Slaby cc: LKML Subject: [PATCH] n_tty: Rename tail to old_tail in n_tty_read() Message-ID: <22b37499-ff9a-7fc1-f6e0-58411328d122@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749211295792036566?= X-GMAIL-MSGID: =?utf-8?q?1749211295792036566?= The local tail variable in n_tty_read() is used for one purpose, it keeps the old tail. Thus, rename it appropriately to improve code readability. Signed-off-by: Ilpo Järvinen Reviewed-by: Jiri Slaby --- drivers/tty/n_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 597019690ae6..c8f56c9b1a1c 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2130,7 +2130,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, ssize_t retval = 0; long timeout; bool packet; - size_t tail; + size_t old_tail; /* * Is this a continuation of a read started earler? @@ -2193,7 +2193,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, } packet = tty->ctrl.packet; - tail = ldata->read_tail; + old_tail = ldata->read_tail; add_wait_queue(&tty->read_wait, &wait); while (nr) { @@ -2282,7 +2282,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, if (time) timeout = time; } - if (tail != ldata->read_tail) + if (old_tail != ldata->read_tail) n_tty_kick_worker(tty); up_read(&tty->termios_rwsem);