[PATCH -next] bus: fsl-mc: simplify DPMCP version check

From: Yue Zou
Date: Fri Mar 18 2022 - 05:44:41 EST


The minimum supported DPMCP version is 3.0, and the second
half of version check is always false due to the limited range
of minor version's unsigned data type. Just remove the second
check to simplify the condition.

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Yue Zou <zouyue3@xxxxxxxxxx>
---
drivers/bus/fsl-mc/mc-io.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/fsl-mc/mc-io.c b/drivers/bus/fsl-mc/mc-io.c
index 95b10a6cf307..f6a8b3b9ba3c 100644
--- a/drivers/bus/fsl-mc/mc-io.c
+++ b/drivers/bus/fsl-mc/mc-io.c
@@ -193,9 +193,7 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
error = -EINVAL;
dpmcp_dev = resource->data;

- if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR ||
- (dpmcp_dev->obj_desc.ver_major == DPMCP_MIN_VER_MAJOR &&
- dpmcp_dev->obj_desc.ver_minor < DPMCP_MIN_VER_MINOR)) {
+ if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR) {
dev_err(&dpmcp_dev->dev,
"ERROR: Version %d.%d of DPMCP not supported.\n",
dpmcp_dev->obj_desc.ver_major,
--
2.18.0.huawei.25