]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm/super1: fix coverity issue DEADCODE
authorXiao Ni <xni@redhat.com>
Fri, 26 Jul 2024 07:14:14 +0000 (15:14 +0800)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Mon, 5 Aug 2024 09:14:04 +0000 (11:14 +0200)
optimal_space is at most 2046. So space can't be larger than UINT16_MAX.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
super1.c

index 4e4c7bfd15ae64521b8db74918c29e1d79a5fb19..24bc10269dbf5dd4cdced73f973ef77e67eb97ef 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1466,8 +1466,6 @@ static int update_super1(struct supertype *st, struct mdinfo *info,
                                                __le32_to_cpu(sb->chunksize));
                        if (space > optimal_space)
                                space = optimal_space;
-                       if (space > UINT16_MAX)
-                               space = UINT16_MAX;
                }
 
                sb->ppl.offset = __cpu_to_le16(offset);