From patchwork Sun Jan 18 01:37:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 5652731 Return-Path: X-Original-To: patchwork-linux-fbdev@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 6B188C058D for ; Sun, 18 Jan 2015 01:45:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DCC62037E for ; Sun, 18 Jan 2015 01:45:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9F6B2037C for ; Sun, 18 Jan 2015 01:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751249AbbARBpD (ORCPT ); Sat, 17 Jan 2015 20:45:03 -0500 Received: from www.osadl.org ([62.245.132.105]:33488 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbbARBpB (ORCPT ); Sat, 17 Jan 2015 20:45:01 -0500 Received: from debian.hofr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t0I1ifsE029222; Sun, 18 Jan 2015 02:44:41 +0100 From: Nicholas Mc Guire To: Geert Uytterhoeven Cc: Jingoo Han , Denis Carikli , Daniel Vetter , Sascha Hauer , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] video: mx3fb: fix up wait_for_completion_timeout return handling Date: Sun, 18 Jan 2015 02:37:02 +0100 Message-Id: <1421545022-24017-1-git-send-email-der.herr@hofr.at> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nicholas Mc Guire --- return type of wait_for_completion_timeout is unsigned long as ret is used only for checking wait_for_completion_timeout here the type was changed to unsigned long, wait_for_completion_timeout return >= 0 only so the checks for negative return canbe dropped. This patch was only compiletested using imx_v4_v5_defconfig Patch is against 3.19.0-rc4 -next-20150116 drivers/video/fbdev/mx3fb.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index 7947634..523134f 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1144,7 +1144,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, struct scatterlist *sg = mx3_fbi->sg; struct dma_chan *dma_chan = &mx3_fbi->idmac_channel->dma_chan; struct dma_async_tx_descriptor *txd; - int ret; + unsigned long ret; dev_dbg(fbi->device, "%s [%c]\n", __func__, list_empty(&mx3_fbi->idmac_channel->queue) ? '-' : '+'); @@ -1184,12 +1184,11 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, enable_irq(mx3_fbi->idmac_channel->eof_irq); ret = wait_for_completion_timeout(&mx3_fbi->flip_cmpl, HZ / 10); - if (ret <= 0) { + if (ret == 0) { mutex_unlock(&mx3_fbi->mutex); - dev_info(fbi->device, "Panning failed due to %s\n", ret < 0 ? - "user interrupt" : "timeout"); + dev_info(fbi->device, "Panning failed due to timeout\n"); disable_irq(mx3_fbi->idmac_channel->eof_irq); - return ret ? : -ETIMEDOUT; + return -ETIMEDOUT; } mx3_fbi->cur_ipu_buf = !mx3_fbi->cur_ipu_buf;