gator: Remove useless null check 77/292577/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 4 May 2023 01:11:12 +0000 (10:11 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 8 May 2023 09:39:23 +0000 (18:39 +0900)
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 <sw0312.kim@samsung.com>
drivers/gator/gator_pmu.c

index 5fc9c73..ca800d4 100644 (file)
@@ -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;
        }