mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-m68k@lists.linux-m68k.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	Michal Hocko <mhocko@suse.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] m68k: One function call less in cf_tlb_miss()
Date: Sat, 6 Jul 2019 09:56:56 +1000 (AEST)	[thread overview]
Message-ID: <alpine.LNX.2.21.1907060951060.67@nippy.intranet> (raw)
In-Reply-To: <c5713aa4-d290-0f7d-7de8-82bcdf74ee95@web.de>


On Fri, 5 Jul 2019, Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jul 2019 17:11:37 +0200
> 
> Avoid an extra function call 

Not really. You've avoided an extra statement.

> by using a ternary operator instead of a conditional statement for a 
> setting selection.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  arch/m68k/mm/mcfmmu.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
> index 6cb1e41d58d0..02fc0778028e 100644
> --- a/arch/m68k/mm/mcfmmu.c
> +++ b/arch/m68k/mm/mcfmmu.c
> @@ -146,12 +146,10 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
> 
>  	mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
>  		((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
> -
> -	if (dtlb)
> -		mmu_write(MMUOR, MMUOR_ACC | MMUOR_UAA);
> -	else
> -		mmu_write(MMUOR, MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA);
> -
> +	mmu_write(MMUOR,
> +		  dtlb
> +		  ? MMUOR_ACC | MMUOR_UAA
> +		  : MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA);

If you are trying to avoid redundancy, why not finish the job?

+     mmu_write(MMUOR, (dtlb ? 0 : MMUOR_ITLB) | MMUOR_ACC | MMUOR_UAA);

-- 

>  	local_irq_restore(flags);
>  	return 0;
>  }
> --
> 2.22.0
> 
> 

  reply	other threads:[~2019-07-05 23:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 15:18 Markus Elfring
2019-07-05 23:56 ` Finn Thain [this message]
2019-07-14 13:23   ` Geert Uytterhoeven
2019-07-14 16:05     ` Markus Elfring
2019-07-14 21:14       ` Geert Uytterhoeven
2019-07-15  6:11         ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.21.1907060951060.67@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=Markus.Elfring@web.de \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=mhocko@suse.com \
    --cc=rppt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®