]> www.infradead.org Git - users/hch/misc.git/commitdiff
drivers/perf: riscv: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 28 Aug 2025 12:25:09 +0000 (20:25 +0800)
committerPaul Walmsley <pjw@kernel.org>
Thu, 18 Sep 2025 14:18:43 +0000 (08:18 -0600)
For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20250828122510.30843-1-liaoyuanhong@vivo.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
drivers/perf/riscv_pmu_sbi.c

index 698de8ddf895ba8528c1b0acb5220d157f5f89a1..c18dbffa983450ae2f1992a7b24721b70816d443 100644 (file)
@@ -339,7 +339,7 @@ static bool pmu_sbi_ctr_is_fw(int cidx)
        if (!info)
                return false;
 
-       return (info->type == SBI_PMU_CTR_TYPE_FW) ? true : false;
+       return info->type == SBI_PMU_CTR_TYPE_FW;
 }
 
 /*