2018-11-29 04:22:06

by Huijin Park

[permalink] [raw]
Subject: [PATCH v3] mtd: change len type from signed to unsigned type

From: "huijin.park" <[email protected]>

Callers of erase_write() always pass an unsigned int.
So this patch avoids a cast to an int.

Signed-off-by: huijin.park <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>

---

Changes since v1:
* Made commit message more clear.
Changes since v2:
* Made commit message more clear.
---
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;
--
1.7.9.5



2018-12-03 07:52:46

by Boris Brezillon

[permalink] [raw]
Subject: Re: [v3] mtd: change len type from signed to unsigned type

On Thu, 2018-11-29 at 04:19:51 UTC, Huijin Park wrote:
> From: "huijin.park" <[email protected]>
>
> Callers of erase_write() always pass an unsigned int.
> So this patch avoids a cast to an int.
>
> Signed-off-by: huijin.park <[email protected]>
> Reviewed-by: Miquel Raynal <[email protected]>

Applied to http://git.infradead.org/linux-mtd.git mtd/next, thanks.

Boris