* [PATCH 0/3] coresight tmc etr: Miscellanous fixes
@ 2018-04-19 17:39 Mathieu Poirier
2018-04-19 17:39 ` [PATCH 1/3] coresight tmc etr: Make memory check consistent in the same function Mathieu Poirier
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Mathieu Poirier @ 2018-04-19 17:39 UTC (permalink / raw)
To: linux-arm-kernel
This set is addressing a couple of issues with TMC-ETR function
tmc_enable_etr_sink_sysfs() as pointed out by Dan Carpenter [1]
along with an extra newline left behind inadvertently.
[1]. https://www.spinics.net/lists/arm-kernel/msg647061.html
Mathieu Poirier (3):
coresight tmc etr: Make memory check consistent in the same function
coresight tmc etr: Fix uninitialised variable
coresight tmc etr: Removing extra newline
drivers/hwtracing/coresight/coresight-tmc-etr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] coresight tmc etr: Make memory check consistent in the same function
2018-04-19 17:39 [PATCH 0/3] coresight tmc etr: Miscellanous fixes Mathieu Poirier
@ 2018-04-19 17:39 ` Mathieu Poirier
2018-04-19 17:39 ` [PATCH 2/3] coresight tmc etr: Fix uninitialised variable Mathieu Poirier
2018-04-19 17:39 ` [PATCH 3/3] coresight tmc etr: Removing extra newline Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2018-04-19 17:39 UTC (permalink / raw)
To: linux-arm-kernel
While operating from sysFS the TMC-ETR driver needs to make sure it has
memory to work with but doesn't allocate memory uselessly either. Since
the main memory handle for this driver is drvdata::vaddr, use it throughout
function tmc_enable_etr_sink_sysfs() so that things are consistent.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index cce2ff42e8e2..8ee8c66f4002 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -153,11 +153,11 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
goto out;
/*
- * If drvdata::buf == NULL, use the memory allocated above.
+ * If drvdata::vaddr == NULL, use the memory allocated above.
* Otherwise a buffer still exists from a previous session, so
* simply use that.
*/
- if (drvdata->buf == NULL) {
+ if (drvdata->vaddr == NULL) {
used = true;
drvdata->vaddr = vaddr;
drvdata->paddr = paddr;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] coresight tmc etr: Fix uninitialised variable
2018-04-19 17:39 [PATCH 0/3] coresight tmc etr: Miscellanous fixes Mathieu Poirier
2018-04-19 17:39 ` [PATCH 1/3] coresight tmc etr: Make memory check consistent in the same function Mathieu Poirier
@ 2018-04-19 17:39 ` Mathieu Poirier
2018-04-19 17:39 ` [PATCH 3/3] coresight tmc etr: Removing extra newline Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2018-04-19 17:39 UTC (permalink / raw)
To: linux-arm-kernel
Variable 'paddr' can't be used if uninitialised but is nonetheless
confusing to some static checker. As such simply initialise it to zero.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index 8ee8c66f4002..f57199580c11 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -113,7 +113,7 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
bool used = false;
unsigned long flags;
void __iomem *vaddr = NULL;
- dma_addr_t paddr;
+ dma_addr_t paddr = 0;
struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] coresight tmc etr: Removing extra newline
2018-04-19 17:39 [PATCH 0/3] coresight tmc etr: Miscellanous fixes Mathieu Poirier
2018-04-19 17:39 ` [PATCH 1/3] coresight tmc etr: Make memory check consistent in the same function Mathieu Poirier
2018-04-19 17:39 ` [PATCH 2/3] coresight tmc etr: Fix uninitialised variable Mathieu Poirier
@ 2018-04-19 17:39 ` Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2018-04-19 17:39 UTC (permalink / raw)
To: linux-arm-kernel
The simple removal of an extra newline, no change in functionality.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index f57199580c11..02f747afa2ba 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -116,7 +116,6 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
dma_addr_t paddr = 0;
struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
-
/*
* If we don't have a buffer release the lock and allocate memory.
* Otherwise keep the lock and move along.
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-19 17:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-19 17:39 [PATCH 0/3] coresight tmc etr: Miscellanous fixes Mathieu Poirier
2018-04-19 17:39 ` [PATCH 1/3] coresight tmc etr: Make memory check consistent in the same function Mathieu Poirier
2018-04-19 17:39 ` [PATCH 2/3] coresight tmc etr: Fix uninitialised variable Mathieu Poirier
2018-04-19 17:39 ` [PATCH 3/3] coresight tmc etr: Removing extra newline Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).