[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211207121801.GD1956@kadam>
Date: Tue, 7 Dec 2021 15:18:01 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] intel_th: remove redundant re-assignment of pointer
hubdrv
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@...il.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
Powered by blists - more mailing lists