From patchwork Fri Sep 27 00:24:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174556 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787368ill; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwewRjsyQ5AyD9/HOj0K1cLxmA8st3jSCxITRZOLz4NtxOTDMZ0ibE7rtKect/TXBjSuKpo X-Received: by 2002:a05:6402:2022:: with SMTP id ay2mr1688319edb.109.1569543907092; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543907; cv=none; d=google.com; s=arc-20160816; b=A1xJzGpWHH97Q0gxZh0D5vuklsFwIqz7mT70wpPMtEbYGohjJGNiB08PX2mSMx+cgs XrZVS5mc7cvlPqnJ6ynefIn431/dz2sQAjWMI7dXim4NXhnnEErayy/28bzoIyTPvNWy 4QNXt3JIyyAZ6GaU9HIF9itMBAIJEtIaLd+5wlZ1+3QJSDzqeHtQlLDsZZRSKWCbMGgg yWuC4A7Ibu47iLuV2JKTzEIMMfJnYLkxAYBSTSEGNfZFq59wmqKpAIANFK8cEi4IEEUb 9u4/UIcst26ZrukLwtlFn8OZMDHa5VI2N0CcH1pLExnOYmzxsxhHSaE3aEk8ZFyXsMc1 fLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JkoxCwhnPe0SFeKySMCtF/hXJiLiKDyHZ2P8cGCAjJ4=; b=O5KNdBxGVh1D5uitnLYB54/YvupcnqFyzKJUxGxHndm8AkVuq6KQE3UzmFX6cobSoN P2r8gZh34y3Ea0GPdVf4+pYoObaCZJ9CuoQ5dVu/K1Wf9KTRUExbAcdCkRSUulpaUYry xqZ6Bc3W8b/AZdgpgVfwUS4oD1HDwJnQkwUV3h3t8juZIvaNTgvb7839koKf92pDgwYx aLg+fHMsutGy585I7bfBQMe11xvbxB0ic0cdmH3tGJwm4ZHCR797HRMmeNRyiMCb1PVM h/h+4mQm8KUgkAfEmWxBjR3Q2IKt7WMciNnsFp20w+o7LA7AtVXwuCLV6Wh/JlRGEzM3 0lhA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si1905166ejt.173.2019.09.26.17.25.06; Thu, 26 Sep 2019 17:25:07 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbfI0AZE (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:04 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:32868 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727502AbfI0AZD (ORCPT ); Thu, 26 Sep 2019 20:25:03 -0400 Received: by mail-ot1-f65.google.com with SMTP id o9so6809otl.0; Thu, 26 Sep 2019 17:25:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JkoxCwhnPe0SFeKySMCtF/hXJiLiKDyHZ2P8cGCAjJ4=; b=Z2umiizmy2F46GCtFv/rEpEMlzwFe4iMjl99d8mFPgLtZElqsGJ3hLucgRPEPlM/Z3 sipX8quj6lthD2Yi1H62hcOvO/jLTw3mxdzleNGnGPSFKqCJR3jVUbmei+wd3BfjNdBr xyUs11VC1J7lhUQMP1WVJHLwhHKpcy25xBoSudrRPfwGCxzg9Z3nUcrzCtbKrfXso1hw S68umZSleNs/xnYUq6t0+xGS68xMexG2COiBY2Fvz4iv6bz8tB5OZvL9RPrFyFDAT9jW Q9Hj5MHynHYAhAo3iU1Bcgb4xR9yYBVZZlv6e1p2WPxbGa82if6Aiw269/+nRhNmkN7t FIpQ== X-Gm-Message-State: APjAAAWydiRvx8Li8EBnz0Q1XTNfTznFEQ1HbWnGcWSjU760Vwli/6cT sxgOEyX3oQQd1ZR8OtdcCjhkkSM= X-Received: by 2002:a9d:4e0b:: with SMTP id p11mr1184024otf.280.1569543901894; Thu, 26 Sep 2019 17:25:01 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:01 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 03/11] of: address: Report of_dma_get_range() errors meaningfully Date: Thu, 26 Sep 2019 19:24:47 -0500 Message-Id: <20190927002455.13169-4-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Murphy If we failed to translate a DMA address, at least show the offending address rather than the uninitialised contents of the destination argument. Signed-off-by: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Geert Uytterhoeven diff --git a/drivers/of/address.c b/drivers/of/address.c index 8e354d12fb04..53d2656c2269 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -955,8 +955,8 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz dmaaddr = of_read_number(ranges, naddr); *paddr = of_translate_dma_address(np, ranges); if (*paddr == OF_BAD_ADDR) { - pr_err("translation of DMA address(%pad) to CPU address failed node(%pOF)\n", - dma_addr, np); + pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", + dmaaddr, np); ret = -EINVAL; goto out; }