From patchwork Sun Jul 15 17:56:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Frieder Vogt X-Patchwork-Id: 13359 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SqT3x-0008BC-Qi for patchwork@linuxtv.org; Sun, 15 Jul 2012 19:56:57 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp for id 1SqT3x-0005RT-Gg; Sun, 15 Jul 2012 19:56:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102Ab2GOR4y (ORCPT ); Sun, 15 Jul 2012 13:56:54 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:48148 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751750Ab2GOR4y (ORCPT ); Sun, 15 Jul 2012 13:56:54 -0400 Received: (qmail invoked by alias); 15 Jul 2012 17:56:52 -0000 Received: from p4FC08090.dip0.t-ipconnect.de (EHLO maximilian.localnet) [79.192.128.144] by mail.gmx.net (mp031) with SMTP; 15 Jul 2012 19:56:52 +0200 X-Authenticated: #24390674 X-Provags-ID: V01U2FsdGVkX18zFXRfk7IzlQm7Aa02Rre3+JtdhRYb3LNoXeDDJB QmAxGJ3kR7MdwC From: "Hans-Frieder Vogt" To: linux-media@vger.kernel.org, thomas.mair86@gmail.com Subject: [PATCH] rtl2832.c: minor cleanup Date: Sun, 15 Jul 2012 19:56:47 +0200 User-Agent: KMail/1.13.7 (Linux/3.5.0-rc7-a64; KDE/4.8.4; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201207151956.47423.hfvogt@gmx.net> X-Y-GMX-Trusted: 0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.7.15.174516 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1100_1199 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' The current formulation of the bw_params loop uses the counter j as an index for the first dimension of the bw_params array which is later incremented by the variable i. It is evaluated correctly only, because j is initialized to 0 at the beginning of the loop. I think that explicitly using the index 0 better reflects the intent of the expression. Signed-off-by: Hans-Frieder Vogt rtl2832.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Hans-Frieder Vogt e-mail: hfvogt gmx .dot. net --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/dvb/frontends/rtl2832.c 2012-07-06 05:45:16.000000000 +0200 +++ b/drivers/media/dvb/frontends/rtl2832.c 2012-07-15 19:05:28.428017449 +0200 @@ -589,7 +589,7 @@ static int rtl2832_set_frontend(struct d return -EINVAL; } - for (j = 0; j < sizeof(bw_params[j]); j++) { + for (j = 0; j < sizeof(bw_params[0]); j++) { ret = rtl2832_wr_regs(priv, 0x1c+j, 1, &bw_params[i][j], 1); if (ret) goto err;