From patchwork Thu Mar 13 10:29:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 3824741 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B371CBF540 for ; Thu, 13 Mar 2014 10:30:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4EC1201FB for ; Thu, 13 Mar 2014 10:30:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14DAB201E9 for ; Thu, 13 Mar 2014 10:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753833AbaCMKaL (ORCPT ); Thu, 13 Mar 2014 06:30:11 -0400 Received: from mailapp01.imgtec.com ([195.89.28.114]:42705 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753381AbaCMK3y (ORCPT ); Thu, 13 Mar 2014 06:29:54 -0400 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 2382A5F3B696A; Thu, 13 Mar 2014 10:29:51 +0000 (GMT) Received: from KLMAIL02.kl.imgtec.org (192.168.5.97) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 13 Mar 2014 10:29:53 +0000 Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by klmail02.kl.imgtec.org (192.168.5.97) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 13 Mar 2014 10:29:52 +0000 Received: from jhogan-linux.le.imgtec.org (192.168.154.65) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 13 Mar 2014 10:29:52 +0000 From: James Hogan To: Mauro Carvalho Chehab CC: , James Hogan Subject: [PATCH 2/3] rc: img-ir: hw: Fix min/max bits setup Date: Thu, 13 Mar 2014 10:29:22 +0000 Message-ID: <1394706563-31081-3-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1394706563-31081-1-git-send-email-james.hogan@imgtec.com> References: <1394706563-31081-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.154.65] 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, 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 The calculated values for the minlen and maxlen fields, which were rounded to multiples of 2 and clamped to a valid range, were left unused. Use them in the calculation of the register value rather than using the raw input minlen and maxlen. This fixes the following warning with a W=1 build: drivers/media/rc/img-ir/img-ir-hw.c In function ‘img_ir_free_timing’: drivers/media/rc/img-ir/img-ir-hw.c +228 :23: warning: variable ‘maxlen’ set but not used [-Wunused-but-set-variable] drivers/media/rc/img-ir/img-ir-hw.c +228 :15: warning: variable ‘minlen’ set but not used [-Wunused-but-set-variable] Reported-by: Mauro Carvalho Chehab Signed-off-by: James Hogan Cc: Mauro Carvalho Chehab --- I don't object to this patch being squashed into the patch "rc: img-ir: add hardware decoder driver". --- drivers/media/rc/img-ir/img-ir-hw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c index 2abf78a89fc5..579a52b3edce 100644 --- a/drivers/media/rc/img-ir/img-ir-hw.c +++ b/drivers/media/rc/img-ir/img-ir-hw.c @@ -240,9 +240,9 @@ static u32 img_ir_free_timing(const struct img_ir_free_timing *timing, ft_min = (timing->ft_min*clock_hz + 999999) / 1000000; ft_min = (ft_min + 7) >> 3; /* construct register value */ - return (timing->maxlen << IMG_IR_MAXLEN_SHIFT) | - (timing->minlen << IMG_IR_MINLEN_SHIFT) | - (ft_min << IMG_IR_FT_MIN_SHIFT); + return (maxlen << IMG_IR_MAXLEN_SHIFT) | + (minlen << IMG_IR_MINLEN_SHIFT) | + (ft_min << IMG_IR_FT_MIN_SHIFT); } /**