linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] bus: fsl-mc: simplify DPMCP version check
@ 2022-03-18 10:03 Yue Zou
  0 siblings, 0 replies; only message in thread
From: Yue Zou @ 2022-03-18 10:03 UTC (permalink / raw)
  To: stuyoder, laurentiu.tudor; +Cc: linux-kernel

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@huawei.com>
Signed-off-by: Yue Zou <zouyue3@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-18  9:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 10:03 [PATCH -next] bus: fsl-mc: simplify DPMCP version check Yue Zou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).