From patchwork Sat Jun 7 00:31:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4313911 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 357A69F26E for ; Sat, 7 Jun 2014 00:31:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34A532020F for ; Sat, 7 Jun 2014 00:31:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 543A020107 for ; Sat, 7 Jun 2014 00:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277AbaFGAag (ORCPT ); Fri, 6 Jun 2014 20:30:36 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:58598 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbaFGAag (ORCPT ); Fri, 6 Jun 2014 20:30:36 -0400 Received: by mail-lb0-f176.google.com with SMTP id p9so1890320lbv.7 for ; Fri, 06 Jun 2014 17:30:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7Ky8G6AOsujZ+Ef3vcD638H3ly+tqm+Ac2aJP5HM2Fg=; b=fzl+7DHVfyTR5kOrtnGBUY5q3RD4CclcrHEWCoU+Ohc2Y/ZKuSbgZagenQ6BwJCcX0 1R/IodkTZFdQZMdaxo+Ic7lw5vuYm8MUv9sG5aeuQgd8Q2bvPPV8mKy55Tux5pXG2DIH 55sfWcPvdYGpjxA5wRl1TDtHV9E95V1oEClG2mlB57+CyshhqSmQMw+PaaTl8WVjgjr9 YzApAGuKqPskaMGluA97AtzsFtX2FcBlwnwIFnp/fo7SjTMcDHLWOnEtEreyT97SYE4M 7wb6cZXjn3RQYUKsluYU4IG7K1btp1sACwj/Y4W+XSwYB9JX1k8vC6NWf+DtBJE7xhfW LP6A== X-Gm-Message-State: ALoCoQlJWsaM+xS+YbL8IJffmoEVOGnfl5qAfEaFKBANQbqJKecAfsDwkyytvicj/dprv367El9j X-Received: by 10.152.36.38 with SMTP id n6mr6265880laj.0.1402101033828; Fri, 06 Jun 2014 17:30:33 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id sq7sm10371428lbb.10.2014.06.06.17.30.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 17:30:32 -0700 (PDT) From: Rickard Strandqvist To: Mauro Carvalho Chehab , Hans Verkuil Cc: Rickard Strandqvist , "Lad, Prabhakar" , Martin Bugge , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: v4l2-core: v4l2-dv-timings.c: Cleaning up code that putting values to the same variable twice Date: Sat, 7 Jun 2014 02:31:28 +0200 Message-Id: <1402101088-14731-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Instead of putting the same variable twice, was rather intended to set this value to two different variable. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist Acked-by: Lad, Prabhakar --- drivers/media/v4l2-core/v4l2-dv-timings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index 48b20df..eb3850c 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c @@ -599,10 +599,10 @@ struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait) aspect.denominator = 9; } else if (ratio == 34) { aspect.numerator = 4; - aspect.numerator = 3; + aspect.denominator = 3; } else if (ratio == 68) { aspect.numerator = 15; - aspect.numerator = 9; + aspect.denominator = 9; } else { aspect.numerator = hor_landscape + 99; aspect.denominator = 100;