mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
UBI: simplify image sequence test
The test: if (!a && b) a = b; can be symplified in: if (!a) a = b; And there's no need to test if ubi->image_seq is not null, because if it is, it is set to image_seq. So, we just test if image_seq is not null. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
This commit is contained in:
parent
c22301ad4f
commit
55b80c409a
1 changed files with 2 additions and 3 deletions
|
@ -900,10 +900,9 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
|
|||
* number.
|
||||
*/
|
||||
image_seq = be32_to_cpu(ech->image_seq);
|
||||
if (!ubi->image_seq && image_seq)
|
||||
if (!ubi->image_seq)
|
||||
ubi->image_seq = image_seq;
|
||||
if (ubi->image_seq && image_seq &&
|
||||
ubi->image_seq != image_seq) {
|
||||
if (image_seq && ubi->image_seq != image_seq) {
|
||||
ubi_err("bad image sequence number %d in PEB %d, expected %d",
|
||||
image_seq, pnum, ubi->image_seq);
|
||||
ubi_dump_ec_hdr(ech);
|
||||
|
|
Loading…
Reference in a new issue