diff --git a/meta-ohos-core/recipes-extended/hdparm/hdparm_%.bbappend b/meta-ohos-core/recipes-extended/hdparm/hdparm_%.bbappend
new file mode 100644
index 0000000000000000000000000000000000000000..b65112b0e36571f52d3782fa6a103dbd7cb024eb
--- /dev/null
+++ b/meta-ohos-core/recipes-extended/hdparm/hdparm_%.bbappend
@@ -0,0 +1,13 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# hdparm's sysfs I/O functions trigger warnings with
+# -Wformat-nonliteral, but the format strings are checked
+# by other means.
+# This has been verified to be harmless in 9.58.
+#
+# Removing -Werror=format-nonliteral here allows us to use
+# -Werror=format-nonliteral globally in OPTIMIZE_FOR=security mode
+# while keeping hdparm building.
+
+TARGET_CFLAGS_remove = "-Werror=format-nonliteral"