Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1704644pxb; Thu, 16 Sep 2021 13:27:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJjBiyxVUso4aligoAHjVrzqnt6QyEbF8r6Ly5gMjEDNfeQbzVdruPb0vkcG51muy86Lz/ X-Received: by 2002:a17:906:6d55:: with SMTP id a21mr8243392ejt.509.1631824060140; Thu, 16 Sep 2021 13:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631824060; cv=none; d=google.com; s=arc-20160816; b=yRW7EsKA0WuhXCbBfkVwIJVoUec34WqZk5sEv8iC58eXAl6ad+Va7O3qESkMXfDL3Z Btl4/1072lHeZYbKIa5FEjT+SBz5WI1djPSTL/Rp1/AoymgSsSdyRSOl2mwZlEiNh6yx /c/Nvri2tMEeP9Temgx5NULaz6+yBePcZTHg303Fti4GMUGk2WrR4vlZd8cOZJSMM17T 8IMocAW8ADTMibsrMnKktnn/5+JyED6nqkazwKGjHEKcXEPitWlXqILcbk7mF8vcaCR1 ari9Ho0VQ49ylJ13gYlLTP6CX+r0GNLTDCzniVuewHqf6PGYghxVcLlaKMnxYldZzuYW lH9w== 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=ANilVGfxonIIt2tXOAZKm5jIzhKYKwvd8t0JjkpV4D4=; b=c6OLiHT0Dz91EHFFMhXrlaci9FZ2M4KC0WZ/RYZE/WZ89HsFXQDeN58QKzL1YnBAe6 PQFhH67Uf0EPpIeInrhye7rysqbAGfGrlen8KQeUhALEodWTRZE22TowbCssR9PtU5/4 szWE0FifGfPFF1xNmkrrzebMQvrhLA+IlytCMn+IWDLHBN7tlD7C7NsFZAeG3tkpKieu YR8vfH0j9n6Lzlcc7wQX4L4drUWcjZMO+nUfx2ArCF5eDN+e9gYDpSs1Td61EGnJHwGZ P73fAJBHtra40yFqPoNWAA2QjCwrZ2fVIOx6zzDG3V7PebKLCkCLswb4E5uDwgLhKm9p SQeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DYeDU0vs; 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 g8si3920846edq.535.2021.09.16.13.27.04; Thu, 16 Sep 2021 13:27:40 -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=DYeDU0vs; 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 S237562AbhIPQ16 (ORCPT + 99 others); Thu, 16 Sep 2021 12:27:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241512AbhIPQTm (ORCPT ); Thu, 16 Sep 2021 12:19:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D84C6613B3; Thu, 16 Sep 2021 16:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808823; bh=76pG/1mTrO5PLLh788TwM7n8iSFCwidakWpyicrLVjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DYeDU0vs0XtiRG7LHT6xd/kWiwoXL8rxZ/3oe3pVGrXUTJeXVnbT7LRXxqZ1pcgl+ K7qy9wAwxZLkOTO4Nv7xod0Hk9fzhnoXOv9udruiWOiG6SD5d+slYlnBdjkXxfGGxt wIt3+53Td/fktZllcaWBREB3c9V8b+hlycJncA54= 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.10 235/306] drm/exynos: Always initialize mapping in exynos_drm_register_dma() Date: Thu, 16 Sep 2021 17:59:40 +0200 Message-Id: <20210916155802.067131314@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 0644936afee2..bf33c3084cb4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c @@ -115,6 +115,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