summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2013-09-28 15:55:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-01-07 11:03:24 +0100
commitdee73c54b050a772e9e5814c9da9905fc9b8e4fa (patch)
tree82eb1bba8b8326d1363294826fac173ba8851c33 /drivers
parent2bae366563e7365afbd836cb7989188359255419 (diff)
downloadbarebox-dee73c54b050a772e9e5814c9da9905fc9b8e4fa.tar.gz
barebox-dee73c54b050a772e9e5814c9da9905fc9b8e4fa.tar.xz
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: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/attach.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 8c5c8c3765..cb2d041b5e 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -893,10 +893,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);