All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] coresight: Few cleanups
@ 2021-05-13 13:27 ` Qi Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

This patchset is just a clean up and should not cause a functional change.

Junhao He (3):
  coresight: core: Fix use of uninitialized pointer
  coresight: core: Remove unnecessary assignment
  coresight: etm4x: core: Remove redundant check of attr

 drivers/hwtracing/coresight/coresight-core.c       | 3 +--
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
 2 files changed, 1 insertion(+), 7 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 0/3] coresight: Few cleanups
@ 2021-05-13 13:27 ` Qi Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

This patchset is just a clean up and should not cause a functional change.

Junhao He (3):
  coresight: core: Fix use of uninitialized pointer
  coresight: core: Remove unnecessary assignment
  coresight: etm4x: core: Remove redundant check of attr

 drivers/hwtracing/coresight/coresight-core.c       | 3 +--
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
 2 files changed, 1 insertion(+), 7 deletions(-)

-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] coresight: core: Fix use of uninitialized pointer
  2021-05-13 13:27 ` Qi Liu
@ 2021-05-13 13:27   ` Qi Liu
  -1 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

Currently the pointer "sink" might be checked before initialized. Fix
this by initializing this pointer.

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 6c68d34..4ddf3d2 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -608,7 +608,7 @@ static struct coresight_device *
 coresight_find_enabled_sink(struct coresight_device *csdev)
 {
 	int i;
-	struct coresight_device *sink;
+	struct coresight_device *sink = NULL;
 
 	if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
 	     csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 1/3] coresight: core: Fix use of uninitialized pointer
@ 2021-05-13 13:27   ` Qi Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

Currently the pointer "sink" might be checked before initialized. Fix
this by initializing this pointer.

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 6c68d34..4ddf3d2 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -608,7 +608,7 @@ static struct coresight_device *
 coresight_find_enabled_sink(struct coresight_device *csdev)
 {
 	int i;
-	struct coresight_device *sink;
+	struct coresight_device *sink = NULL;
 
 	if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
 	     csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] coresight: core: Remove unnecessary assignment
  2021-05-13 13:27 ` Qi Liu
@ 2021-05-13 13:27   ` Qi Liu
  -1 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

Remove unnecessary assignment of "path" in coresight_release_path().

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 4ddf3d2..d75b19a 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -886,7 +886,6 @@ void coresight_release_path(struct list_head *path)
 	}
 
 	kfree(path);
-	path = NULL;
 }
 
 /* return true if the device is a suitable type for a default sink */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] coresight: core: Remove unnecessary assignment
@ 2021-05-13 13:27   ` Qi Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

Remove unnecessary assignment of "path" in coresight_release_path().

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 4ddf3d2..d75b19a 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -886,7 +886,6 @@ void coresight_release_path(struct list_head *path)
 	}
 
 	kfree(path);
-	path = NULL;
 }
 
 /* return true if the device is a suitable type for a default sink */
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] coresight: etm4x: core: Remove redundant check of attr
  2021-05-13 13:27 ` Qi Liu
@ 2021-05-13 13:27   ` Qi Liu
  -1 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

"attr" is checked by perf framework, so remove the redundant check in
etm4_parse_event_config().

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
index db88199..da27cd4 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
@@ -568,11 +568,6 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
 	struct etmv4_config *config = &drvdata->config;
 	struct perf_event_attr *attr = &event->attr;
 
-	if (!attr) {
-		ret = -EINVAL;
-		goto out;
-	}
-
 	/* Clear configuration from previous run */
 	memset(config, 0, sizeof(struct etmv4_config));
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] coresight: etm4x: core: Remove redundant check of attr
@ 2021-05-13 13:27   ` Qi Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Qi Liu @ 2021-05-13 13:27 UTC (permalink / raw)
  To: mathieu.poirier, suzuki.poulose, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

From: Junhao He <hejunhao2@hisilicon.com>

"attr" is checked by perf framework, so remove the redundant check in
etm4_parse_event_config().

Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
index db88199..da27cd4 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
@@ -568,11 +568,6 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
 	struct etmv4_config *config = &drvdata->config;
 	struct perf_event_attr *attr = &event->attr;
 
-	if (!attr) {
-		ret = -EINVAL;
-		goto out;
-	}
-
 	/* Clear configuration from previous run */
 	memset(config, 0, sizeof(struct etmv4_config));
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] coresight: Few cleanups
  2021-05-13 13:27 ` Qi Liu
@ 2021-05-13 13:56   ` Suzuki K Poulose
  -1 siblings, 0 replies; 10+ messages in thread
From: Suzuki K Poulose @ 2021-05-13 13:56 UTC (permalink / raw)
  To: Qi Liu, mathieu.poirier, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

On 13/05/2021 14:27, Qi Liu wrote:
> This patchset is just a clean up and should not cause a functional change.
> 
> Junhao He (3):
>    coresight: core: Fix use of uninitialized pointer
>    coresight: core: Remove unnecessary assignment
>    coresight: etm4x: core: Remove redundant check of attr
> 
>   drivers/hwtracing/coresight/coresight-core.c       | 3 +--
>   drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
>   2 files changed, 1 insertion(+), 7 deletions(-)
> 

Thanks for the cleanups. I will queue them

Suzuki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] coresight: Few cleanups
@ 2021-05-13 13:56   ` Suzuki K Poulose
  0 siblings, 0 replies; 10+ messages in thread
From: Suzuki K Poulose @ 2021-05-13 13:56 UTC (permalink / raw)
  To: Qi Liu, mathieu.poirier, mike.leach
  Cc: coresight, linux-kernel, linux-arm-kernel, linuxarm

On 13/05/2021 14:27, Qi Liu wrote:
> This patchset is just a clean up and should not cause a functional change.
> 
> Junhao He (3):
>    coresight: core: Fix use of uninitialized pointer
>    coresight: core: Remove unnecessary assignment
>    coresight: etm4x: core: Remove redundant check of attr
> 
>   drivers/hwtracing/coresight/coresight-core.c       | 3 +--
>   drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 -----
>   2 files changed, 1 insertion(+), 7 deletions(-)
> 

Thanks for the cleanups. I will queue them

Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-13 13:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 13:27 [PATCH 0/3] coresight: Few cleanups Qi Liu
2021-05-13 13:27 ` Qi Liu
2021-05-13 13:27 ` [PATCH 1/3] coresight: core: Fix use of uninitialized pointer Qi Liu
2021-05-13 13:27   ` Qi Liu
2021-05-13 13:27 ` [PATCH 2/3] coresight: core: Remove unnecessary assignment Qi Liu
2021-05-13 13:27   ` Qi Liu
2021-05-13 13:27 ` [PATCH 3/3] coresight: etm4x: core: Remove redundant check of attr Qi Liu
2021-05-13 13:27   ` Qi Liu
2021-05-13 13:56 ` [PATCH 0/3] coresight: Few cleanups Suzuki K Poulose
2021-05-13 13:56   ` Suzuki K Poulose

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.