]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: cpufeature: Drop this_hwcap clear in T-Head vector workaround
authorHui Wang <hui.wang@canonical.com>
Thu, 30 Apr 2026 04:53:50 +0000 (12:53 +0800)
committerPaul Walmsley <pjw@kernel.org>
Thu, 30 Apr 2026 19:36:24 +0000 (13:36 -0600)
The variable this_hwcap is initialized to 0 for each loop, it is not
necessary to do the bit clearance since this_hwcap is still 0 at this
point, clearing the source_isa is enough here.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://patch.msgid.link/20260430045350.22213-1-hui.wang@canonical.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/cpufeature.c

index 1734f9a4c2fd70e8fc25bec120ff167f83c46b9e..3dc4c0d31550fe37f6daf5097c581034a20115d0 100644 (file)
@@ -896,10 +896,8 @@ static void __init riscv_fill_hwcap_from_isa_string(unsigned long *isa2hwcap)
                 * CPU cores with the ratified spec will contain non-zero
                 * marchid.
                 */
-               if (acpi_disabled && boot_vendorid == THEAD_VENDOR_ID && boot_archid == 0x0) {
-                       this_hwcap &= ~isa2hwcap[RISCV_ISA_EXT_v];
+               if (acpi_disabled && boot_vendorid == THEAD_VENDOR_ID && boot_archid == 0x0)
                        clear_bit(RISCV_ISA_EXT_v, source_isa);
-               }
 
                riscv_resolve_isa(source_isa, isainfo->isa, &this_hwcap, isa2hwcap);