Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp461236pxb; Thu, 14 Jan 2021 10:00:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoVgpyJgTugce6q+LfNX0p8LBwl0OnJdhMn0hJMuvZZ05NC7O5r6cYzeC0QHrib88vUvST X-Received: by 2002:a05:6402:190a:: with SMTP id e10mr6757168edz.110.1610647223829; Thu, 14 Jan 2021 10:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610647223; cv=none; d=google.com; s=arc-20160816; b=0RmUn5NjhSMz9jt19bL7wOwM+KiYyIpE9oJrMIVSATfrRYxij4j1/2keIurT+DQ7Ui 5xKRz9h7p3JjyBdXCxuE9ciQus97CGdu0AG/7IkZetoryUhkYFfIy8j8r8c0jK4xIJUp a2FTQuVswgPbefnPLSkkPEShIDn623/kUdPGWFLLRhmaYViei0erDD6SDl9mzCoD8sos u4VCPBSw6XkdvWbNWBor/41s5+/4B12iWCU1H8QUYSVG+JI4/x0rBqyHJLIB6hNSs0Yw 7wvYg8vOTMJ4ArUY7jPrFTs2xGC5uSYOwjkHG1LyBuPNeeHTjq4RtBtWgnu0noU6zc+0 HaqA== 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; bh=dMYEgB5dZeHUDV6DaBjS4kxCWZNxOz646AvrvV0m4UI=; b=tfLPghnc4a6Krc4RjUkQ1ai4bHi0BuuPv1c4zMxrvojfWP5D2IGSZHKMs5oeup7Pgp 4Mmbm4o5v8Nr7Ud64FtQ5fxshzMMEe48H7QZjTY+4+PxSagVp29prqpjEE/0/7qeU2Hl W3b1DZJX8fodXsMGRzevJFFW4rNFnoTZkbuymR6JlYCxgWqAb7qLvkJQNyrB3fLZntKB Emf8j51nAa5meWaxQhGPRiGlPtCsUvIQfLl50Ce+3WkWeeOnb0LlGux1a/0UeCHL2Q8K rb0WaPItOd9xmljDBmHW4NNYh2a61NO6oGHs+oaem+PEiuNZaLfd0M8yiZDMBEObrfiV NB2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si2715959ejw.42.2021.01.14.09.59.59; Thu, 14 Jan 2021 10:00:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbhANR6v (ORCPT + 99 others); Thu, 14 Jan 2021 12:58:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728903AbhANR6t (ORCPT ); Thu, 14 Jan 2021 12:58:49 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9966C061799 for ; Thu, 14 Jan 2021 09:57:38 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l06sF-0004R9-HE; Thu, 14 Jan 2021 18:57:31 +0100 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1l06sC-0002l4-7n; Thu, 14 Jan 2021 18:57:28 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: "David S . Miller" , linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] tty: hvcs: Drop unnecessary if block Date: Thu, 14 Jan 2021 18:57:16 +0100 Message-Id: <20210114175718.137483-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114175718.137483-1-u.kleine-koenig@pengutronix.de> References: <20210114175718.137483-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If hvcs_probe() succeeded dev_set_drvdata() is called with a non-NULL value, and if hvcs_probe() failed hvcs_remove() isn't called. So there is no way dev_get_drvdata() can return NULL in hvcs_remove() and the check can just go away. Signed-off-by: Uwe Kleine-König --- drivers/tty/hvc/hvcs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 509d1042825a..3e0461285c34 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -825,9 +825,6 @@ static int hvcs_remove(struct vio_dev *dev) unsigned long flags; struct tty_struct *tty; - if (!hvcsd) - return -ENODEV; - /* By this time the vty-server won't be getting any more interrupts */ spin_lock_irqsave(&hvcsd->lock, flags); -- 2.29.2