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: 103653 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp76768obh; Mon, 12 Jun 2017 09:30:20 -0700 (PDT) X-Received: by 10.99.6.65 with SMTP id 62mr57069277pgg.157.1497285019987; Mon, 12 Jun 2017 09:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497285019; cv=none; d=google.com; s=arc-20160816; b=dpMiTYsotqR/VGDB4G/knyZlySBiJt92V6Mox16ldaaJb+2x7Fviu1NThtb+RRmGc9 6IsUx9tfTHqmnRVsmhM2jEvItVw0t/2Ss9ZYnOOCvfeWu0rbjZDiXCSMG+NblIfxId5Y 1NBT59efVWTA4MrOJHTgbPPV3VyQLNchyACL5O7y7mcdxwLpsCvv0O73CleYe2QkmEp0 FlMyUrHuSbjY4vLjBtBi3AjMMjyOM0lYB/xAs10OF9cwjJ1k5GQS8VBPG2b4GlPVG80A SM39UUhMWvvRYA5QFWxvTVviKWHfrFnB23pYlFhz2EIPPeeFrt0Ba36WlGY4RHSdQ7Y0 8u1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=UPX0lJQd+UhYy0Nc7V1te/sZx0Dwpc1CEu79iFUN2oU=; b=VyRHU0cSxfGbCu1pHKO5RitI6a+OKEqMlAdrdO0LvEgMVbBcV2otNz5JLBnR7RYlSL 3xqQYC/x0KBJyocObJ77lPyO00BaF3qWHrIsY9/OMzNhHqaEP40XrKQEpEiFB5M0fI33 1nGsPHXUfGgjeauKQ4wHmqZ2HgyU89hY+gg/tzgviVqmxySCUCVSuXTgiIvPNUcpk9R1 pkwDRZ2Kv7OgwjooZ4xc2aCjXibtWCr6NW85Hy1i4SJZ0A0E72ovvLmLkyyxlIV6/gJ7 AgKebJq0jI+rrOdigvH1wQAZvBtp2zU+5/OIEZwn27k5xYy92vAl+p1HJMAhl/BNHJYH JnVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32si5132695plj.195.2017.06.12.09.30.19; Mon, 12 Jun 2017 09:30:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbdFLQaC (ORCPT + 4 others); 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 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(-) -- 2.7.4 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; }