lkml.org 
[lkml]   [2018]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mtd: change len type from signed to unsigned type
On Thu, 15 Nov 2018 00:07:10 -0500
Huijin Park <huijin.park@samsung.com> wrote:

> From: "huijin.park" <huijin.park@samsung.com>
>
> This patch casts the "len" parameter to an unsigned int.

Hm, that's not really what this patch actually. Actually it avoids the
cast from an int to an unsigned int.

> The callers of erase_write() pass the "len" parameter as unsigned int.

That's the important part here. Callers of erase_write() always pass an
unsigned int, so what you're trying to do here is avoid a cast to an
int.

>
> Signed-off-by: huijin.park <huijin.park@samsung.com>
> ---

You should have a changelog here.

> drivers/mtd/mtdblock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
> index a5b1933..b2d5ed1 100644
> --- a/drivers/mtd/mtdblock.c
> +++ b/drivers/mtd/mtdblock.c
> @@ -56,7 +56,7 @@ struct mtdblk_dev {
> */
>
> static int erase_write (struct mtd_info *mtd, unsigned long pos,
> - int len, const char *buf)
> + unsigned int len, const char *buf)
> {
> struct erase_info erase;
> size_t retlen;

\
 
 \ /
  Last update: 2018-11-15 14:34    [W:0.075 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site