From patchwork Mon Jun 12 16:27:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9782071 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 4C6C560352 for ; Mon, 12 Jun 2017 16:30:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 407C827FAE for ; Mon, 12 Jun 2017 16:30:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3291328178; Mon, 12 Jun 2017 16:30:09 +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 372F827FAE for ; Mon, 12 Jun 2017 16:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbdFLQaC (ORCPT ); Mon, 12 Jun 2017 12:30:02 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:36846 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754712AbdFLQ36 (ORCPT ); Mon, 12 Jun 2017 12:29:58 -0400 Received: by mail-wr0-f171.google.com with SMTP id v111so103599806wrc.3 for ; Mon, 12 Jun 2017 09:29:57 -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=KksQhm0sZqd/8Vegs8e/OrhQ0StweXyvQBG1wGy9DjYIZ+4xwm6UIxwprm1EQVxtmd gU8TzFFXSOfhDxUDlb7cEO6lGYYRNt9uqCju2T9etrCcnJAgT2bGVxnDGKCEd72l01So Ibg3m0YawYQOPqvd+FDh7QERe9ZQXwdT908Gg= 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=J39Enzn4VWwDbRZ/lto5uS2SeCPQgeTXr+8bDpdcZsMocJa6/5qyIiP6xcPLW0/+Gm glIxKU0zlmthiangoN47xCKslm47gAyhP3yCB1Boy1TzL4L/mwrJHaPHhUem3gr9+DiP HkdoPTPuEXzoX0tYRJXC1mYoO2b3Q+FKwD7P52cMaETRBULYJCEiZfwSgmW0rVcnFvuT Y1Zrk1pnrdSnTVwrNCPd6zENfQwlidkjMnJKyzZLqg/DhItJ6ZPtdP1eelm0f19DBldj JM9iMMyoUL0sT+pKoDz2ZcZJNHapAW9DQfRGe2zj2AuwBpJLPAA0omKBxMRIdJcnGc12 LVZA== X-Gm-Message-State: AKS2vOwB1e3tup64Abror2Vdw/iXFSwK6sB9lHDBRPSROrrY3Lfiuq0A 2nxlI3Ev35J/LXdK52AW0g== X-Received: by 10.28.147.202 with SMTP id v193mr4941116wmd.37.1497284991721; Mon, 12 Jun 2017 09:29:51 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 49sm14493531wrz.8.2017.06.12.09.29.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 09:29:51 -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 v10 12/18] media: venus: helpers: fix variable dereferenced before check Date: Mon, 12 Jun 2017 19:27:49 +0300 Message-Id: <1497284875-19999-13-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497284875-19999-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497284875-19999-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; }