Commit e233fe1a authored by Michal Orzel's avatar Michal Orzel Committed by Jens Axboe

block/partitions/ldm: Remove redundant assignments

Get rid of the following redundant assignments:
- to a variable r_cols from function ldm_parse_cmp3
- to variables r_id1 and r_id2 from functions ldm_parse_dgr3 and ldm_parse_dgr4
- to a variable r_index from function ldm_parse_prt3
that end up in values not being read until the end of function.

Reported by clang-tidy [deadcode.DeadStores]
Signed-off-by: default avatarMichal Orzel <michalorzel.eng@gmail.com>
Link: https://lore.kernel.org/r/20220423113811.13335-5-michalorzel.eng@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 87420fa9
...@@ -736,7 +736,6 @@ static bool ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb) ...@@ -736,7 +736,6 @@ static bool ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb)
len = r_cols; len = r_cols;
} else { } else {
r_stripe = 0; r_stripe = 0;
r_cols = 0;
len = r_parent; len = r_parent;
} }
if (len < 0) if (len < 0)
...@@ -783,11 +782,8 @@ static int ldm_parse_dgr3 (const u8 *buffer, int buflen, struct vblk *vb) ...@@ -783,11 +782,8 @@ static int ldm_parse_dgr3 (const u8 *buffer, int buflen, struct vblk *vb)
r_id1 = ldm_relative (buffer, buflen, 0x24, r_diskid); r_id1 = ldm_relative (buffer, buflen, 0x24, r_diskid);
r_id2 = ldm_relative (buffer, buflen, 0x24, r_id1); r_id2 = ldm_relative (buffer, buflen, 0x24, r_id1);
len = r_id2; len = r_id2;
} else { } else
r_id1 = 0;
r_id2 = 0;
len = r_diskid; len = r_diskid;
}
if (len < 0) if (len < 0)
return false; return false;
...@@ -826,11 +822,8 @@ static bool ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb) ...@@ -826,11 +822,8 @@ static bool ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb)
r_id1 = ldm_relative (buffer, buflen, 0x44, r_name); r_id1 = ldm_relative (buffer, buflen, 0x44, r_name);
r_id2 = ldm_relative (buffer, buflen, 0x44, r_id1); r_id2 = ldm_relative (buffer, buflen, 0x44, r_id1);
len = r_id2; len = r_id2;
} else { } else
r_id1 = 0;
r_id2 = 0;
len = r_name; len = r_name;
}
if (len < 0) if (len < 0)
return false; return false;
...@@ -963,10 +956,8 @@ static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb) ...@@ -963,10 +956,8 @@ static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb)
return false; return false;
} }
len = r_index; len = r_index;
} else { } else
r_index = 0;
len = r_diskid; len = r_diskid;
}
if (len < 0) { if (len < 0) {
ldm_error("len %d < 0", len); ldm_error("len %d < 0", len);
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment