From patchwork Wed Feb 22 20:23:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 59750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1658206wrn; Mon, 20 Feb 2023 19:58:55 -0800 (PST) X-Google-Smtp-Source: AK7set+t1UtOpMJ0r6AEdSxNn8bj5G/2FknJ7vEw70PDC3UfHUPddAYg3XA1tx0Yr9VjZ3pWzWog X-Received: by 2002:a05:600c:4393:b0:3e2:6f1:5203 with SMTP id e19-20020a05600c439300b003e206f15203mr1738481wmn.4.1676951935155; Mon, 20 Feb 2023 19:58:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676951935; cv=none; d=google.com; s=arc-20160816; b=vPolqkW4h5u/ypNkih5bg5qkrl38kcZflylhDpivDP5O4LUfbUjwpY/ggjmEovpr+6 BW41tb1ybLj0jWrRABMvB48UoQwrCBxBaNfMM1ledM0Pko1IBDhoZtQ2lDzfywmpGvmL BQNS19qLA+NvGgdLOJ6QqjTsiSxW4L03fuPBXEfShYqxqQ7ar67KpnmTq+K9C2BGoK5/ FeiOHn1kxooGypYmmfQMuSlGrZ8cv3Ye/NVkxOHhX0Rs6obNLWaQQfhJYvJzXoa/4jh9 9lj26ZdMpaTqKKdXcfFdvvXF1ZealxqodbcRYhOPnYYFRgUc2MLXYN1zSQKWPLsb1Q4m kSaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=muyrvTS9AgAdj6YZo6NFM9kuRvITbtRYUImQF80t278=; b=OBdbE2xVIzXSqh01vc/OMB+r+NRjxj5HEBpXALeuvZPpXVbsKptIzlpF/M80/VB7l5 ua9H+8ZgiLv7Utjk9CQhhHK9/JzyQhLVH+smWz/wbD8PDC106eiuD9EveMcU2OxlUbBh jrlB366dP5s8sv7MNFqQcqeJrtRA+9/ag6G8V4EiPArR+NiJTmPwShcCO4Qh2/64wiiC 8cqNSDFk2l8YqSFg7KtAsiq7dYsPg0IEZmQUJNQF5KeTltiq3l2zTbCoDNFbQVdCI8c1 vZ/8F5pO0tdOoldwBqIL9dlfgIYgRzPSHbSJFhFn8JJhYoOKMZCdEIYgkzU3Z5vChr7J Dt2w== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020adfe7cb000000b002c5a6560c1fsi12653025wrn.219.2023.02.20.19.58.31; Mon, 20 Feb 2023 19:58:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233226AbjBUDwI (ORCPT + 99 others); Mon, 20 Feb 2023 22:52:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbjBUDwG (ORCPT ); Mon, 20 Feb 2023 22:52:06 -0500 Received: from mail.nfschina.com (unknown [42.101.60.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C56B9 for ; Mon, 20 Feb 2023 19:51:50 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id CD0ED1A009BB; Tue, 21 Feb 2023 11:52:28 +0800 (CST) X-Virus-Scanned: amavisd-new at nfschina.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pCQ2vw8EJboU; Tue, 21 Feb 2023 11:52:28 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 09E0A1A00A50; Tue, 21 Feb 2023 11:52:28 +0800 (CST) From: Li zeming To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] tty: tty_ldisc: Remove the ret variable Date: Thu, 23 Feb 2023 04:23:03 +0800 Message-Id: <20230222202303.3195-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no 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?1758411552175506796?= X-GMAIL-MSGID: =?utf-8?q?1758411552175506796?= The int variable ret does not receive the return value in this function. It should be removed and returned 0 directly. Signed-off-by: Li zeming Reviewed-by: Jiri Slaby --- drivers/tty/tty_ldisc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index e758f44729e7..3f68e213df1f 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -58,7 +58,6 @@ static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS]; int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc) { unsigned long flags; - int ret = 0; if (new_ldisc->num < N_TTY || new_ldisc->num >= NR_LDISCS) return -EINVAL; @@ -67,7 +66,7 @@ int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc) tty_ldiscs[new_ldisc->num] = new_ldisc; raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags); - return ret; + return 0; } EXPORT_SYMBOL(tty_register_ldisc);