From patchwork Tue Sep 4 02:44:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaejoong Kim X-Patchwork-Id: 965681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NkGlnHpR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tVA03VPo"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 424B5p2NLnz9s3l for ; Tue, 4 Sep 2018 12:45:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=czxoOAgpYyt35dQHilhmdUz4mXhilV/BOUHUTvxKwzk=; b=NkGlnHpRVMdIBK6h58rEsmNoxO CJOgOocIxxHqVK/UO8t71yefPk4ayaYWjkJnBJuKmo7GICeBJkaiE9PUGXgWV+yZgdA7UvhbJdTnh 22D7L1iE5pBz5dJBwEg3bejDQutMfoXBeGN9w2B1TNBM4cNClB4zo8JVb0lbObNDJgws96uFsdtFZ 9UMU7r4jiTIZYZ05xABMOfAf6cawJ7a9BM0wn2qu6X+g29i3LwEUzCZRqoJ0ujLu4M+8JZZ6qdWNd ZyBMLxa3/HJ1y2RCKxnke+mIcSKxmZff81Duxy+HJ88jux2ptZR1WHZQr2HS7webHX+RaccYHBR6n NxOUeX2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fx1LE-0005FT-Ou; Tue, 04 Sep 2018 02:45:20 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fx1LA-00046G-RI for linux-um@lists.infradead.org; Tue, 04 Sep 2018 02:45:18 +0000 Received: by mail-pg1-x542.google.com with SMTP id r1-v6so872599pgp.11 for ; Mon, 03 Sep 2018 19:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0GxHfpXfEOk9XYTLZ+H5qwUF7ZNphH1CAsEDqllzqo4=; b=tVA03VPo7j3sVSscYTpVEeHmPevVxEsFXiCSw5Mnv0/iyykkV0CYzP7CjEdED8YAUT tvz132dLLZLXDkGnaZUOrXER24+hL6KKk6wiwu9DmPcaYeWbdN79jerVRpqXuSwY+e7z t01Xd4KhXs7tun7SiSM+IbULs8ypyeo+7JOEjSFjbMz0XSoewATUmJvY4GgnilINu2Zn 4GxLs8xfJ+Vau5f7kn8MKBV8dDXFihoGNe8/fA6DcfP+ZYKzs4k9njJ1QgAl0yRoyJUX wEV43MsOSsyaOqCabINkG7mX2la1PWjPxWFoZG7pNhOO+O9dncJxgFNQcWPPP3juSRAj iAdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0GxHfpXfEOk9XYTLZ+H5qwUF7ZNphH1CAsEDqllzqo4=; b=VZKMIK3jgUllVvpBTgTTGorMRIkEJ9IPX9GFjyxMUvxXvThD1ZiCWBMjHnpd1pmPl6 CRId2tY5ESZlqKqWbqi2nerQcSFTkSWcp/haBBxgGQLAUBDW2IXP9zff5BtCHyhcGI3K jHn3D1uT4p3zVHEMoS/WnMPB9iVVm5W1aZm4eVEFLW1pdZV54s2belHOqh+hNVPnSde4 lCzsFCwypq+8hTjGffil2piNENhHUkjzAQFPriHuh7YZD77C9ci8j91cEU6djOfcGdNu U98I+CxbXc8TglSaDJB3kaXkxtVEhSYaGWeuKEboTIGq7jOIZGH9EXGf5nYA7RBg7x52 XzHQ== X-Gm-Message-State: APzg51DwmsI9IE4Gnw2E6zQxM8bd/h3jrAhLt8JrjQlBZqv3ua18Wair nmADs2a0Vxpft05AE3WJXNxeez8D X-Google-Smtp-Source: ANB0VdYMoqLb/evAfeLiGb4LA0wUP6Kr4PZ9D+BeNrRRhwerJ+ChrZIwKifFRbtqIy9QW3nBIxcTQg== X-Received: by 2002:a63:8c0b:: with SMTP id m11-v6mr28828698pgd.372.1536029105898; Mon, 03 Sep 2018 19:45:05 -0700 (PDT) Received: from climb.lge.net ([27.122.242.77]) by smtp.gmail.com with ESMTPSA id w16-v6sm33663284pfi.101.2018.09.03.19.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Sep 2018 19:45:05 -0700 (PDT) From: Jaejoong Kim To: linux-um@lists.infradead.org, netdev@vger.kernel.org, linux-mmc@vger.kernel.org, linux-s390@vger.kernel.org, devel@driverdev.osuosl.org, greybus-dev@lists.linaro.org, linuxppc-dev@lists.ozlabs.org, linux-serial@vger.kernel.org, sparclinux@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/25] tty: Change return type to void Date: Tue, 4 Sep 2018 11:44:27 +0900 Message-Id: <1536029091-4426-2-git-send-email-climbbb.kim@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com> References: <1536029091-4426-1-git-send-email-climbbb.kim@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180903_194516_895378_66A3FBE7 X-CRM114-Status: GOOD ( 13.87 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (climbbb.kim[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Jiri Slaby MIME-Version: 1.0 Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Many drivers with tty use the tty_stand_install(). But, there is no need to handle the error, since it always returns 0. So, change the return type of tty_standard_install() and tty_port_install() to void type and remove unnecessary exception handling where we use these functions. Signed-off-by: Jaejoong Kim --- drivers/tty/tty_io.c | 10 ++++++---- drivers/tty/tty_port.c | 4 ++-- include/linux/tty.h | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 32bc3e3..b01cec8 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1196,13 +1196,12 @@ void tty_init_termios(struct tty_struct *tty) } EXPORT_SYMBOL_GPL(tty_init_termios); -int tty_standard_install(struct tty_driver *driver, struct tty_struct *tty) +void tty_standard_install(struct tty_driver *driver, struct tty_struct *tty) { tty_init_termios(tty); tty_driver_kref_get(driver); tty->count++; driver->ttys[tty->index] = tty; - return 0; } EXPORT_SYMBOL_GPL(tty_standard_install); @@ -1221,8 +1220,11 @@ EXPORT_SYMBOL_GPL(tty_standard_install); static int tty_driver_install_tty(struct tty_driver *driver, struct tty_struct *tty) { - return driver->ops->install ? driver->ops->install(driver, tty) : - tty_standard_install(driver, tty); + if (driver->ops->install) + return driver->ops->install(driver, tty); + + tty_standard_install(driver, tty); + return 0; } /** diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 25d7368..fd8d40d 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -656,11 +656,11 @@ EXPORT_SYMBOL(tty_port_close); * to a concrete tty specified by @tty. Use this or tty_port_register_device * (or both). Call tty_port_link_device as a last resort. */ -int tty_port_install(struct tty_port *port, struct tty_driver *driver, +void tty_port_install(struct tty_port *port, struct tty_driver *driver, struct tty_struct *tty) { tty->port = port; - return tty_standard_install(driver, tty); + tty_standard_install(driver, tty); } EXPORT_SYMBOL_GPL(tty_port_install); diff --git a/include/linux/tty.h b/include/linux/tty.h index c56e397..63cdac1 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -556,7 +556,7 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx); extern void tty_release_struct(struct tty_struct *tty, int idx); extern int tty_release(struct inode *inode, struct file *filp); extern void tty_init_termios(struct tty_struct *tty); -extern int tty_standard_install(struct tty_driver *driver, +extern void tty_standard_install(struct tty_driver *driver, struct tty_struct *tty); extern struct mutex tty_mutex; @@ -688,7 +688,7 @@ extern int tty_port_close_start(struct tty_port *port, extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); extern void tty_port_close(struct tty_port *port, struct tty_struct *tty, struct file *filp); -extern int tty_port_install(struct tty_port *port, struct tty_driver *driver, +extern void tty_port_install(struct tty_port *port, struct tty_driver *driver, struct tty_struct *tty); extern int tty_port_open(struct tty_port *port, struct tty_struct *tty, struct file *filp);