mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: John Crispin <blogic@openwrt.org>
Cc: <eunb.song@samsung.com>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>,
	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mips: add arch_trigger_all_cpu_backtrace() function
Date: Wed, 22 Oct 2014 23:29:36 +0100	[thread overview]
Message-ID: <20141022222936.GE12296@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <544758AB.3060100@openwrt.org>

Hi John,

On Wed, Oct 22, 2014 at 09:11:39AM +0200, John Crispin wrote:
> On 22/10/2014 08:54, Eunbong Song wrote:
> >>> +void arch_trigger_all_cpu_backtrace(bool); +#define
> >>> arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> > 
> >> What is the purpose of this define ? is this maybe a leftover from
> >> some regex/cleanups ?
> > 
> > Hi John.
> > Actually, I just follow the same function of sparc architecture.
> > You can find this in arch/sparc/include/asm/irq_64.h as below
> > 
> > void arch_trigger_all_cpu_backtrace(bool);
> > #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
> > 
> > I guess this is used for conditional compile. 
> > See below.
> > include/linux/nmi.h
> > #ifdef arch_trigger_all_cpu_backtrace
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> >         arch_trigger_all_cpu_backtrace(true);
> > 
> >         return true;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> >         arch_trigger_all_cpu_backtrace(false);
> >         return true;
> > }
> > #else
> > static inline bool trigger_all_cpu_backtrace(void)
> > {
> >         return false;
> > }
> > static inline bool trigger_allbutself_cpu_backtrace(void)
> > {
> >         return false;
> > }
> > #endif
> > 
> > Thanks. 
> >> John
> > 
> 
> i don't see how this is required for conditional compiles. the code
> define a->a which is bogus i think.

It's a pretty common pattern in the asm headers, in order to allow
generic code to use the preprocessor to see whether it was defined or
not.

Cheers
James

  reply	other threads:[~2014-10-22 22:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22  6:54 Eunbong Song
2014-10-22  7:11 ` John Crispin
2014-10-22 22:29   ` James Hogan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-22  6:39 Eunbong Song
2014-10-22  6:47 ` John Crispin
2014-10-22 16:16 ` Ralf Baechle
2014-10-22 22:22 ` James Hogan

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=20141022222936.GE12296@jhogan-linux.le.imgtec.org \
    --to=james.hogan@imgtec.com \
    --cc=blogic@openwrt.org \
    --cc=eunb.song@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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

Powered by JetHome