diff --git a/src/ipa/libipa/matrix.cpp b/src/ipa/libipa/matrix.cpp
index 7f000382d33b..8346f0d34160 100644
--- a/src/ipa/libipa/matrix.cpp
+++ b/src/ipa/libipa/matrix.cpp
@@ -122,8 +122,6 @@ namespace ipa {
  * \return Matrix sum of matrices \a m1 and \a m2
  */
 
-} /* namespace ipa */
-
 #ifndef __DOXYGEN__
 /*
  * The YAML data shall be a list of numerical values. Its size shall be equal
@@ -146,4 +144,6 @@ bool matrixValidateYaml(const YamlObject &obj, unsigned int size)
 }
 #endif /* __DOXYGEN__ */
 
+} /* namespace ipa */
+
 } /* namespace libcamera */
