Re: [PATCH v2] mtd:ubi: Remove useless code in bytes_str_to_int

2020-11-03 Thread kechengsong
On Tue, Nov 3, 2020 at 1:00 PM Chengsong Ke  wrote:
>
> From: Chengsong Ke 
>
> As a local variable, "endp" is neither refered nor returned after this 
> line "endp += 2", it looks like a useless code, suggest to remove it.
>
> Signed-off-by: Chengsong Ke 
> ---
>  drivers/mtd/ubi/build.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 
> e85b04e9716b..46a6dd75e533 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1351,8 +1351,6 @@ static int bytes_str_to_int(const char *str)
> fallthrough;
> case 'K':
> result *= 1024;
> -   if (endp[1] == 'i' && endp[2] == 'B')
> -   endp += 2;

> Makes sense. But why did you send a v2?

> --
> Thanks,
> //richard

I just send the v1 with the wrong module name 'ubifs'. 
[PATCH] ubifs: Remove useless code in bytes_str_to_int
 :-) 
Thanks, 
//Chengsong Ke


Re: [PATCH v2] ubifs: Fix the printing type of c->big_lpt

2020-11-01 Thread kechengsong
On Sat, Oct 31, 2020 at 9:56 AM Chengsong Ke  wrote:
>
> Ubifs uses %d to print c->big_lpt, but c->big_lpt is a variable of 
> type unsigned int and should be printed with %u.
>
> Well, it is:
> unsigned int big_lpt:1;
> So, either 0 or 1.
> 
> Does changing it to %u silence some static checker or is there some other 
> problem I don't see right now? :-)
> 
> Thanks,
> //Richard

This is just a coding style issue, I found in the ubifs code. :-)
Thanks,
//Chengsong Ke