Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964826AbbFJNHG (ORCPT ); Wed, 10 Jun 2015 09:07:06 -0400 Received: from www.osadl.org ([62.245.132.105]:35260 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754155AbbFJNHA (ORCPT ); Wed, 10 Jun 2015 09:07:00 -0400 From: Nicholas Mc Guire To: Russell King Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH RFC] drm/i2c: tda998x: dead-code or unhandled error condition ? Date: Wed, 10 Jun 2015 14:58:48 +0200 Message-Id: <1433941128-19798-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1800 Lines: 48 event API conformance testing with coccinelle spatches are being used to locate API usage inconsistencies this triggert with: ./drivers/gpu/drm/i2c/tda998x_drv.c:1062 incorrect check for negative return The return of wait_event_timeout is always >= 0, thus the negative check was effectively being ignoring - as the timeout will be checked a few lines below the error condition being checked here seems to be wrong or this is simply dead code which would be my guess as the timeout condition check covers the wait-queue related failure condition. Signed-off-by: Nicholas Mc Guire --- Can't really determine what the right fix for this would be - someone that knows this driver would need to check - in any case the current code seems broken. Patch was compile tested with x86_64_defconfig + CONFIG_DRM_I2C_SIL164=m Patch is against 4.1-rc7 (localversion-next is -next-20150610) drivers/gpu/drm/i2c/tda998x_drv.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index fe1599d..d489a6e 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1065,10 +1065,6 @@ static int read_edid_block(void *data, u8 *buf, unsigned int blk, size_t length) i = wait_event_timeout(priv->wq_edid, !priv->wq_edid_wait, msecs_to_jiffies(100)); - if (i < 0) { - dev_err(&priv->hdmi->dev, "read edid wait err %d\n", i); - return i; - } } else { for (i = 100; i > 0; i--) { msleep(1); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/