[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain>
Date: Wed, 24 Apr 2024 14:43:28 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Florian Fainelli <florian.fainelli@...adcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Umang Jain <umang.jain@...asonboard.com>,
Stefan Wahren <wahrenst@....net>,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] staging: vc04_services: Delete unnecessary NULL check
The "state" pointer points to an offset in the middle of the "mgmt"
struct so it can't possibly be NULL. And also we dereferenced it on the
line before. So this NULL check is pointless. Delete it.
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
index 9fe35864936c..3c63347d2d08 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c
@@ -1170,11 +1170,6 @@ static int vchiq_open(struct inode *inode, struct file *file)
dev_dbg(state->dev, "arm: vchiq open\n");
- if (!state) {
- dev_err(state->dev, "arm: vchiq has no connection to VideoCore\n");
- return -ENOTCONN;
- }
-
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
if (!instance)
return -ENOMEM;
--
2.43.0
Powered by blists - more mailing lists