public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* strange code in include/linux/kernel_stat.h
@ 2009-03-27 10:09 Dmitri Vorobiev
  2009-04-02 11:05 ` Dmitri Vorobiev
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitri Vorobiev @ 2009-03-27 10:09 UTC (permalink / raw)
  To: LKML

Hi,

Depending on whether the CONFIG_GENERIC_HARDIRQS option is enabled or not, the header file include/linux/kernel_stat.h defines the following two entities:

- the macro kstat_irqs_this_cpu for the case when CONFIG_GENERIC_HARDIRQS is set:

#define kstat_irqs_this_cpu(DESC) \
        ((DESC)->kstat_irqs[smp_processor_id()])

- another macro with the same name as the macro above but for the case CONFIG_GENERIC_HARDIRQS is not set:

#define kstat_irqs_this_cpu(irq) \
        (kstat_this_cpu.irqs[irq])

Apparently, it is assumed that the types for the macro argument are different, and depend on the value of CONFIG_GENERIC_HARDIRQS. Is this intentional?

Thanks,
Dmitri


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

* Re: strange code in include/linux/kernel_stat.h
  2009-03-27 10:09 strange code in include/linux/kernel_stat.h Dmitri Vorobiev
@ 2009-04-02 11:05 ` Dmitri Vorobiev
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitri Vorobiev @ 2009-04-02 11:05 UTC (permalink / raw)
  Cc: LKML

Dmitri Vorobiev wrote:
> Hi,
> 
> Depending on whether the CONFIG_GENERIC_HARDIRQS option is enabled or not, the header file include/linux/kernel_stat.h defines the following two entities:
> 
> - the macro kstat_irqs_this_cpu for the case when CONFIG_GENERIC_HARDIRQS is set:
> 
> #define kstat_irqs_this_cpu(DESC) \
>         ((DESC)->kstat_irqs[smp_processor_id()])
> 
> - another macro with the same name as the macro above but for the case CONFIG_GENERIC_HARDIRQS is not set:
> 
> #define kstat_irqs_this_cpu(irq) \
>         (kstat_this_cpu.irqs[irq])
> 
> Apparently, it is assumed that the types for the macro argument are different, and depend on the value of CONFIG_GENERIC_HARDIRQS. Is this intentional?
> 

I still would like to know what's going on there. Anyone knowledgeable out there, please?

Dmitri 

> Thanks,
> Dmitri
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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

end of thread, other threads:[~2009-04-02 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27 10:09 strange code in include/linux/kernel_stat.h Dmitri Vorobiev
2009-04-02 11:05 ` Dmitri Vorobiev

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