Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
From: Umang Jain <umang.jain@ideasonboard.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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: Re: [PATCH] staging: vc04_services: Delete unnecessary NULL check
Date: Thu, 25 Apr 2024 12:07:47 +0530	[thread overview]
Message-ID: <9cd4919c-657e-4533-8f11-521d31e60123@ideasonboard.com> (raw)
In-Reply-To: <526ec2ff-6277-4d5d-b2d9-63b087a97c7c@moroto.mountain>

HI Dan,

Thank you for the patch

On 24/04/24 5:13 pm, Dan Carpenter wrote:
> 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>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   .../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;


      parent reply	other threads:[~2024-04-25  6:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 11:43 [PATCH] staging: vc04_services: Delete unnecessary NULL check Dan Carpenter
2024-04-24 15:17 ` Stefan Wahren
2024-04-25  6:37 ` Umang Jain [this message]

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=9cd4919c-657e-4533-8f11-521d31e60123@ideasonboard.com \
    --to=umang.jain@ideasonboard.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@linaro.org \
    --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=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).