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: Cyril Bur <cyrilbur@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Cyril Bur 2017-11-03 13:41:37 +11:00 committed by Michael Ellerman
parent 71e24d7731
commit 44e2aa2b16
1 changed files with 3 additions and 1 deletions

View File

@ -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) {