dm vdo slab-depot: delete unnecessary check

Message ID 16ffd614-48a9-42b8-961d-2dc8a69c48d6@moroto.mountain
State New
Headers
Series dm vdo slab-depot: delete unnecessary check |

Commit Message

Dan Carpenter Feb. 9, 2024, 1:06 p.m. UTC
  This is a duplicate check so it can't be true.  Delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/md/dm-vdo/slab-depot.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Markus Elfring Feb. 11, 2024, 6:29 p.m. UTC | #1
> This is a duplicate check

Was this implementation detail detected with any known source code analysis tool?


> so it can't be true. …

I suggest to reconsider this information a bit more.
Would you usually expect the outcome “result == VDO_SUCCESS” from a call
of the function “uds_allocate”?

Regards,
Markus
  
Mike Snitzer Feb. 11, 2024, 6:55 p.m. UTC | #2
On Fri, Feb 09 2024 at  8:06P -0500,
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> This is a duplicate check so it can't be true.  Delete it.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/md/dm-vdo/slab-depot.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/md/dm-vdo/slab-depot.c b/drivers/md/dm-vdo/slab-depot.c
> index 42126bd60242..2f4a2ae5e082 100644
> --- a/drivers/md/dm-vdo/slab-depot.c
> +++ b/drivers/md/dm-vdo/slab-depot.c
> @@ -4100,9 +4100,6 @@ static int allocate_components(struct slab_depot *depot,
>  		};
>  	}
>  
> -	if (result != VDO_SUCCESS)
> -		return result;
> -
>  	slab_count = vdo_compute_slab_count(depot->first_block, depot->last_block,
>  					    depot->slab_size_shift);
>  	if (thread_config->physical_zone_count > slab_count) {
> -- 
> 2.43.0
> 
> 

Looks good, I've picked this up.

Thanks,
Mike
  

Patch

diff --git a/drivers/md/dm-vdo/slab-depot.c b/drivers/md/dm-vdo/slab-depot.c
index 42126bd60242..2f4a2ae5e082 100644
--- a/drivers/md/dm-vdo/slab-depot.c
+++ b/drivers/md/dm-vdo/slab-depot.c
@@ -4100,9 +4100,6 @@  static int allocate_components(struct slab_depot *depot,
 		};
 	}
 
-	if (result != VDO_SUCCESS)
-		return result;
-
 	slab_count = vdo_compute_slab_count(depot->first_block, depot->last_block,
 					    depot->slab_size_shift);
 	if (thread_config->physical_zone_count > slab_count) {