From patchwork Fri May 4 12:13:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10380371 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 81D97603B4 for ; Fri, 4 May 2018 12:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 623C6293F8 for ; Fri, 4 May 2018 12:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56DFE293FA; Fri, 4 May 2018 12:14:06 +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.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 178AB293F8 for ; Fri, 4 May 2018 12:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261AbeEDMOE (ORCPT ); Fri, 4 May 2018 08:14:04 -0400 Received: from osg.samsung.com ([64.30.133.232]:64919 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbeEDMOD (ORCPT ); Fri, 4 May 2018 08:14:03 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 5750E1E19D; Fri, 4 May 2018 05:14:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LNJyPNNzB0IZ; Fri, 4 May 2018 05:14:02 -0700 (PDT) Received: from smtp.s-opensource.com (177.17.129.114.dynamic.adsl.gvt.net.br [177.17.129.114]) by osg.samsung.com (Postfix) with ESMTPSA id 4CF2B1E197; Fri, 4 May 2018 05:14:02 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1fEZb5-0000gj-Uc; Fri, 04 May 2018 08:13:59 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Laurent Pinchart , linux-renesas-soc@vger.kernel.org Subject: [PATCH] media: vsp1: cleanup a false positive warning Date: Fri, 4 May 2018 08:13:58 -0400 Message-Id: X-Mailer: git-send-email 2.17.0 To: unlisted-recipients:; (no To-header on input) 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 With the new vsp1 code changes introduced by changeset f81f9adc4ee1 ("media: v4l: vsp1: Assign BRU and BRS to pipelines dynamically"), smatch complains with: drivers/media/platform/vsp1/vsp1_drm.c:262 vsp1_du_pipeline_setup_bru() error: we previously assumed 'pipe->bru' could be null (see line 180) This is a false positive, as, if pipe->bru is NULL, the brx var will be different, with ends by calling a code that will set pipe->bru to another value. Yet, cleaning this false positive is as easy as adding an explicit check if pipe->bru is NULL. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/vsp1/vsp1_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 095dc48aa25a..cb6b60843400 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -185,7 +185,7 @@ static int vsp1_du_pipeline_setup_brx(struct vsp1_device *vsp1, brx = &vsp1->brs->entity; /* Switch BRx if needed. */ - if (brx != pipe->brx) { + if (brx != pipe->brx || !pipe->brx) { struct vsp1_entity *released_brx = NULL; /* Release our BRx if we have one. */