diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-10-12 12:42:33 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-11-23 15:34:43 +0300 |
commit | 0cb8c9482501c46854ddb3d43b1bc05d771b9624 (patch) | |
tree | 8e6140abd52bc5c327ca4098f477cfc9a2e824d7 /drivers/media | |
parent | ce122258ed8678d0a32b825ba3d7dd3cc16052df (diff) | |
download | linux-0cb8c9482501c46854ddb3d43b1bc05d771b9624.tar.xz |
media: qcom: camss: clean up a check
Imagine that "->vfe_num" is zero, then the subtraction will underflow to
UINT_MAX. Plus it's just cleaner to use >= instead.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/qcom/camss/camss-ispif.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c index be9d2f0a10c1..ddfe94377ee5 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -270,7 +270,7 @@ static int ispif_vfe_reset(struct ispif_device *ispif, u8 vfe_id) unsigned long time; u32 val; - if (vfe_id > camss->res->vfe_num - 1) { + if (vfe_id >= camss->res->vfe_num) { dev_err(camss->dev, "Error: asked reset for invalid VFE%d\n", vfe_id); return -ENOENT; |