Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2116228imm; Mon, 3 Sep 2018 19:51:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ5xhuqX2EWPXPEL+PA/FaKd8CUW2XMZ/MylhmfTazijt03WrR25lk4zMLO0QRSOLmbW4sb X-Received: by 2002:a17:902:6115:: with SMTP id t21-v6mr31727057plj.92.1536029487517; Mon, 03 Sep 2018 19:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536029487; cv=none; d=google.com; s=arc-20160816; b=Rbcw6qWzsjNjin75QNAvL92KocWG0LvXDHsIGImD1Zu+St8MpWYcLCN0BNXqJAxugK It4zaBlQaguBjOq3ccPMnDi5Rmz5rRCGMNONZ3AwtJLoh/XctJPSJvBmm5VQUWFMrO7p E0k+jfrKykVPkKCg4pDtofUpo5fPQ05pEzF7iAmE0SAhbloOWGJs+LtGvaPYaFgSuY5c G77CGGPVR+yb2uw8YA8cyAaiDFqD7Q4JwAkpVhqQ0Jd6+BaeYL2F10rbVeIYuIScO7u1 CbBqcvmwAbtK+8LAQLKSBs11PXIx0SUViZl5ihC/FSLY9ycRUTMgFEzMnmVLNMuNj2V2 jkgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0GxHfpXfEOk9XYTLZ+H5qwUF7ZNphH1CAsEDqllzqo4=; b=bjDC2vuPEmwayfLI1JqSpheWTZAq1AhQHbjcaAj38/gFpAWPZN+cHa2VA8hmWCsyce JTaRiIh7BHIEmZPQknLOtsjNLY4VaQzXYtJnQdjl2tgRK3cVtMAMRV5P9h5wkFUlE/Dg bcPsfgNOIuHYC3vyYtHgKfjWfTMhCq9lduJ7ezWeyIL7RRkubEzcBVv6rulIyAIK4mrO I9iFNwYRvFrOYLTiYQj/ilP1I6Ca05TVIGJ0ShKixfVEpep8Ygoie9bjnouJ3JQWPAhO Nu4FZRXJehrUjrqvbi/g4+3HAOJd8D7jeMaGzla+iH33HAhkNPyExYhBHqzw2TF4Ol33 Xlnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tVA03VPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si20165628pgj.463.2018.09.03.19.51.12; Mon, 03 Sep 2018 19:51:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tVA03VPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbeIDHIB (ORCPT + 99 others); Tue, 4 Sep 2018 03:08:01 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42665 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeIDHIA (ORCPT ); Tue, 4 Sep 2018 03:08:00 -0400 Received: by mail-pg1-f196.google.com with SMTP id y4-v6so879287pgp.9; 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=C6tn/U/4cCeQgVgqFQKrOOz8w3qjU8PSBmFqxTTsM7okF+Da2zESv0arfgN3KsnMcf NkfRFpK3On4A3wa3X7MfecOZECnpH52ivnGjvg+4OEwST2fL0L0dFlZmwWx1dXVY9flA f5JiyGAQj8LDZaq6xGMwJ2hjhuiIurq/fvAtZKj9l+1jZ1ssmUQIrjJqRMXXRvg8r5u8 G3VCmGd8U1xxzECnZjlU01OSzRiGsyLk1msihmmODgmHy3T2TAueSPTp3nkKk6Jx6Usx Q/Vb0oENkQxc4meH1wmNjV0fLMpwDc9mSbVLMCuLYlNXXLaR+ZT4WTiEDtooUJ7UpXVo QvuQ== X-Gm-Message-State: APzg51BxjW4cfyFmk5dqNQkAG3SDtP1selJRkDjYzYr/0KgEGNiKN7yd tcYs2c0+DA8z0k+e0nxGMm8= 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 Cc: Greg Kroah-Hartman , Jiri Slaby 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.7.4