From patchwork Mon Jan 25 08:34:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Long X-Patchwork-Id: 60277 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1222947lbb; Mon, 25 Jan 2016 00:36:31 -0800 (PST) X-Received: by 10.67.6.67 with SMTP id cs3mr24212194pad.143.1453710991355; Mon, 25 Jan 2016 00:36:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si32206226pfs.118.2016.01.25.00.36.30; Mon, 25 Jan 2016 00:36:31 -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 S932288AbcAYIg3 (ORCPT + 30 others); Mon, 25 Jan 2016 03:36:29 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:32841 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932170AbcAYIfw (ORCPT ); Mon, 25 Jan 2016 03:35:52 -0500 Received: by mail-pf0-f170.google.com with SMTP id e65so78938860pfe.0 for ; Mon, 25 Jan 2016 00:35:52 -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=BLl9MkUGDEPiqN5fJlK9ynsSAgTTiMhKcdAaR2Dm2M8=; b=WJ6lJHtClfAr/PdEey6NFPSCik2fs03BvSGtZmmhR++7DJPUnd+JOJMsBzAsrAldfx gs23UXN7BB8qqdKIKQFobIzm0T24imsnU9CJEF99o/dY5na48bq0DZNLHk/2Eeii+pTA GGUJ7I7WKeVzFk1eo01alsBO/+yY8JpQaTSlY= 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=BLl9MkUGDEPiqN5fJlK9ynsSAgTTiMhKcdAaR2Dm2M8=; b=fxiGAYuVA3dG/KkxbXmhzt2S2LAG5IPc/ys5nXT7v462GtT8zMioUnsp/nK+xOgsGo 9e4wHlUnhYW9CKYKw4C7U9wD81pe8OPKgAZZ55TTqiyi8nSFd+/ucD2P/7uZ8S+gH2Cv 1xYlYiVYXfkb1CQTVp3kUmtq6TXSpzZccaQRgaYGEXycFrykSp+4G1KMZv1QyKDZfXlv cNhMyKkD55WN4XOsEmAu45eu7a8iMhQ0NiuwC7GAeZWaFuhaFz2kJvirjNqhJU7sOhp9 9iHHjqpLiAk3hBvZKrJvSs5+/tUAnfx7e/l56vU85dsA86uhxLYSDNmEd/9WN8jI/XGT rhQQ== X-Gm-Message-State: AG10YORMzjbfcAsmPT/WFp5nCIM8kEXZD1uRsUI60h8JLa59maZ2EMqAOI8IkdqCruCNvnBx X-Received: by 10.98.32.25 with SMTP id g25mr24251704pfg.20.1453710952015; Mon, 25 Jan 2016 00:35:52 -0800 (PST) Received: from ericlongubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id ah10sm26609838pad.23.2016.01.25.00.35.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jan 2016 00:35:51 -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: [PATCH v2 1/2] coresight: "DEVICE_ATTR_RO" should defined as static. Date: Mon, 25 Jan 2016 16:34:55 +0800 Message-Id: <8deddd68ec28fa1bd9ce007694f13ff27cb99191.1453708131.git.eric.long@linaro.org> 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 "DEVICE_ATTR_RO(name)" should be defined as static. And there is an unnecessary space at the front of the code. 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? And the smatch tool output logs as the following: of_coresight.c:89 of_coresight_alloc_memory() warn: inconsistent indenting Signed-off-by: Eric Long --- drivers/hwtracing/coresight/coresight-etm4x.c | 2 +- drivers/hwtracing/coresight/of_coresight.c | 2 +- 2 files changed, 2 insertions(+), 2 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/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index b097361..3cc57c1 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -86,7 +86,7 @@ static int of_coresight_alloc_memory(struct device *dev, return -ENOMEM; /* Children connected to this component via @outports */ - pdata->child_names = devm_kzalloc(dev, pdata->nr_outport * + pdata->child_names = devm_kzalloc(dev, pdata->nr_outport * sizeof(*pdata->child_names), GFP_KERNEL); if (!pdata->child_names)