Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp512044rdb; Tue, 19 Sep 2023 02:06:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIHLJzae+UWgqCHjtAeFf4yUYHgfZ1jVPDa3/jb9LuK7Rvdpqp7mXgSGmdYYpOlsfydpo9 X-Received: by 2002:a17:902:d54e:b0:1bd:d141:f02d with SMTP id z14-20020a170902d54e00b001bdd141f02dmr8716137plf.68.1695114415815; Tue, 19 Sep 2023 02:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695114415; cv=none; d=google.com; s=arc-20160816; b=HgXIevczMtZpB0qpr5zdf1JF6/YRI+aP7pZvfhArV4lJldFx3VLez6SZqDWlOyoTbd u5wUZ7pDIFhCGicFuKMB67XnSIU7iIXhdijtIUxJR5bSK62a1e54ca15nqPQYmepGVOw cv8FTJHWHBO9kbgaxXMAc17Pf4zwolbQE3TsoDYXEwBflsnnpP2kDsr25CtvT2brL6cV hvTSabOheydwl8HNJzxo23RWH/B3WI4fPTiZ+DhPEUDz5W9M/s9Io8649xeKj5+WgI0E ILUEykRJ+b8ATOVhzgd5HUenSRO0aern9LUEYBuD2yBu/nuwCVjnJ6oLegsb5N2zcDxZ jUBw== 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=mOALrz2d+YNNWhYHeYrldTuwov9H+ORaSRYgWRI5keY=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=LFmrABOWhFzUDRUYZB1UJzxC1MkWk6J2AenM+WFf9Q2LFKDKwwCSFtzq0XuB0ZAd+o 9L3B2LVgZLTPw+It9GrL0PCAixsrwRUlIa6eD2RDMfggKBTFUGnJtGuuz8rHcpLdx9Vz v8kSSn2oZPBtmNYHzX+T3sVfeBFrIhD1cZs83Nq6pMPG0ozVsZp+gawkbKz4b9UNman7 3m555UPHpW9QjQ+zaF2D0TrIoH5dQJYhUvpTOye3hQAe3sLYyDSgcLHhwU1/pza1hyu1 OdVTWawhISB0gzmVEri0ORG2zesQcOrse7DTQ+hfv4yAsL7dWNwToi1strp/UtIzGXKl DZTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uJQll1Zm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id le13-20020a170902fb0d00b001c3323ff53asi9223884plb.139.2023.09.19.02.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 02:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uJQll1Zm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 192068028F66; Tue, 19 Sep 2023 01:52:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbjISIwS (ORCPT + 99 others); Tue, 19 Sep 2023 04:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjISIwI (ORCPT ); Tue, 19 Sep 2023 04:52:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B11115; Tue, 19 Sep 2023 01:52:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 871DCC433C9; Tue, 19 Sep 2023 08:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695113522; bh=G9M97eO3CGXGTSXO+0/2OlKFcuUp/E1ELuqJbqNhEGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJQll1ZmauxeJU4pKgcDlD9rkOF/GzfxVwwWk5QHvDrGkRFAPLBvRh0ztgj8f6wRO 5r3+MJWp4UI1M5bXxrptPZMDsdAGuA/40twKpUGHiWJJeLrjQQlpZcjcm4/dBFPLHQ cfF2jDWFortZ7UC+wfaYvFya8RTu2hh8SLj1+m9GA0HPzoLjt7/wkBqBIvQjgeXGM0 wOhBp3ePQlLHOaCv5mihegcPO2GkEugER1OmTU9rN46CKUNZGrLPhFRRD9+nI7I02W bAEHMYKhaEzcyqbW2NViQaM1cjYQMSiIHxachukp7oemNS2q4IceBxQ2iiA0pi6BvP IgBZOKvU9dAbg== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 02/15] tty: n_tty: rename and retype 'retval' in n_tty_ioctl() Date: Tue, 19 Sep 2023 10:51:43 +0200 Message-ID: <20230919085156.1578-3-jirislaby@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230919085156.1578-1-jirislaby@kernel.org> References: <20230919085156.1578-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 01:52:24 -0700 (PDT) The value stored to the current 'retval' is number of characters. It is both obtained and put to user as unsigned. So make its type unsigned. And provided it's not a "return value" per se, rename it to 'num'. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/n_tty.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 71aa898b077a..e917faa0b84c 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2498,7 +2498,7 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct n_tty_data *ldata = tty->disc_data; - int retval; + unsigned int num; switch (cmd) { case TIOCOUTQ: @@ -2506,11 +2506,11 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd, case TIOCINQ: down_write(&tty->termios_rwsem); if (L_ICANON(tty) && !L_EXTPROC(tty)) - retval = inq_canon(ldata); + num = inq_canon(ldata); else - retval = read_cnt(ldata); + num = read_cnt(ldata); up_write(&tty->termios_rwsem); - return put_user(retval, (unsigned int __user *) arg); + return put_user(num, (unsigned int __user *) arg); default: return n_tty_ioctl_helper(tty, cmd, arg); } -- 2.42.0