mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arch/x86/mm/mpx.c: Clean up code by removing unnecessary assignment
@ 2020-01-19 13:09 mateusznosek0
  2020-01-22 13:10 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: mateusznosek0 @ 2020-01-19 13:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mateusz Nosek, dave.hansen, luto, peterz, tglx, mingo, bp, hpa, x86

From: Mateusz Nosek <mateusznosek0@gmail.com>

Previously variable 'ret' is assigned just before return instruction.
The variable is local so this assignment is useless
and therefore can be removed.

Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
---
 arch/x86/mm/mpx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 895fb7a9294d..30ab444301f5 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -827,10 +827,8 @@ static int try_unmap_single_bt(struct mm_struct *mm,
 	/*
 	 * No bounds table there, so nothing to unmap.
 	 */
-	if (ret == -ENOENT) {
-		ret = 0;
+	if (ret == -ENOENT)
 		return 0;
-	}
 	if (ret)
 		return ret;
 	/*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] arch/x86/mm/mpx.c: Clean up code by removing unnecessary assignment
  2020-01-19 13:09 [PATCH] arch/x86/mm/mpx.c: Clean up code by removing unnecessary assignment mateusznosek0
@ 2020-01-22 13:10 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2020-01-22 13:10 UTC (permalink / raw)
  To: mateusznosek0
  Cc: linux-kernel, dave.hansen, luto, peterz, tglx, mingo, hpa, x86

On Sun, Jan 19, 2020 at 02:09:33PM +0100, mateusznosek0@gmail.com wrote:
> From: Mateusz Nosek <mateusznosek0@gmail.com>
> 
> Previously variable 'ret' is assigned just before return instruction.
> The variable is local so this assignment is useless
> and therefore can be removed.
> 
> Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
> ---
>  arch/x86/mm/mpx.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
> index 895fb7a9294d..30ab444301f5 100644
> --- a/arch/x86/mm/mpx.c
> +++ b/arch/x86/mm/mpx.c
> @@ -827,10 +827,8 @@ static int try_unmap_single_bt(struct mm_struct *mm,
>  	/*
>  	 * No bounds table there, so nothing to unmap.
>  	 */
> -	if (ret == -ENOENT) {
> -		ret = 0;
> +	if (ret == -ENOENT)
>  		return 0;
> -	}
>  	if (ret)
>  		return ret;
>  	/*
> -- 

That code is going away so you can ignore it completely.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-22 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 13:09 [PATCH] arch/x86/mm/mpx.c: Clean up code by removing unnecessary assignment mateusznosek0
2020-01-22 13:10 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®