From: Dan Carpenter <dan.carpenter@linaro.org>
To: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Umang Jain <umang.jain@ideasonboard.com>,
Stefan Wahren <wahrenst@gmx.net>,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] staging: vc04_services: Delete unnecessary NULL check
Date: Wed, 24 Apr 2024 14:43:28 +0300 [thread overview]
Message-ID: <526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain> (raw)
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@linaro.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
next reply other threads:[~2024-04-24 11:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 11:43 Dan Carpenter [this message]
2024-04-24 15:17 ` [PATCH] staging: vc04_services: Delete unnecessary NULL check Stefan Wahren
2024-04-25 6:37 ` Umang Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=umang.jain@ideasonboard.com \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).