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
On Tue, Oct 27, 2026 at 09:17:06AM +0000, James Clark wrote:
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
Reviewed-by: Leo Yan leo.yan@arm.com