mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	<jailhouse-dev@googlegroups.com>, Ingo Molnar <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC
Date: Tue, 16 Jan 2018 19:02:51 +0800	[thread overview]
Message-ID: <b649d697-710d-91f1-1090-e32c8211c2fa@cn.fujitsu.com> (raw)
In-Reply-To: <CAK8P3a23RAFyRUwM-L8d3oTDhFdqZb9qobKd+ecu8L0uJgTsWQ@mail.gmail.com>

Hi Arnd,

At 01/16/2018 04:50 PM, Arnd Bergmann wrote:
> On Tue, Jan 16, 2018 at 9:17 AM, Dou Liyang <douly.fnst@cn.fujitsu.com> wrote:
>> Hi Arnd,
>>
>> [...]
>>>>
>>>> The reason I don't want to expose the x2apic_mode and x2apic_phys is
>>>> that they may be misused in X2APIC=n case. So I create an interface to
>>>> wrap it. do you think so? ;-)
>>>
>>>
>>> I'm not sure I follow what the intention of that is. If you want to hide
>>
>>
>> My purpose of that is hiding the variables in X2APIC=n case.
> 
> But why? I'd say either hide them all the time, or don't hide them at all.
> 

In this case, I prefer to hide them all the time.

>>> I see nothing wrong it with this, but also don't see anything it does
>>> that improves the interface.
>>>
>>
>> Another way we can choice is wrap the code with "CONFIG_X86_X2APIC".
>>
> 
> But why? That just makes perfectly reasonably code uglier. Generally
> speaking, compiler conditionals are better than preprocessor conditionals
> for this, as they are easier to read and provide better compile-time coverage
> when things go wrong, such as the missing declaration.
> 

Yes, Indeed. Thank you for telling me that.

Thanks,
	dou.

      reply	other threads:[~2018-01-16 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 20:23 Arnd Bergmann
2018-01-16  1:25 ` Dou Liyang
2018-01-16  2:34   ` Dou Liyang
2018-01-16  7:21     ` Arnd Bergmann
2018-01-16  8:17       ` Dou Liyang
2018-01-16  8:50         ` Arnd Bergmann
2018-01-16 11:02           ` Dou Liyang [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=b649d697-710d-91f1-1090-e32c8211c2fa@cn.fujitsu.com \
    --to=douly.fnst@cn.fujitsu.com \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=jailhouse-dev@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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®