From: Seung-Woo Kim Date: Thu, 4 May 2023 01:11:12 +0000 (+0900) Subject: gator: Remove useless null check X-Git-Tag: accepted/tizen/unified/20230531.034423~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60ed042ce5fd41a917a24ac94b1480032eae35bb;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- 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; }