* [PATCH 1/1] mm: remove an unnecessary goto jump
@ 2020-05-05 11:58 Zhen Lei
2020-05-08 8:06 ` David Hildenbrand
0 siblings, 1 reply; 4+ messages in thread
From: Zhen Lei @ 2020-05-05 11:58 UTC (permalink / raw)
To: Andrew Morton, linux-mm, linux-kernel; +Cc: Zhen Lei
This "goto" doesn't reduce any code, but bother the readers.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
mm/page_io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/page_io.c b/mm/page_io.c
index 76965be1d40e..b1d4f4558e6b 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -235,10 +235,10 @@ int generic_swapfile_activate(struct swap_info_struct *sis,
sis->highest_bit = page_no - 1;
out:
return ret;
+
bad_bmap:
pr_err("swapon: swapfile has holes\n");
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
/*
--
2.26.0.106.g9fadedd
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: remove an unnecessary goto jump
2020-05-05 11:58 [PATCH 1/1] mm: remove an unnecessary goto jump Zhen Lei
@ 2020-05-08 8:06 ` David Hildenbrand
2020-05-08 8:47 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2020-05-08 8:06 UTC (permalink / raw)
To: Zhen Lei, Andrew Morton, linux-mm, linux-kernel
On 05.05.20 13:58, Zhen Lei wrote:
> This "goto" doesn't reduce any code, but bother the readers.
"mm/page_io.c: mm: remove an unnecessary goto in generic_swapfile_activate"
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
> mm/page_io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_io.c b/mm/page_io.c
> index 76965be1d40e..b1d4f4558e6b 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -235,10 +235,10 @@ int generic_swapfile_activate(struct swap_info_struct *sis,
> sis->highest_bit = page_no - 1;
> out:
> return ret;
> +
nit: I'd just not mess with newlines here.
> bad_bmap:
> pr_err("swapon: swapfile has holes\n");
> - ret = -EINVAL;
> - goto out;
> + return -EINVAL;
> }
>
> /*
>
apart from that
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: remove an unnecessary goto jump
2020-05-08 8:06 ` David Hildenbrand
@ 2020-05-08 8:47 ` Leizhen (ThunderTown)
2020-05-08 8:49 ` David Hildenbrand
0 siblings, 1 reply; 4+ messages in thread
From: Leizhen (ThunderTown) @ 2020-05-08 8:47 UTC (permalink / raw)
To: David Hildenbrand, Andrew Morton, linux-mm, linux-kernel
On 2020/5/8 16:06, David Hildenbrand wrote:
> On 05.05.20 13:58, Zhen Lei wrote:
>> This "goto" doesn't reduce any code, but bother the readers.
>
> "mm/page_io.c: mm: remove an unnecessary goto in generic_swapfile_activate"
Do you mean change the subject? So is it:
"mm/page_io.c: remove an unnecessary goto in generic_swapfile_activate()" ?
>
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>> mm/page_io.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/mm/page_io.c b/mm/page_io.c
>> index 76965be1d40e..b1d4f4558e6b 100644
>> --- a/mm/page_io.c
>> +++ b/mm/page_io.c
>> @@ -235,10 +235,10 @@ int generic_swapfile_activate(struct swap_info_struct *sis,
>> sis->highest_bit = page_no - 1;
>> out:
>> return ret;
>> +
>
> nit: I'd just not mess with newlines here.
OK, I will drop it.
>
>> bad_bmap:
>> pr_err("swapon: swapfile has holes\n");
>> - ret = -EINVAL;
>> - goto out;
>> + return -EINVAL;
>> }
>>
>> /*
>>
>
> apart from that
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mm: remove an unnecessary goto jump
2020-05-08 8:47 ` Leizhen (ThunderTown)
@ 2020-05-08 8:49 ` David Hildenbrand
0 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2020-05-08 8:49 UTC (permalink / raw)
To: Leizhen (ThunderTown), Andrew Morton, linux-mm, linux-kernel
On 08.05.20 10:47, Leizhen (ThunderTown) wrote:
>
>
> On 2020/5/8 16:06, David Hildenbrand wrote:
>> On 05.05.20 13:58, Zhen Lei wrote:
>>> This "goto" doesn't reduce any code, but bother the readers.
>>
>> "mm/page_io.c: mm: remove an unnecessary goto in generic_swapfile_activate"
>
> Do you mean change the subject? So is it:
> "mm/page_io.c: remove an unnecessary goto in generic_swapfile_activate()" ?
>
Yeah, would have been my suggestion.
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-08 8:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 11:58 [PATCH 1/1] mm: remove an unnecessary goto jump Zhen Lei
2020-05-08 8:06 ` David Hildenbrand
2020-05-08 8:47 ` Leizhen (ThunderTown)
2020-05-08 8:49 ` David Hildenbrand
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.