From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] intel_th: remove redundant re-assignment of pointer hubdrv
Date: Tue, 7 Dec 2021 15:18:01 +0300 [thread overview]
Message-ID: <20211207121801.GD1956@kadam> (raw)
In-Reply-To: <20211204233934.80070-1-colin.i.king@gmail.com>
On Sat, Dec 04, 2021 at 11:39:34PM +0000, Colin Ian King wrote:
> The pointer hubdrv is being re-assigned the same value as it was
> initialized with only a few lines earlier. The re-assignment is
> redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/hwtracing/intel_th/core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
> index 7e753a75d23b..5de47b89a9e1 100644
> --- a/drivers/hwtracing/intel_th/core.c
> +++ b/drivers/hwtracing/intel_th/core.c
> @@ -1048,7 +1048,6 @@ int intel_th_set_output(struct intel_th_device *thdev,
> * hub is instantiated together with the source device that
> * calls here, so guaranteed to be present.
> */
> - hubdrv = to_intel_th_driver(hub->dev.driver);
> if (!hubdrv || !try_module_get(hubdrv->driver.owner))
^^^^^^^
This NULL check doesn't make sense. "hubdrv" is "hub - some_offset"
where "some_offset" is zero. We've already dereferenced "hub" so
"hubdrv" can't be NULL.
regards,
dan carpenter
prev parent reply other threads:[~2021-12-07 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 23:39 [PATCH] intel_th: remove redundant re-assignment of pointer hubdrv Colin Ian King
2021-12-07 12:18 ` Dan Carpenter [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=20211207121801.GD1956@kadam \
--to=dan.carpenter@oracle.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.