Re: [PATCH v3 2/2] mdadm: replace container level checking with inline
From: Jes Sorensen <hidden>
Date: 2022-08-24 16:03:25
On 8/18/22 20:55, Kinga Tanska wrote:
To unify all containers checks in code, is_container() function is added and propagated. Signed-off-by: Kinga Tanska <redacted> --- Assemble.c | 5 ++--- Create.c | 6 +++--- Grow.c | 6 +++--- Incremental.c | 4 ++-- mdadm.h | 14 ++++++++++++++ super-ddf.c | 6 +++--- super-intel.c | 4 ++-- super0.c | 2 +- super1.c | 2 +- sysfs.c | 2 +- 10 files changed, 32 insertions(+), 19 deletions(-)
This one fails to apply for me from patcheworks. That said, a minor nit below. Mind fixing this and posting an updated version? Thanks, Jes
quoted hunk ↗ jump to hunk
diff --git a/mdadm.h b/mdadm.h index c7268a71..72abfc50 100644 --- a/mdadm.h +++ b/mdadm.h@@ -1885,3 +1885,17 @@ enum r0layout { * This is true for native and DDF, IMSM allows 16. */ #define MD_NAME_MAX 32 + +/** + * is_container() - check if @level is &LEVEL_CONTAINER + * @level: level value + * + * return: + * 1 if level is equal to &LEVEL_CONTAINER, 0 otherwise. + */ +static inline int is_container(const int level) +{ + if (level == LEVEL_CONTAINER) + return 1; + return 0; +}\ No newline at end of file
Please add the lost newline