Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44e2aa2b authored by Cyril Bur's avatar Cyril Bur Committed by Michael Ellerman
Browse files

mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()



BUG_ON() should be reserved in situations where we can not longer
guarantee the integrity of the system. In the case where
powernv_flash_async_op() receives an impossible op, we can still
guarantee the integrity of the system.

Signed-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 71e24d77
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -78,7 +78,9 @@ static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
		rc = opal_flash_erase(info->id, offset, len, token);
		rc = opal_flash_erase(info->id, offset, len, token);
		break;
		break;
	default:
	default:
		BUG_ON(1);
		WARN_ON_ONCE(1);
		opal_async_release_token(token);
		return -EIO;
	}
	}


	if (rc != OPAL_ASYNC_COMPLETION) {
	if (rc != OPAL_ASYNC_COMPLETION) {