From patchwork Mon Nov 7 18:17:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 81165 Delivered-To: patch@linaro.org Received: by 10.182.113.165 with SMTP id iz5csp1260108obb; Mon, 7 Nov 2016 10:22:44 -0800 (PST) X-Received: by 10.99.216.21 with SMTP id b21mr12635083pgh.159.1478542964412; Mon, 07 Nov 2016 10:22:44 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id k11si32638964pgp.108.2016.11.07.10.22.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 10:22:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c3oY5-00034W-VE; Mon, 07 Nov 2016 18:21:37 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c3oVH-0008BA-Ri for linux-arm-kernel@bombadil.infradead.org; Mon, 07 Nov 2016 18:18:43 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by merlin.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c3oVF-0006wv-Le for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2016 18:18:42 +0000 Received: by mail-wm0-x229.google.com with SMTP id f82so135377777wmf.1 for ; Mon, 07 Nov 2016 10:18:21 -0800 (PST) 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=o6p7nFWxk1VR7fZps40ridXXiUQ3COP/xshTPRMyp1A=; b=jtZ9VewjakDnc6sSNSEHs2TATcQGIbAn2v4EB3XJU9KCYxZ/Fl5CQhwAdaVp28XRLO ulu0rTrMWZQxRn26Asc8zBRQ+k6yKxfEkHvm7IFMwt1ZWiu1+yMvBwkuM5NJ/it00csw o80xjgWQOz3LoxW7GFuXuVd6UKcKcMtbNU+hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o6p7nFWxk1VR7fZps40ridXXiUQ3COP/xshTPRMyp1A=; b=lvGmc28dkRLHe8l1n2WuHLnCRDWlS1FGVOKwJeHgKEADtMH1gkOlSZhksc0HSShxGy 6dsAVX2vphNfsK39LqeBbSN+F2A5NNrahB8QFrK3OqBFEAfzrGLBHaJjxww8ulyqt4Li YiaoKP/YtCoxHNZHgGrE4FJggEC469x8SI+mJlGDtNEpdOaF6fWr+T0a75QURh8CibU0 MbcQmFGBJ3NPM+31OWgnT+1DmOx1AfYhUmDNiel5M6VoqvXgu8UHY/QDRgaLlZsd7pc5 ImQz5k3S+YflzFSIm+epabjThZTu/NIu4x/LWyxYVuIeKAKPRq4LjaggfwqXG9OZ1HSx Vtsg== X-Gm-Message-State: ABUngvc2krnX7DQniIMNp+Wa4knSaHMVsea2GSHgmroM3yJopujTgrD6Su15U/RtETMPNBdx X-Received: by 10.194.115.135 with SMTP id jo7mr6658804wjb.21.1478542699600; Mon, 07 Nov 2016 10:18:19 -0800 (PST) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust4998.18-1.cable.virginm.net. [86.31.179.135]) by smtp.gmail.com with ESMTPSA id c4sm14921903wmh.4.2016.11.07.10.18.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Nov 2016 10:18:18 -0800 (PST) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, bjorn.andersson@linaro.org, vinod.koul@intel.com, ohad@wizery.com Subject: [PATCH v11 12/14] dmaengine: st_fdma: fix uninitialized variable access Date: Mon, 7 Nov 2016 18:17:43 +0000 Message-Id: <1478542665-17089-13-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478542665-17089-1-git-send-email-peter.griffin@linaro.org> References: <1478542665-17089-1-git-send-email-peter.griffin@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161107_131841_843877_B86A705C X-CRM114-Status: GOOD ( 14.76 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:229 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.griffin@linaro.org, dmaengine@vger.kernel.org, lee.jones@linaro.org, remoteproc@vger.kernel.org, Arnd Bergmann MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: Arnd Bergmann The newly added st_fdma driver introduces a build warning for allmodconfig when we add '-Wmaybe-uninitialized': drivers/dma/st_fdma.c: In function 'st_fdma_probe': drivers/dma/st_fdma.c:777:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] The warning is correct, though this can't happen in practice as the check is redundant (we don't get to this function if the pointer is NULL). Even if the function were called with a NULL of_node, the check is not needed because of_property_read_u32 can deal with a NULL argument by returning an error. Removing the unnecessary code simplifies the function and avoids the condition that we get the warning for. Fixes: 6b4cd727eaf1 ("dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support") Signed-off-by: Arnd Bergmann Acked-by: Peter Griffin --- drivers/dma/st_fdma.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index 515e1d4..232d354 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -720,21 +720,11 @@ static int st_fdma_parse_dt(struct platform_device *pdev, const struct st_fdma_driverdata *drvdata, struct st_fdma_dev *fdev) { - struct device_node *np = pdev->dev.of_node; - int ret; - - if (!np) - goto err; - - ret = of_property_read_u32(np, "dma-channels", &fdev->nr_channels); - if (ret) - goto err; - snprintf(fdev->fw_name, FW_NAME_SIZE, "fdma_%s_%d.elf", drvdata->name, drvdata->id); -err: - return ret; + return of_property_read_u32(pdev->dev.of_node, "dma-channels", + &fdev->nr_channels); } #define FDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \