mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Qian Cai <cai@lca.pw>,
	mingo@redhat.com, tglx@linutronix.de, bp@alien8.de
Cc: dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, hpa@zytor.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: fix an unused variable "tsk" warning
Date: Fri, 31 May 2019 13:53:05 -0700	[thread overview]
Message-ID: <b2e202f7-173f-9a26-2858-47768db46d2e@intel.com> (raw)
In-Reply-To: <1559335106-3239-1-git-send-email-cai@lca.pw>

On 5/31/19 1:38 PM, Qian Cai wrote:
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -1015,7 +1015,9 @@ static inline bool bad_area_access_from_pkeys(unsigned long error_code,
>  do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
>  	  vm_fault_t fault)
>  {
> +#ifdef CONFIG_MEMORY_FAILURE
>  	struct task_struct *tsk = current;
> +#endif
>  
>  	/* Kernel mode? Handle exceptions or die: */
>  	if (!(error_code & X86_PF_USER)) {

Ick.  I'd much rather see this:

#ifdef CONFIG_MEMORY_FAILURE
        if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
                unsigned lsb = 0;

become:

        if (IS_ENABLED(CONFIG_MEMORY_FAILURE) &&
 	    (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE))) {
                unsigned lsb = 0;

than add another #ifdef.

BTW, which tree are you doing this against?  Current -linus uses tsk in
the last line of do_sigbus():

        force_sig_fault(SIGBUS, BUS_ADRERR, ..., tsk);

      reply	other threads:[~2019-05-31 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 20:38 Qian Cai
2019-05-31 20:53 ` Dave Hansen [this message]

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=b2e202f7-173f-9a26-2858-47768db46d2e@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=cai@lca.pw \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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®