Received: by 10.213.65.68 with SMTP id h4csp1380224imn; Mon, 26 Mar 2018 06:31:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELsRlBGdCUIlY0S9GYQ2Pt7v0ogrOxYGvqt6vso83kVfWdnJhLC2sIzP+DynJ6S6/ECMQctU X-Received: by 10.98.245.7 with SMTP id n7mr16002622pfh.164.1522071082944; Mon, 26 Mar 2018 06:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522071082; cv=none; d=google.com; s=arc-20160816; b=HGNyIvG3JdpvBOKFnZez4GU297wWosQHdJ+nz3/fmDIbSqw6BgXmXbczdyEenbF59b o72t0Be+UDZiplWuyoruXlqR5/dxoR210pbZGyniNh/tBbYE4kgPROV+MGuTq8NPFqrG AkDaBXPWLznBakv5pxNzbeYUbOZ2fX7ZE6bMCCp1eilnixQFKlOnoI/jHRHOTBcSNw8J hxAeGDhavJnNSC75OyxXHSwafVCtLTYuNDDwFbtL4u5r76ZwLQy1sc0rf2ulsbxNuTN3 AG33inafsarUkcOYJpMdonmsQAAb6YT8wzC0dh1b/cGWZcqAHrlQlEK6iW9191FM6USu 9Cvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aOn5BhMK6bIpx9a0k3X06W1jBS0p2Z9m39dwR0RZYXs=; b=jpRR3KTJOltN1VzxRXodEzx9XpP2pHFjkPgKtXDUBlQauRCBAMDQY57PlBfXCMGPKn D8x7nPuOXmW+z8QVht5tcmJTty7mRUK22kb5L4J2OSjOxp+3UOALmnVxoL4dWA1xNCXF PWZfAIiE6/FXiRr3HTOyiSPiTPH1MDWT2hQbTRP8MWpUCldn9duNp7P1qwUcPIJ3AReD 056DhwVRTlTtYgjeYJAcRilYuKdHaDqTVuEwsm1xdhscBHq5tqHIZ4xolhOxuAEy01Bw AQUr4tqq4O9kgCNrcQHL6EnLH/8uiIomnXg09taQU/DgQB9oz0bQieJiEyHge9ICv4hB f8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=oN45CT+Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si10009129pgt.198.2018.03.26.06.31.02; Mon, 26 Mar 2018 06:31:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=oN45CT+Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbeCZN3b (ORCPT + 99 others); Mon, 26 Mar 2018 09:29:31 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:43032 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751824AbeCZN33 (ORCPT ); Mon, 26 Mar 2018 09:29:29 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id DB89120226; Mon, 26 Mar 2018 15:27:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1522070823; bh=Ucch4uGu5ET8NPx9eDNHC2z5Us6PWwVkQJL4wHnRb/w=; h=From:To:Cc:Subject:Date:From; b=oN45CT+QsZDPKef9wCyoT4BOvWEU6ZMQPxZNba+PXwSegLx9gWAyBbBfMfk6eX+2V X590gElZGu9CAxVGz+jXZhdpmFlDUuSjP97g07oYp9uVduW/3U5C6nElFHi32J3imG 1Ls67fIXEDw92SmtdkqG9TezKM8vhADPtlDI9Dcc= From: Kieran Bingham To: Laurent Pinchart , mchehab@kernel.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Kieran Bingham , Kieran Bingham , stable@vger.kernel.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH] media: vsp1: Fix BRx conditional path in WPF Date: Mon, 26 Mar 2018 14:29:17 +0100 Message-Id: <1522070958-24295-1-git-send-email-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a BRx is provided by a pipeline, the WPF must determine the master layer. Currently the condition to check this identifies pipe->bru || pipe->num_inputs > 1. The code then moves on to dereference pipe->bru, thus the check fails static analysers on the possibility that pipe->num_inputs could be greater than 1 without pipe->bru being set. The reality is that the pipeline must have a BRx to support more than one input, thus this could never cause a fault - however it also identifies that the num_inputs > 1 check is redundant. Remove the redundant check - and always configure the master layer appropriately when we have a BRx configured in our pipeline. Fixes: 6134148f6098 ("v4l: vsp1: Add support for the BRS entity") Cc: stable@vger.kernel.org Suggested-by: Mauro Carvalho Chehab Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_wpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index f7f3b4b2c2de..8bd6b2f1af15 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -452,7 +452,7 @@ static void wpf_configure(struct vsp1_entity *entity, : VI6_WPF_SRCRPF_RPF_ACT_SUB(input->entity.index); } - if (pipe->bru || pipe->num_inputs > 1) + if (pipe->bru) srcrpf |= pipe->bru->type == VSP1_ENTITY_BRU ? VI6_WPF_SRCRPF_VIRACT_MST : VI6_WPF_SRCRPF_VIRACT2_MST; -- 2.7.4