diff mbox series

mm/filemap: Remove redundant variable's assignment

Message ID 08dc7237b44b9455ab095b44dc6969a1607b08db.1611544316.git.baolin.wang@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series mm/filemap: Remove redundant variable's assignment | expand

Commit Message

Baolin Wang Jan. 25, 2021, 3:20 a.m. UTC
We've already set the variable 'i' 's initial value before using it,
thus remove redundant previous assignment of variable 'i'.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 mm/filemap.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Miaohe Lin Jan. 25, 2021, 6:27 a.m. UTC | #1
On 2021/1/25 11:20, Baolin Wang wrote:
> We've already set the variable 'i' 's initial value before using it,
> thus remove redundant previous assignment of variable 'i'.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>  mm/filemap.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index e4906f5..07b02f3 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2472,7 +2472,6 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb,
>  		if ((iocb->ki_flags & IOCB_WAITQ) && written)
>  			iocb->ki_flags |= IOCB_NOWAIT;
>  
> -		i = 0;
>  		pg_nr = generic_file_buffered_read_get_pages(iocb, iter,
>  							     pages, nr_pages);
>  		if (pg_nr < 0) {
> 

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Andrew Morton Jan. 25, 2021, 11:22 p.m. UTC | #2
On Mon, 25 Jan 2021 11:20:02 +0800 Baolin Wang <baolin.wang@linux.alibaba.com> wrote:

> We've already set the variable 'i' 's initial value before using it,
> thus remove redundant previous assignment of variable 'i'.
> 
> ...
>
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2472,7 +2472,6 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb,
>  		if ((iocb->ki_flags & IOCB_WAITQ) && written)
>  			iocb->ki_flags |= IOCB_NOWAIT;
>  
> -		i = 0;
>  		pg_nr = generic_file_buffered_read_get_pages(iocb, iter,
>  							     pages, nr_pages);
>  		if (pg_nr < 0) {

Matthew's patch series "Refactor generic_file_buffered_read "
(https://lkml.kernel.org/r/20210122160140.223228-1-willy@infradead.org)
changes all this code - I dont think the patch is relevant after that,
so I'll skip it.
Baolin Wang Jan. 26, 2021, 2:03 a.m. UTC | #3
在 2021/1/26 7:22, Andrew Morton 写道:
> On Mon, 25 Jan 2021 11:20:02 +0800 Baolin Wang <baolin.wang@linux.alibaba.com> wrote:
> 
>> We've already set the variable 'i' 's initial value before using it,
>> thus remove redundant previous assignment of variable 'i'.
>>
>> ...
>>
>> --- a/mm/filemap.c
>> +++ b/mm/filemap.c
>> @@ -2472,7 +2472,6 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb,
>>   		if ((iocb->ki_flags & IOCB_WAITQ) && written)
>>   			iocb->ki_flags |= IOCB_NOWAIT;
>>   
>> -		i = 0;
>>   		pg_nr = generic_file_buffered_read_get_pages(iocb, iter,
>>   							     pages, nr_pages);
>>   		if (pg_nr < 0) {
> 
> Matthew's patch series "Refactor generic_file_buffered_read "
> (https://lkml.kernel.org/r/20210122160140.223228-1-willy@infradead.org)
> changes all this code - I dont think the patch is relevant after that,
> so I'll skip it.

Ah, right. Thanks for letting me know.
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index e4906f5..07b02f3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2472,7 +2472,6 @@  ssize_t generic_file_buffered_read(struct kiocb *iocb,
 		if ((iocb->ki_flags & IOCB_WAITQ) && written)
 			iocb->ki_flags |= IOCB_NOWAIT;
 
-		i = 0;
 		pg_nr = generic_file_buffered_read_get_pages(iocb, iter,
 							     pages, nr_pages);
 		if (pg_nr < 0) {