From: Colin Ian King <colin.i.king@gmail.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH][V2] intel_th: remove redundant re-assignment of pointer hubdrv
Date: Tue, 7 Dec 2021 23:07:09 +0000 [thread overview]
Message-ID: <20211207230709.121444-1-colin.i.king@gmail.com> (raw)
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.
As Dan Carpenter pointed out, the pointer hubdrv is hub - some_offset
and in this case some_offset is zero. Since hub has already been
dereferenced hubdrv can't be NULL so the NULL check is redundant
and can also be removed.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
V2: Remove null check, kudos to Dan Carpenter for spotting this.
---
drivers/hwtracing/intel_th/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 7e753a75d23b..bf4ee2a31006 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -1048,8 +1048,7 @@ 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))
+ if (!try_module_get(hubdrv->driver.owner))
return -EINVAL;
if (!hubdrv->set_output) {
--
2.33.1
next reply other threads:[~2021-12-07 23:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 23:07 Colin Ian King [this message]
2021-12-08 10:02 ` [PATCH][V2] intel_th: remove redundant re-assignment of pointer hubdrv Dan Carpenter
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=20211207230709.121444-1-colin.i.king@gmail.com \
--to=colin.i.king@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dan.carpenter@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox