[PATCH] dmaengine: idxd: Delete unnecessary NULL check

Dan Carpenter posted 1 patch 11 months, 2 weeks ago
drivers/dma/idxd/init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] dmaengine: idxd: Delete unnecessary NULL check
Posted by Dan Carpenter 11 months, 2 weeks ago
The "saved_evl" pointer is a offset into the middle of a non-NULL struct.
It can't be NULL and the check is slightly confusing.  Delete the check.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/dma/idxd/init.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index b946f78f85e1..fca1d2924999 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -912,8 +912,7 @@ static void idxd_device_config_restore(struct idxd_device *idxd,
 
 	idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
 
-	if (saved_evl)
-		idxd->evl->size = saved_evl->size;
+	idxd->evl->size = saved_evl->size;
 
 	for (i = 0; i < idxd->max_groups; i++) {
 		struct idxd_group *saved_group, *group;
-- 
2.45.2
Re: [PATCH] dmaengine: idxd: Delete unnecessary NULL check
Posted by Vinod Koul 10 months, 1 week ago
On Wed, 08 Jan 2025 12:13:20 +0300, Dan Carpenter wrote:
> The "saved_evl" pointer is a offset into the middle of a non-NULL struct.
> It can't be NULL and the check is slightly confusing.  Delete the check.
> 
> 

Applied, thanks!

[1/1] dmaengine: idxd: Delete unnecessary NULL check
      commit: 2c17e9ea0caa5555e31e154fa1b06260b816f5cc

Best regards,
-- 
~Vinod
Re: [PATCH] dmaengine: idxd: Delete unnecessary NULL check
Posted by Fenghua Yu 11 months ago

On 1/8/25 01:13, Dan Carpenter wrote:
> The "saved_evl" pointer is a offset into the middle of a non-NULL struct.
> It can't be NULL and the check is slightly confusing.  Delete the check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>

> ---
>   drivers/dma/idxd/init.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index b946f78f85e1..fca1d2924999 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -912,8 +912,7 @@ static void idxd_device_config_restore(struct idxd_device *idxd,
>   
>   	idxd->rdbuf_limit = idxd_saved->saved_idxd.rdbuf_limit;
>   
> -	if (saved_evl)
> -		idxd->evl->size = saved_evl->size;
> +	idxd->evl->size = saved_evl->size;
>   
>   	for (i = 0; i < idxd->max_groups; i++) {
>   		struct idxd_group *saved_group, *group;

Thanks.

-Fenghua