From patchwork Wed Jan 13 05:36:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Long X-Patchwork-Id: 59645 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3155789lbb; Tue, 12 Jan 2016 21:37:45 -0800 (PST) X-Received: by 10.98.73.212 with SMTP id r81mr37611208pfi.140.1452663465386; Tue, 12 Jan 2016 21:37:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 83si41201201pfs.84.2016.01.12.21.37.45; Tue, 12 Jan 2016 21:37:45 -0800 (PST) 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754362AbcAMFhm (ORCPT + 29 others); Wed, 13 Jan 2016 00:37:42 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34072 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbcAMFhj (ORCPT ); Wed, 13 Jan 2016 00:37:39 -0500 Received: by mail-pf0-f179.google.com with SMTP id q63so77392778pfb.1 for ; Tue, 12 Jan 2016 21:37:39 -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 :in-reply-to:references; bh=qlJfx/PGYrb20kV8wgcZt0V6BUFOlnKzj4WLK3nbhDU=; b=O3vkzKJPox5dzjeLHxGQZjUpF0knybiThiDGmuNi+T4eNPxdWEOYf6wMT0MLT+nNo4 rfes3RPXx2Py02STttKAzWyVczsr/xMap3jmFH3y4mU4KeJt1LKxux7cQIbiM7Q8q7Kt shJmazjp4/kMlc0swbH1Zepa8544/NWK1Gaz8= 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:in-reply-to:references; bh=qlJfx/PGYrb20kV8wgcZt0V6BUFOlnKzj4WLK3nbhDU=; b=jNYh0CFpQFJ7jP9T40t8ly302W/MGU+mzI7LtotsyN5HWlzu8HjzkM2WbENiJfvQPZ LLmTKNTyrNaRhExP/OLVoN6GB4mwl4ulR3opSfjgPJe+c0kh/5KMr0WPqmE7xtEURz68 dW//NE6pNwHH9CeqWrFkAnh7GAf1MbxVXIxMtj2A3UOA8scIXwFlIxgpNkFLgnJTuz5G UFgekrKLoplUHTlbqc8/LcSIyBpheLvWCj4IKselN1XNsP8fTnEXfHePt3qmE3HLn85D WWR+sZLzkJTJRWVgPrnC7QhDmxtS2ttcWY1U2Oy4VIgUoj0uQ0dJXvwWa4XPeUVv3cLj yIFg== X-Gm-Message-State: ALoCoQkcvvSYK3gjmR/ypLDvrDFMALNxdsLNEDsLvJ97lUY568eGwlVuk18w9m0+bi8yRQNtYnu83Uc0SwlBI1ZA79erGqNS8w== X-Received: by 10.98.64.27 with SMTP id n27mr40029851pfa.58.1452663458693; Tue, 12 Jan 2016 21:37:38 -0800 (PST) Received: from ericlongubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id q89sm34139858pfa.70.2016.01.12.21.37.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jan 2016 21:37:38 -0800 (PST) From: Eric Long To: mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org Cc: baolin.wang@linaro.org, zhang.chunyan@linaro.org, eric.long@linaro.org Subject: [PATCH 1/2] coresight: tmc/etm4x: Remove the mistakes detected by sparse tool Date: Wed, 13 Jan 2016 13:36:57 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dma_alloc_coherent return an "void *" not an "void __iomen *". It uses the wrong parameters when calls dma_free coherent function, and "DEVICE_ATTR_RO" should be defined as static. The sparse tool output logs as the following: coresight-etm4x.c:2224:1: warning: symbol 'dev_attr_trcoslsr' was not declared. Should it be static? coresight-etm4x.c:2225:1: warning: symbol 'dev_attr_trcpdcr' was not declared. Should it be static? coresight-etm4x.c:2226:1: warning: symbol 'dev_attr_trcpdsr' was not declared. Should it be static? coresight-tmc.c:199:23: warning: incorrect type in argument 1 (different address spaces) coresight-tmc.c:199:23: expected void * coresight-tmc.c:199:23: got void [noderef] *vaddr coresight-tmc.c:336:30: warning: incorrect type in assignment (different address spaces) coresight-tmc.c:336:30: expected char *buf coresight-tmc.c:336:30: got void [noderef] * coresight-tmc.c:769:50: warning: incorrect type in argument 4 (different base types) coresight-tmc.c:769:50: expected unsigned long long [unsigned] [usertype] dma_handle coresight-tmc.c:769:50: got restricted gfp_t Signed-off-by: Eric Long --- drivers/hwtracing/coresight/coresight-etm4x.c | 2 +- drivers/hwtracing/coresight/coresight-tmc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index a670764..1ec6798 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -2219,7 +2219,7 @@ static ssize_t name##_show(struct device *_dev, \ return scnprintf(buf, PAGE_SIZE, "0x%x\n", \ readl_relaxed(drvdata->base + offset)); \ } \ -DEVICE_ATTR_RO(name) +static DEVICE_ATTR_RO(name) coresight_simple_func(trcoslsr, TRCOSLSR); coresight_simple_func(trcpdcr, TRCPDCR); diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index a57c7ec..5b052d1 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -124,7 +124,7 @@ struct tmc_drvdata { bool reading; char *buf; dma_addr_t paddr; - void __iomem *vaddr; + void *vaddr; u32 size; bool enable; enum tmc_config_type config_type; @@ -766,7 +766,7 @@ err_misc_register: err_devm_kzalloc: if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) dma_free_coherent(dev, drvdata->size, - &drvdata->paddr, GFP_KERNEL); + drvdata->vaddr, drvdata->paddr); return ret; } @@ -778,7 +778,7 @@ static int tmc_remove(struct amba_device *adev) coresight_unregister(drvdata->csdev); if (drvdata->config_type == TMC_CONFIG_TYPE_ETR) dma_free_coherent(drvdata->dev, drvdata->size, - &drvdata->paddr, GFP_KERNEL); + drvdata->vaddr, drvdata->paddr); return 0; }