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: 105665 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp888252qgd; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) X-Received: by 10.98.157.74 with SMTP id i71mr6143384pfd.141.1497544403728; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544403; cv=none; d=google.com; s=arc-20160816; b=zLozjwVPIZXH16rYUKWJPLCFJlyStuRa04MsFL1Ab0ZUrZhRiTiez72UJ0DyNSejIK GzfbKKwxwMUZ5ZigXy+MPGIr3X2FZj1ARbKAU5HVko7HLuie3M1OJKPtLmI9MCpSbp6Z X773tAg9xUvlfHFnRRUwsbFqSJCj9Hov1uCyg4CoawaWHNDD+lp1acEQdrn8t6W5XyZh FMO4XUMUEh1ORSl61RH+gJx5qalyHjCp5xWReQGzob2GVX3yLOxne8Bbm8uQKn0xl635 JaLfK9p5X5Gc3BHwNUoWsgaRCYA6lswNdd4aAKXHaJmMJcsITuk5VYfej/kAKTcwf1js HkdQ== 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=RA20xSdHDcinDahJt53rwwZa03+dDzxTP5bl8gmGb7M=; b=ytZJgqP/Ye+PlRq0NDjCJxiWBNLgADHClDVpUK6N6R5bLjnMUSQWz3E10roRlItVfg goBhZ2gfsl92CJT4ghwfbRpXlbZPLZmhQWy4Ivg2EHb82uTSbvwmYpP4onl36MssSX/i LGNiTcX1pvEuz7468fRD+Nvuhe25MPMVADStjRwmhpa650OCNtW1DN6sv3NCUQK/Qj5H 6icUf4oqwvEGUw4qLWXoVfk/sP+1LRzMAwiIJm5KWr0jfCnnaKxc/mGk4yYt33ghfYGf f3er0DrUoTQI+w2NnExJRbYUTE7NrrF9wrxp5xCnowbzd+Pzi16Sh+qNNRVcf0Vm/jef JQAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=ewNZN80F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 p5si397449pfl.413.2017.06.15.09.33.23; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=ewNZN80F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbdFOQdT (ORCPT + 10 others); Thu, 15 Jun 2017 12:33:19 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:35099 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbdFOQdQ (ORCPT ); Thu, 15 Jun 2017 12:33:16 -0400 Received: by mail-wr0-f177.google.com with SMTP id q97so25309123wrb.2 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=AB5SCjV3WC2G0AToYanXfddf/4B6r5eBDLKS2oOqX3CSzYFwVXUxcId6CAovenYPuO N8AYMhibJ+M0adhqmoUtkikE98zKtMxEhfH9+9os+DNML96ZyBwTJ7AsZrBL5ztBgMu5 AH2X9UQYLocPZJvDkHdx56Gj9QjTuEijWT5Wv4VRx9vLS7d6iPlUe/RO8ofSKFNByQcK PvhkWfzrFC8opCcTMd+/lwHSHWx9EWyKk1wIfZJXtUYnNGEkUHPMoC22YVi6YvBz9LeJ yt01IWahCq1p10BbOwSbmTJmqb9E6GrozYMj7STm/dPmEmWzQJio4hSiIGQUfdxFg0Hu WRcg== X-Gm-Message-State: AKS2vOzXXHgRC4wLGBTy8uxMDpdLlpD+v5T2jp7MkqDNHIwMG6jh6oup RSZ6kLLN8ENh6rZN 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }