mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] coresight: etm3x: Remove redundant NULL check on perf event attr
@ 2026-10-27  9:17 James Clark
  2026-10-27  9:27 ` Leo Yan
  0 siblings, 1 reply; 2+ messages in thread
From: James Clark @ 2026-10-27  9:17 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, Leo Yan
  Cc: coresight, linux-kernel, Sashiko, James Clark

attr is derived from &event->attr, so it can never be NULL even if
event were NULL, making the check dead code. The only caller,
etm_enable_perf(), always passes a valid event anyway, so remove the
check.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-c4ca0d3c-1e98-4965-aa46-da226c756b83
Signed-off-by: James Clark <james.clark@linaro.org>
---
 drivers/hwtracing/coresight/coresight-etm3x-core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c
index b670a324bb41..755141691f69 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c
@@ -313,9 +313,6 @@ static int etm_parse_event_config(struct etm_drvdata *drvdata,
 	struct perf_event_attr *attr = &event->attr;
 	u8 ts_level;
 
-	if (!attr)
-		return -EINVAL;
-
 	/* Clear configuration from previous run */
 	memset(curr_config, 0, sizeof(struct etm_config));
 

---
base-commit: 343cfcbb3ecfdb80aa576a428cfa3b65ad783842
change-id: 20261027-james-cs-redundant-null-check-b1489a0ba03c

Best regards,
--  
James Clark <james.clark@linaro.org>


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

end of thread, other threads:[~2026-10-27  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27  9:17 [PATCH] coresight: etm3x: Remove redundant NULL check on perf event attr James Clark
2026-10-27  9:27 ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®