From patchwork Tue Mar 11 10:37:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 3811241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 727579F38F for ; Tue, 11 Mar 2014 10:38:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A51F3202F0 for ; Tue, 11 Mar 2014 10:38:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80606202F8 for ; Tue, 11 Mar 2014 10:38:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382AbaCKKi3 (ORCPT ); Tue, 11 Mar 2014 06:38:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:54894 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbaCKKi3 (ORCPT ); Tue, 11 Mar 2014 06:38:29 -0400 Received: from [201.74.152.26] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNK4m-0007g3-JZ; Tue, 11 Mar 2014 10:38:24 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1WNK40-0000iN-Sa; Tue, 11 Mar 2014 07:37:36 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH] drx-j: use ber_count var Date: Tue, 11 Mar 2014 07:37:35 -0300 Message-Id: <1394534255-2672-1-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.8.5.3 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, 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 drivers/media/dvb-frontends/drx39xyj/drxj.c: In function 'ctrl_get_qam_sig_quality': drivers/media/dvb-frontends/drx39xyj/drxj.c:9468:6: warning: variable 'ber_cnt' set but not used [-Wunused-but-set-variable] u32 ber_cnt = 0; /* BER count */ ^ By reading the comment, it is said that BER should be calculated as: qam_pre_rs_ber = frac_times1e6( ber_cnt, rs_bit_cnt ); Also, it makes sense to take the mantissa into account, so fix the code to do what's commented. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/drx39xyj/drxj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 0c0e9f3b108f..41d4bfe66764 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -9583,7 +9583,7 @@ ctrl_get_qam_sig_quality(struct drx_demod_instance *demod) if (m > (rs_bit_cnt >> (e + 1)) || (rs_bit_cnt >> e) == 0) qam_pre_rs_ber = 500000 * rs_bit_cnt >> e; else - qam_pre_rs_ber = m; + qam_pre_rs_ber = ber_cnt; /* post RS BER = 1000000* (11.17 * FEC_OC_SNC_FAIL_COUNT__A) / */ /* (1504.0 * FEC_OC_SNC_FAIL_PERIOD__A) */