[PATCH] fs: ubifs: remove always-false check

Sascha Hauer sha at pengutronix.de
Tue Sep 13 01:37:51 PDT 2022


On Thu, Aug 11, 2022 at 03:58:04PM +0200, Ahmad Fatoum wrote:
> GCC correctly warns that two bit wide compr_type can't
> exceed or be equal to UBIFS_COMPR_TYPES_CNT (== 4).
> 
> Remove the check. The check is there in the kernel as well,
> but the warning is disabled there.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
>  fs/ubifs/super.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index b48e21fae636..6a0074bd1a5c 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -86,11 +86,6 @@ static int validate_inode(struct ubifs_info *c, const struct inode *inode)
>  		return 1;
>  	}
>  
> -	if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) {
> -		ubifs_err(c, "unknown compression type %d", ui->compr_type);
> -		return 2;
> -	}
> -

Although Richard decided for the Kernel to keep the check I decided to
take this patch for barebox. The warning is annoying and doesn't tell us
anything. Once this is solved in the Kernel we'll get the solution with
the next UBIFS sync.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list