From patchwork Thu Apr 25 18:35:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 2489631 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 87E52DF5B1 for ; Thu, 25 Apr 2013 18:36:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759385Ab3DYSgD (ORCPT ); Thu, 25 Apr 2013 14:36:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758943Ab3DYSgB (ORCPT ); Thu, 25 Apr 2013 14:36:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3PIZuRN009405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Apr 2013 14:35:56 -0400 Received: from pedra (vpn1-7-199.gru2.redhat.com [10.97.7.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3PIZrSl002106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Apr 2013 14:35:55 -0400 Received: from v4l by pedra with local (Exim 4.80.1) (envelope-from ) id 1UVR1M-00004s-9S; Thu, 25 Apr 2013 15:35:52 -0300 From: Mauro Carvalho Chehab Cc: Patrick Boettcher , Olivier Grenie , Patrick Boettcher , Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH 5/5] dib0090: Fix a warning at dib0090_set_EFUSE Date: Thu, 25 Apr 2013 15:35:49 -0300 Message-Id: <1366914949-32587-5-git-send-email-mchehab@redhat.com> In-Reply-To: <1366914949-32587-1-git-send-email-mchehab@redhat.com> References: <1366914949-32587-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 The check if the values for c, h and n are within the range is always true, as, if one of this values is out of range, the previous "if" clauses will default to a value within the range. That fixes the following warning: drivers/media/dvb-frontends/dib0090.c: In function 'dib0090_set_EFUSE': drivers/media/dvb-frontends/dib0090.c:1545:5: warning: comparison is always true due to limited range of data type [-Wtype-limits] and makes the code easier to read. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/dib0090.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c index f9916b8..3ee22ff 100644 --- a/drivers/media/dvb-frontends/dib0090.c +++ b/drivers/media/dvb-frontends/dib0090.c @@ -1540,13 +1540,9 @@ static void dib0090_set_EFUSE(struct dib0090_state *state) if ((n >= POLY_MAX) || (n <= POLY_MIN)) n = 3; - if ((c >= CAP_VALUE_MIN) && (c <= CAP_VALUE_MAX) - && (h >= HR_MIN) && (h <= HR_MAX) - && (n >= POLY_MIN) && (n <= POLY_MAX)) { - dib0090_write_reg(state, 0x13, (h << 10)); - e2 = (n << 11) | ((h >> 2)<<6) | c; - dib0090_write_reg(state, 0x2, e2); /* Load the BB_2 */ - } + dib0090_write_reg(state, 0x13, (h << 10)); + e2 = (n << 11) | ((h >> 2)<<6) | c; + dib0090_write_reg(state, 0x2, e2); /* Load the BB_2 */ } }