Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2348916pxb; Mon, 20 Sep 2021 19:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdc3qJhn0mYWmKSQuUl6vClQz+jdJ1GPOQv//HjsKue5BcMXpAcWb2y1n32FFR64t2Cd8u X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr33400904edy.170.1632192119706; Mon, 20 Sep 2021 19:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192119; cv=none; d=google.com; s=arc-20160816; b=ucSPrHha2QcYrLbuKTIU0hSCRPubtoFum7rCyHaHrJgIAy9EnJUtX1blk5sSNsHM+2 exGio/92sEP8YjBGfU3rjSGuNQX7c50ZtuZU+ZylsA5tWgdiyrS7fRrCT2x3VYbPPJ6T YuSn/+OzVxYEWr/PEeqOIVp8WiqnoxBHUjrlTSwACqO8rJwNl2AFAi7lgAgZ6K9tIdVj FGkDdOkOPBRLURDKz9hFvmvPd7Lsnq9yrXxvfpHljDamqoiGciREwG02ARj2NVz9Oy08 54Zi8TC0o0dghTTUm32gHDC69JPPcNcIOLJjLQd2ckRmu1qT67TcYEBXf6/3qzhdrj4U YB8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lBfuIK/2niLlt4QTTiJGzxMKkBazZGzspt/diGd6GQg=; b=MCrQAfLDp6Zyt6WPA7Vck0owcPXxZJR6k9TUIK0Z3knzxY3ITlOKUBa8a0xqvxa8/3 HquL5C3HWjvkj0tNvG2NJqVANOzf85NhNnlg2LcJaKW9mYXn57SfDr7jIDhXRLv8UAPL ZzCGFZatt52lBZHdb3X5Inl8AEkmbmhwi9ii4mSocO+riVIDdfi3H7dOwx1BG/fwqzNe 2XA1DkeQgWs/V/fSaqx8308d0hVXdRCyODpl/7ZgUFGF/833aYYjFRd4HucHZybod5lN K0uGvUnU0rAgdrO6NFXmw9I6aL6p8KNTI3OM01L8ic1Q+tCYHjFUbRjuSLL8h2b2VfKo R1Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wj2+vZu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk18si17985630ejb.238.2021.09.20.19.41.36; Mon, 20 Sep 2021 19:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wj2+vZu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351700AbhITSQh (ORCPT + 99 others); Mon, 20 Sep 2021 14:16:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:36230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356359AbhITSKr (ORCPT ); Mon, 20 Sep 2021 14:10:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8BB5663276; Mon, 20 Sep 2021 17:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158419; bh=QOZ5zytWglQA3/+3KXYARHhWSKqxTsAXNpce4qfrPMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wj2+vZu22i4hBQ/0kYB6WaWlfuZYXMAkosFsbBxMZXrZ1vaIh3/+RdDDAtGhhwSHY NuwrgpKIi5bFW/Q5lkroTS0/havJl9dLVGBA4I/JRopM2iriDH4BZBLkBVWg3QIDaZ s3W1CsVsnyHGxpDHUc23DYlrXEYoah1tS+LullGk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Nathan Chancellor , Inki Dae , Sasha Levin Subject: [PATCH 5.4 146/260] drm/exynos: Always initialize mapping in exynos_drm_register_dma() Date: Mon, 20 Sep 2021 18:42:44 +0200 Message-Id: <20210920163936.077569484@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit c626f3864bbbb28bbe06476b0b497c1330aa4463 ] In certain randconfigs, clang warns: drivers/gpu/drm/exynos/exynos_drm_dma.c:121:19: warning: variable 'mapping' is uninitialized when used here [-Wuninitialized] priv->mapping = mapping; ^~~~~~~ drivers/gpu/drm/exynos/exynos_drm_dma.c:111:16: note: initialize the variable 'mapping' to silence this warning void *mapping; ^ = NULL 1 warning generated. This occurs when CONFIG_EXYNOS_IOMMU is enabled and both CONFIG_ARM_DMA_USE_IOMMU and CONFIG_IOMMU_DMA are disabled, which makes the code look like void *mapping; if (0) mapping = arm_iommu_create_mapping() else if (0) mapping = iommu_get_domain_for_dev() ... priv->mapping = mapping; Add an else branch that initializes mapping to the -ENODEV error pointer so that there is no more warning and the driver does not change during runtime. Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c index 58b89ec11b0e..a3c9d8b9e1a1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c @@ -140,6 +140,8 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev, EXYNOS_DEV_ADDR_START, EXYNOS_DEV_ADDR_SIZE); else if (IS_ENABLED(CONFIG_IOMMU_DMA)) mapping = iommu_get_domain_for_dev(priv->dma_dev); + else + mapping = ERR_PTR(-ENODEV); if (IS_ERR(mapping)) return PTR_ERR(mapping); -- 2.30.2