From patchwork Sat Jun 23 15:35:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10483737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 871E36023A for ; Sat, 23 Jun 2018 15:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89C8D288D1 for ; Sat, 23 Jun 2018 15:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE2B289D1; Sat, 23 Jun 2018 15:36:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F556288D1 for ; Sat, 23 Jun 2018 15:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751585AbeFWPgX (ORCPT ); Sat, 23 Jun 2018 11:36:23 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52891 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbeFWPgV (ORCPT ); Sat, 23 Jun 2018 11:36:21 -0400 Received: by mail-wm0-f68.google.com with SMTP id p126-v6so4934841wmb.2 for ; Sat, 23 Jun 2018 08:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZggC62ZZdkvdQg1XKDCV/q4h800L6w39ZdIsGN9BUPQ=; b=h85d0hcYxxMlijdes2W1CHtu9j64C7tvigPLCRAnQcJVWO7v8nL3dTzFvSsol4hWIo cuR8gLDAEHvKNErtFxZcZJp+qBOph7DT0dlfphY8nOJcX8iSbE8fpbgoeKMxLztwc91k 0Bor0b1BIOG72zg5nHhGFnEB8t0LsZc0SGLFW7xVyfzmFO8eBBVC/NpsssEW6WDDa3AM b6wy1yDvTbSQSbFRWuAoJrXLzvE6eFI3bB0PvXpwfcxDtj2Y/dBRqEV3rhGmT/31A4hY ovRfSBDNppIAuego30+QDXoSrSHU/+sGlCsL4tKUXVeVJzYtC5tUh9MxxnYeH6Ng54lT 8quQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZggC62ZZdkvdQg1XKDCV/q4h800L6w39ZdIsGN9BUPQ=; b=byFxdKqnL24w8Ol7uQFaB4Bsn2ujq9EE8WQvZ3O+SeVmPg57OkmBlDoBa0S1/dh6Y8 CXdON/JpDaIUOMDFGfQkQn6k4+AHikpUVt7SR58SHlHkS1L3oLfmh9gpZblHkQj2XCDu hpGZbHrU+qA4Sky7PyLJaMNGkrJZ45rIiG7NYdUSOi/TX/N+9s1gGO5JAo1YNCy6/PrO 24fK6Fui0KiD4n2aHt7gclBznoWFtx0GilO+O+Y1hhqOIfRf4+Qf51JqZrYuxll9c0MB Yz+SMPx9EZrVFmiiNJfytZe1xoHJphMbh30mAv6poysunsWuQr60KEJfXubR3uH14oBT CQ3Q== X-Gm-Message-State: APt69E1mqJcQQFzPauOtzD0oD69oxd3RBZx4Cq0WFzwaMao2b7Y8Icam oobEbhuOOIv//VcPULZjxDM= X-Google-Smtp-Source: AAOMgpdVNtN7rI9u5RtAy1m3sWyrJOghSZDLQcoHcwEAim7XyzrXBdJk5lTGyyJoTOApsadIFiPk1w== X-Received: by 2002:a1c:d905:: with SMTP id q5-v6mr5014323wmg.78.1529768180513; Sat, 23 Jun 2018 08:36:20 -0700 (PDT) Received: from dvbdev.wuest.de (ip-176-199-71-134.hsi06.unitymediagroup.de. [176.199.71.134]) by smtp.gmail.com with ESMTPSA id o15-v6sm3443156wrm.38.2018.06.23.08.36.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 08:36:19 -0700 (PDT) From: Daniel Scheller To: mchehab@kernel.org, mchehab@s-opensource.com Cc: linux-media@vger.kernel.org Subject: [PATCH 02/19] [media] dvb-frontends/stv0910: cast the BER denominator shift exp to ULL Date: Sat, 23 Jun 2018 17:35:58 +0200 Message-Id: <20180623153615.27630-3-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180623153615.27630-1-d.scheller.oss@gmail.com> References: <20180623153615.27630-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller To avoid miscalculations related to the BER denominator, the shift expression needs to be casted as ULL. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller --- drivers/media/dvb-frontends/stv0910.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 41444fa1c0bb..91b21eb59531 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -682,8 +682,8 @@ static int get_bit_error_rate_s(struct stv *state, u32 *bernumerator, return -EINVAL; if ((regs[0] & 0x80) == 0) { - state->last_berdenominator = 1 << ((state->berscale * 2) + - 10 + 3); + state->last_berdenominator = 1ULL << ((state->berscale * 2) + + 10 + 3); state->last_bernumerator = ((u32)(regs[0] & 0x7F) << 16) | ((u32)regs[1] << 8) | regs[2]; if (state->last_bernumerator < 256 && state->berscale < 6) {