提交 44e2aa2b 编写于 作者: C Cyril Bur 提交者: Michael Ellerman

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: NCyril Bur <cyrilbur@gmail.com>
Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 71e24d77
......@@ -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);
break;
default:
BUG_ON(1);
WARN_ON_ONCE(1);
opal_async_release_token(token);
return -EIO;
}
if (rc != OPAL_ASYNC_COMPLETION) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册