From patchwork Thu Jun 15 16:31:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9789143 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 23AAD60384 for ; Thu, 15 Jun 2017 16:33:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 153F1286BE for ; Thu, 15 Jun 2017 16:33:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09DD7286BD; Thu, 15 Jun 2017 16:33:28 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 A2670286BD for ; Thu, 15 Jun 2017 16:33:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdFOQdY (ORCPT ); Thu, 15 Jun 2017 12:33:24 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:34104 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbdFOQdW (ORCPT ); Thu, 15 Jun 2017 12:33:22 -0400 Received: by mail-wr0-f169.google.com with SMTP id 77so25378075wrb.1 for ; Thu, 15 Jun 2017 09:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UPX0lJQd+UhYy0Nc7V1te/sZx0Dwpc1CEu79iFUN2oU=; b=ewNZN80FYcvfIKJ/49+jbVvBhd5wJoWeXRJd/PDGcOFlM+OrxCytJ/GpYhp/Du8JBW 7RYl+0NmglW0OLUzRwtO34sPMNmR7B7wrFBzbN0tP7K167MNj4TEg2Krvx+7AfcAJZhm NREo//JSu1jC4AiLUnX+UHR36rpzkJVQtyklA= 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=UPX0lJQd+UhYy0Nc7V1te/sZx0Dwpc1CEu79iFUN2oU=; b=UF93tGE+0wIvaMlmTt1YrDc0XQJRBI5IJl6+rrnIxC7XlpGlLGjcAHOepHPEgjvAHe fcIe/FT7WzrzRWCjtZyuiREK44YSK7FYB/XlyJ94QqaS17ua/El/JZS76sBQ8t3B94a0 6Po2FHtyMePc/NrsojsirJW2xtRg0MsO5blBbIbb0tgVZ6LF8IiQqy/e2wvyijQJkhv9 Ro0ayUdl3dPhq4K5l4Sb57NNgAgMWjOtXwhLS4KYaHwjV7zB0yLvpjrxuV/Ju0rCv44Y msxGvP115slpa0h4KcuiAI3eGLJ3hAgZo5lpac389Z3vvsMq4/y/AEbKa9W3cDsLpunV o80g== X-Gm-Message-State: AKS2vOxW7JlC3Vc/BXiyHKRzdS4pi8AxdzbszLEo3cTjsF+c0MvAPCSo Lw5o/pm7uOklO4cOWw026w== X-Received: by 10.223.166.248 with SMTP id t111mr4726667wrc.39.1497544390460; Thu, 15 Jun 2017 09:33:10 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:10 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 12/19] media: venus: helpers: fix variable dereferenced before check Date: Thu, 15 Jun 2017 19:31:53 +0300 Message-Id: <1497544320-2269-13-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> 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 This fixes a warning found when building the driver with gcc7: drivers/media/platform/qcom/venus/helpers.c:157 load_per_instance() warn: variable dereferenced before check 'inst' (see line 153) Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index f777ef80b941..5f4434c0a8f1 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -150,14 +150,12 @@ static int intbufs_free(struct venus_inst *inst) static u32 load_per_instance(struct venus_inst *inst) { - u32 w = inst->width; - u32 h = inst->height; u32 mbs; if (!inst || !(inst->state >= INST_INIT && inst->state < INST_STOP)) return 0; - mbs = (ALIGN(w, 16) / 16) * (ALIGN(h, 16) / 16); + mbs = (ALIGN(inst->width, 16) / 16) * (ALIGN(inst->height, 16) / 16); return mbs * inst->fps; }