From patchwork Wed Jan 20 06:39:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Long X-Patchwork-Id: 60006 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2999886lbb; Tue, 19 Jan 2016 22:40:20 -0800 (PST) X-Received: by 10.98.14.81 with SMTP id w78mr50313816pfi.26.1453272020304; Tue, 19 Jan 2016 22:40:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si53122803pfa.203.2016.01.19.22.40.19; Tue, 19 Jan 2016 22:40:20 -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 S1758154AbcATGkS (ORCPT + 29 others); Wed, 20 Jan 2016 01:40:18 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35491 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbcATGkL (ORCPT ); Wed, 20 Jan 2016 01:40:11 -0500 Received: by mail-pa0-f53.google.com with SMTP id ho8so204171656pac.2 for ; Tue, 19 Jan 2016 22:40:11 -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=M30tf4dqH0Qe/dDpZzsC5cNZA00H2jxbpEZwENiznpxN3n/78D0caKBA+FPwubBQQb wijY6z3SuaWHUh15ywTxpES7RSYoMPPNmhEMo2HLsWqNFFRg5CnlnNd0MqWN/ARxqUzG 4hjsV+stvUZE7QO1Wt3KoJt4JwiAoNTUVzZhc= 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=b3BQPHDle6eJBLo9LsvTGOsA527GdeDHFIALr2dq8C5Pl/nsrtml7z/EF1lXgHsdaP Ur+5E3Ay98m8PCtxMfjUOv0ir9VpgOrMsaINledjq/lEjo+N6AJZ0H5Jzg1J8SmUbO7J qYKCX6UlpqCcsOaC/pccQ1gJ23ITBn6T59PmlgvX4pcB4oV02TI9Z5yJ40++gOFjsfsx NE/q3flECcXEeDljoQmgok2WPt0xJoPG8iH/EnwCdKxs7B3LgRO3tkyalkmo8QhyE7HX J/g/vSnfkrZTTl86MKvHdSXupKw7XYWPOvTvOKZ9ubEDQnhdBseakXfAUEW6xWF/2OqM Dg0A== X-Gm-Message-State: ALoCoQnf23kwDE3EilK9ignYU70tSxomEYAD1ipe2qy9KIdgEc9oFCKcvuMjYCvHK+3hM/hdVo8GRpAO6rbyHJcYufA3DnNyPg== X-Received: by 10.66.141.142 with SMTP id ro14mr49584939pab.112.1453272011270; Tue, 19 Jan 2016 22:40:11 -0800 (PST) Received: from ericlongubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id cl3sm46279890pad.11.2016.01.19.22.40.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 22:40:10 -0800 (PST) From: Eric Long To: mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: baolin.wang@linaro.org, zhang.chunyan@linaro.org, eric.long@linaro.org Subject: [RESEND PATCH 1/2] coresight: tmc/etm4x: Remove the mistakes detected by sparse tool Date: Wed, 20 Jan 2016 14:39:12 +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; }