From patchwork Tue Feb 23 10:10:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 8390121 Return-Path: X-Original-To: patchwork-linux-media@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 C72ECC0553 for ; Tue, 23 Feb 2016 10:11:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0710220382 for ; Tue, 23 Feb 2016 10:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09E3C2037E for ; Tue, 23 Feb 2016 10:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752131AbcBWKLN (ORCPT ); Tue, 23 Feb 2016 05:11:13 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:40756 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbcBWKLM (ORCPT ); Tue, 23 Feb 2016 05:11:12 -0500 Received: from [179.182.161.166] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1aY9vz-0003nP-HB; Tue, 23 Feb 2016 10:11:11 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86) (envelope-from ) id 1aY9vs-0007S6-Am; Tue, 23 Feb 2016 07:11:04 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Andy Walls Subject: [PATCH v2] ivtv-mailbox: avoid confusing smatch Date: Tue, 23 Feb 2016 07:10:59 -0300 Message-Id: X-Mailer: git-send-email 2.5.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The current logic causes smatch to be confused: include/linux/jiffies.h:359:41: error: strange non-value function or array include/linux/jiffies.h:361:42: error: strange non-value function or array include/linux/jiffies.h:359:41: error: strange non-value function or array include/linux/jiffies.h:361:42: error: strange non-value function or array Use a different logic. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/ivtv/ivtv-mailbox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtv-mailbox.c b/drivers/media/pci/ivtv/ivtv-mailbox.c index e3ce96763785..1d3586109b84 100644 --- a/drivers/media/pci/ivtv/ivtv-mailbox.c +++ b/drivers/media/pci/ivtv/ivtv-mailbox.c @@ -177,8 +177,10 @@ static int get_mailbox(struct ivtv *itv, struct ivtv_mailbox_data *mbdata, int f /* Sleep before a retry, if not atomic */ if (!(flags & API_NO_WAIT_MB)) { - if (time_after(jiffies, - then + msecs_to_jiffies(10*retries))) + unsigned long timeout; + + timeout = msecs_to_jiffies(10 * retries); + if (time_after(jiffies, then + timeout)) break; ivtv_msleep_timeout(10, 0); }