2022-09-23 17:12:17

by Christophe JAILLET

[permalink] [raw]
Subject: Re: [PATCH linux-next] memstick/ms_block: fix the spelling mistakes


Le 23/09/2022 à 10:56, [email protected] a écrit :
> From: ye xingchen <[email protected]>
>
> fix spelling mistake "sucessfuly_written" -> "successfully_written"
> "sucessfuly_read" -> "successfully_read"
>
> Signed-off-by: ye xingchen <[email protected]>
> ---
> drivers/memstick/core/ms_block.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
> index ba8414519515..c6b92a777cc8 100644
> --- a/drivers/memstick/core/ms_block.c
> +++ b/drivers/memstick/core/ms_block.c
> @@ -1809,11 +1809,11 @@ static int msb_init_card(struct memstick_dev *card)
> }
>
> static int msb_do_write_request(struct msb_data *msb, int lba,
> - int page, struct scatterlist *sg, size_t len, int *sucessfuly_written)
> + int page, struct scatterlist *sg, size_t len, int *successfully_written)

Hi,

not related to this patch itself, but 'len' is a size_t here and an int
below.
And these 'len' parameters both come from blk_rq_bytes() which returns
an "unsigned int"

I guess that if the type was used consistently, it would be better.
(My own preference goes to size_t)

> {
> int error = 0;
> off_t offset = 0;
> - *sucessfuly_written = 0;
> + *successfully_written = 0;
>
> while (offset < len) {
> if (page == 0 && len - offset >= msb->block_size) {
> @@ -1827,7 +1827,7 @@ static int msb_do_write_request(struct msb_data *msb, int lba,
> return error;
>
> offset += msb->block_size;
> - *sucessfuly_written += msb->block_size;
> + *successfully_written += msb->block_size;
> lba++;
> continue;
> }
> @@ -1837,7 +1837,7 @@ static int msb_do_write_request(struct msb_data *msb, int lba,
> return error;
>
> offset += msb->page_size;
> - *sucessfuly_written += msb->page_size;
> + *successfully_written += msb->page_size;
>
> page++;
> if (page == msb->pages_in_block) {
> @@ -1849,11 +1849,11 @@ static int msb_do_write_request(struct msb_data *msb, int lba,
> }
>
> static int msb_do_read_request(struct msb_data *msb, int lba,
> - int page, struct scatterlist *sg, int len, int *sucessfuly_read)
> + int page, struct scatterlist *sg, int len, int *successfully_read)

Here.

> {
> int error = 0;
> int offset = 0;
> - *sucessfuly_read = 0;
> + *successfully_read = 0;
>
> while (offset < len) {
>
> @@ -1862,7 +1862,7 @@ static int msb_do_read_request(struct msb_data *msb, int lba,
> return error;
>
> offset += msb->page_size;
> - *sucessfuly_read += msb->page_size;
> + *successfully_read += msb->page_size;
>
> page++;
> if (page == msb->pages_in_block) {