[PATCH v3 11/13] crypto: hisilicon/sec2: Remove check of CONFIG_CPU_LITTLE_ENDIAN

Will Deacon will at kernel.org
Fri Sep 18 07:52:13 PDT 2026


The hisilicon "sec" driver targets arm64 but can be compile-tested on
other 64-bit architectures. In preparation for removing the definition
of CONFIG_CPU_LITTLE_ENDIAN for arm64 (since it will be little-endian
only), invert the check in sec_set_endian() so that it behaves as
little-endian by default.

Cc: Chenghai Huang <huangchenghai2 at huawei.com>
Cc: Weili Qian <qianweili at huawei.com>
Cc: Zaibo Xu <xuzaibo at huawei.com>
Cc: Longfang Liu <liulongfang at huawei.com>
Cc: Kai Ye <yekai13 at huawei.com>
Cc: Wei Zhang <zhangwei375 at huawei.com>
Signed-off-by: Will Deacon <will at kernel.org>
---
 drivers/crypto/hisilicon/sec2/sec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index 752565200c16..03523cfbb28e 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -484,7 +484,7 @@ static void sec_set_endian(struct hisi_qm *qm)
 	if (!IS_ENABLED(CONFIG_64BIT))
 		reg |= BIT(1);
 
-	if (!IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
+	if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
 		reg |= BIT(0);
 
 	writel_relaxed(reg, qm->io_base + SEC_CONTROL_REG);
-- 
2.55.0.1082.g2b9226bbc0-goog




More information about the linux-arm-kernel mailing list