From patchwork Tue Sep 29 18:32:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 7289501 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1D68BEEA4 for ; Tue, 29 Sep 2015 18:32:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D950D2068E for ; Tue, 29 Sep 2015 18:32:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 19E742062F for ; Tue, 29 Sep 2015 18:32:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E4556E684; Tue, 29 Sep 2015 11:32:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pandora.arm.linux.org.uk (pandora.arm.linux.org.uk [78.32.30.218]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77B306E1AA for ; Tue, 29 Sep 2015 11:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:To:From:References:In-Reply-To; bh=nMtW9IqrzdBwkA4AZdMrnYSEeI1zF3U8DVvxfJkZWfQ=; b=VbFcisF884pFJ3is1W5tlhJ16PrRSE0XNrkqP2kPqVkVLRBFV/hQRhtpgYu1b7Oyvl1+weT0o5hbKPk5n0UEb1opJSmM0S8idz0eLdCrmFzOTKShzT+X8PhZ+pgf2eZSnGQydjQN/VpyWIk3O7MrZ97zerHe2/vN0JpeVyuBzD4=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59318 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Zgzhh-0004WA-W8 for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:32:42 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Zgzhh-00042D-5E for dri-devel@lists.freedesktop.org; Tue, 29 Sep 2015 19:32:41 +0100 In-Reply-To: <20150929183216.GQ21513@n2100.arm.linux.org.uk> References: <20150929183216.GQ21513@n2100.arm.linux.org.uk> From: Russell King To: dri-devel@lists.freedesktop.org Subject: [PATCH 01/11] drm/i2c: tda998x: remove useless NULL checks MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 29 Sep 2015 19:32:41 +0100 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no way 'priv' can be NULL in tda998x_irq_thread() - this can only happen if request_threaded_irq() was passed a NULL priv pointer, and we would have crashed long before then if that was the case. We also always ensure that priv->encoder is correctly setup, which must have been initialised prior to the interrupt being claimed, so we can remove this check as well. Signed-off-by: Russell King --- drivers/gpu/drm/i2c/tda998x_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 424228be79ae..d8e97085f866 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -558,7 +558,7 @@ static void tda998x_hpd(struct work_struct *work) struct tda998x_priv *priv = container_of(dwork, struct tda998x_priv, dwork); - if (priv->encoder && priv->encoder->dev) + if (priv->encoder->dev) drm_kms_helper_hotplug_event(priv->encoder->dev); } @@ -570,8 +570,6 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data) struct tda998x_priv *priv = data; u8 sta, cec, lvl, flag0, flag1, flag2; - if (!priv) - return IRQ_HANDLED; sta = cec_read(priv, REG_CEC_INTSTATUS); cec = cec_read(priv, REG_CEC_RXSHPDINT); lvl = cec_read(priv, REG_CEC_RXSHPDLEV);