From 60ed042ce5fd41a917a24ac94b1480032eae35bb Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 4 May 2023 10:11:12 +0900 Subject: [PATCH] gator: Remove useless null check Checking null for array address returns true always, so -Waddress gives build warning from gcc 12. Remove the useless null check. Change-Id: I7caecc1edc6adae3b0652a28f6eea91a9546a05d Signed-off-by: Seung-Woo Kim --- drivers/gator/gator_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gator/gator_pmu.c b/drivers/gator/gator_pmu.c index 5fc9c7390ab9..ca800d4e3d90 100644 --- a/drivers/gator/gator_pmu.c +++ b/drivers/gator/gator_pmu.c @@ -48,8 +48,7 @@ static const struct gator_cpu *gator_find_cpu_by_pmu_name(const char *const name const struct gator_cpu *gator_cpu; list_for_each_entry(gator_cpu, &gator_cpus, list) { - if (gator_cpu->pmnc_name != NULL && - /* Do the names match exactly? */ + if ( /* Do the names match exactly? */ (strcasecmp(gator_cpu->pmnc_name, name) == 0 || /* Do these names match but have the old vs new prefix? */ ((strncasecmp(name, OLD_PMU_PREFIX, sizeof(OLD_PMU_PREFIX) - 1) == 0 && @@ -67,7 +66,7 @@ static const struct uncore_pmu *gator_find_uncore_pmu(const char *const name) const struct uncore_pmu *uncore_pmu; list_for_each_entry(uncore_pmu, &uncore_pmus, list) { - if (uncore_pmu->pmnc_name != NULL && strcasecmp(uncore_pmu->pmnc_name, name) == 0) + if (strcasecmp(uncore_pmu->pmnc_name, name) == 0) return uncore_pmu; } -- 2.34.1