diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-05-13 12:41:42 +0800 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-05-16 10:01:51 +0800 |
commit | ddec8e9e90cea8e8430b04a01adce7fb196d95c6 (patch) | |
tree | d4bd53dc6fcdac977b88d676520f7498cdc9a987 /fs/f2fs | |
parent | 8bff946c4199fd79f43dbff93c030b58b01bed65 (diff) | |
download | linux-ddec8e9e90cea8e8430b04a01adce7fb196d95c6.tar.bz2 |
platform/chrome: cros_ec_spi: drop unneeded BUG_ON()
In the context, the following conditions are always false:
- `todo` < 0
Suppose that EC_SPI_FRAME_START is found at the last byte of transfer.
In the case, `ptr` == `end` - 1. As a result, `todo` must be 0.
- `todo` > `ec_dev->din_size`
Suppose that there is no preamble bytes. EC_SPI_FRAME_START is found at
the first byte of transfer.
In the case, `end` == `ptr` + EC_MSG_PREAMBLE_COUNT.
As a result, `todo` == EC_MSG_PREAMBLE_COUNT - 1.
However, it already checked `ec_dev->din_size` < EC_MSG_PREAMBLE_COUNT at
the beginning of function.
Drop the unneeded BUG_ON().
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220513044143.1045728-7-tzungbi@kernel.org
Diffstat (limited to 'fs/f2fs')
0 files changed, 0 insertions, 0 deletions