]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/coresight-device_attr_ro-should-defined-as-static.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / coresight-device_attr_ro-should-defined-as-static.patch
CommitLineData
9547e94c
SL
1From d81faeaca54ee0a30246db002524edc05fcad84f Mon Sep 17 00:00:00 2001
2From: Eric Long <eric.long@linaro.org>
3Date: Wed, 17 Feb 2016 17:51:43 -0700
4Subject: coresight: "DEVICE_ATTR_RO" should defined as static.
5
6[ Upstream commit bf16e5b8cdeabc1fe6565af0be475bb2084dc388 ]
7
8"DEVICE_ATTR_RO(name)" should be defined as static. And
9there is an unnecessary space at the front of the code.
10
11The sparse tool output logs as the following:
12coresight-etm4x.c:2224:1: warning: symbol 'dev_attr_trcoslsr' was
13not declared. Should it be static?
14coresight-etm4x.c:2225:1: warning: symbol 'dev_attr_trcpdcr' was
15not declared. Should it be static?
16coresight-etm4x.c:2226:1: warning: symbol 'dev_attr_trcpdsr' was
17not declared. Should it be static?
18And the smatch tool output logs as the following:
19of_coresight.c:89 of_coresight_alloc_memory() warn:
20inconsistent indenting
21
22Signed-off-by: Eric Long <eric.long@linaro.org>
23Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25Signed-off-by: Sasha Levin <sashal@kernel.org>
26---
27 drivers/hwtracing/coresight/coresight-etm4x.c | 2 +-
28 drivers/hwtracing/coresight/of_coresight.c | 2 +-
29 2 files changed, 2 insertions(+), 2 deletions(-)
30
31diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
32index a6707642bb23..1ec6798b21e8 100644
33--- a/drivers/hwtracing/coresight/coresight-etm4x.c
34+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
35@@ -2219,7 +2219,7 @@ static ssize_t name##_show(struct device *_dev, \
36 return scnprintf(buf, PAGE_SIZE, "0x%x\n", \
37 readl_relaxed(drvdata->base + offset)); \
38 } \
39-DEVICE_ATTR_RO(name)
40+static DEVICE_ATTR_RO(name)
41
42 coresight_simple_func(trcoslsr, TRCOSLSR);
43 coresight_simple_func(trcpdcr, TRCPDCR);
44diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
45index 7d2bb1549608..fb7597b1c66f 100644
46--- a/drivers/hwtracing/coresight/of_coresight.c
47+++ b/drivers/hwtracing/coresight/of_coresight.c
48@@ -86,7 +86,7 @@ static int of_coresight_alloc_memory(struct device *dev,
49 return -ENOMEM;
50
51 /* Children connected to this component via @outports */
52- pdata->child_names = devm_kzalloc(dev, pdata->nr_outport *
53+ pdata->child_names = devm_kzalloc(dev, pdata->nr_outport *
54 sizeof(*pdata->child_names),
55 GFP_KERNEL);
56 if (!pdata->child_names)
57--
582.19.1
59