* [PATCH] x86 apic: only compile local function if used @ 2012-04-14 22:43 Németh Márton 2012-05-07 13:12 ` Ingo Molnar 0 siblings, 1 reply; 4+ messages in thread From: Németh Márton @ 2012-04-14 22:43 UTC (permalink / raw) To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Suresh Siddha, Yinghai Lu, Naga Chumbalkar Cc: LKML From: Márton Németh <nm127@freemail.hu> The local function io_apic_level_ack_pending() is only called from io_apic_level_ack_pending(). The later function is only compiled if CONFIG_GENERIC_PENDING_IRQ is defined. Use this define around io_apic_level_ack_pending() function as well. This will remove the following warning message during compiling without CONFIG_GENERIC_PENDING_IRQ defined: * arch/x86/kernel/apic/io_apic.c:382: warning: ‘io_apic_level_ack_pending’ defined but not used Signed-off-by: Márton Németh <nm127@freemail.hu> --- diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index e88300d..9b85009 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -379,6 +379,7 @@ static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int v writel(value, &io_apic->data); } +#ifdef CONFIG_GENERIC_PENDING_IRQ static bool io_apic_level_ack_pending(struct irq_cfg *cfg) { struct irq_pin_list *entry; @@ -401,6 +402,7 @@ static bool io_apic_level_ack_pending(struct irq_cfg *cfg) return false; } +#endif union entry_union { struct { u32 w1, w2; }; ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86 apic: only compile local function if used 2012-04-14 22:43 [PATCH] x86 apic: only compile local function if used Németh Márton @ 2012-05-07 13:12 ` Ingo Molnar 2012-05-08 7:24 ` Suresh Siddha 0 siblings, 1 reply; 4+ messages in thread From: Ingo Molnar @ 2012-05-07 13:12 UTC (permalink / raw) To: Németh Márton Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Suresh Siddha, Yinghai Lu, Naga Chumbalkar, LKML * Németh Márton <nm127@freemail.hu> wrote: > From: Márton Németh <nm127@freemail.hu> > > The local function io_apic_level_ack_pending() is only called from > io_apic_level_ack_pending(). The later function is only compiled > if CONFIG_GENERIC_PENDING_IRQ is defined. Use this define around > io_apic_level_ack_pending() function as well. > > This will remove the following warning message during compiling > without CONFIG_GENERIC_PENDING_IRQ defined: > * arch/x86/kernel/apic/io_apic.c:382: warning: ‘io_apic_level_ack_pending’ defined but not used > > Signed-off-by: Márton Németh <nm127@freemail.hu> > --- > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c > index e88300d..9b85009 100644 > --- a/arch/x86/kernel/apic/io_apic.c > +++ b/arch/x86/kernel/apic/io_apic.c > @@ -379,6 +379,7 @@ static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int v > writel(value, &io_apic->data); > } > > +#ifdef CONFIG_GENERIC_PENDING_IRQ > static bool io_apic_level_ack_pending(struct irq_cfg *cfg) > { > struct irq_pin_list *entry; > @@ -401,6 +402,7 @@ static bool io_apic_level_ack_pending(struct irq_cfg *cfg) > > return false; > } > +#endif > > union entry_union { > struct { u32 w1, w2; }; it would be better/cleaner to just move this function into the already existing #ifdef CONFIG_GENERIC_PENDING_IRQ block. Thanks, Ingo ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86 apic: only compile local function if used 2012-05-07 13:12 ` Ingo Molnar @ 2012-05-08 7:24 ` Suresh Siddha 2012-05-08 10:04 ` [tip:x86/apic] x86/apic: Only compile local function if used with !CONFIG_GENERIC_PENDING_IRQ tip-bot for Márton Németh 0 siblings, 1 reply; 4+ messages in thread From: Suresh Siddha @ 2012-05-08 7:24 UTC (permalink / raw) To: Ingo Molnar Cc: Németh Márton, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Yinghai Lu, Naga Chumbalkar, LKML On Mon, 2012-05-07 at 15:12 +0200, Ingo Molnar wrote: > * Németh Márton <nm127@freemail.hu> wrote: > > > From: Márton Németh <nm127@freemail.hu> > > > > The local function io_apic_level_ack_pending() is only called from > > io_apic_level_ack_pending(). The later function is only compiled > > if CONFIG_GENERIC_PENDING_IRQ is defined. Use this define around > > io_apic_level_ack_pending() function as well. > > > > This will remove the following warning message during compiling > > without CONFIG_GENERIC_PENDING_IRQ defined: > > * arch/x86/kernel/apic/io_apic.c:382: warning: ‘io_apic_level_ack_pending’ defined but not used > > > > Signed-off-by: Márton Németh <nm127@freemail.hu> > > --- > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c > > index e88300d..9b85009 100644 > > --- a/arch/x86/kernel/apic/io_apic.c > > +++ b/arch/x86/kernel/apic/io_apic.c > > @@ -379,6 +379,7 @@ static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int v > > writel(value, &io_apic->data); > > } > > > > +#ifdef CONFIG_GENERIC_PENDING_IRQ > > static bool io_apic_level_ack_pending(struct irq_cfg *cfg) > > { > > struct irq_pin_list *entry; > > @@ -401,6 +402,7 @@ static bool io_apic_level_ack_pending(struct irq_cfg *cfg) > > > > return false; > > } > > +#endif > > > > union entry_union { > > struct { u32 w1, w2; }; > > it would be better/cleaner to just move this function into the > already existing #ifdef CONFIG_GENERIC_PENDING_IRQ block. Sorry missed this patch to review before. Appended the modified patch with an updated changelog. --- From: Márton Németh <nm127@freemail.hu> Subject: x86, ioapic: Fix the warning with !CONFIG_GENERIC_PENDING_IRQ The local function io_apic_level_ack_pending() is only called from io_apic_level_ack_pending(). The later function is only compiled if CONFIG_GENERIC_PENDING_IRQ is defined. Move the io_apic_level_ack_pending() to the existing #ifdef CONFIG_GENERIC_PENDING_IRQ code block. This will remove the following warning message during compiling without CONFIG_GENERIC_PENDING_IRQ defined: * arch/x86/kernel/apic/io_apic.c:382: warning: ‘io_apic_level_ack_pending’ defined but not used Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> --- arch/x86/kernel/apic/io_apic.c | 46 ++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 4b7a795..ffdc152 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -362,29 +362,6 @@ void native_io_apic_modify(unsigned int apic, unsigned int reg, unsigned int val writel(value, &io_apic->data); } -static bool io_apic_level_ack_pending(struct irq_cfg *cfg) -{ - struct irq_pin_list *entry; - unsigned long flags; - - raw_spin_lock_irqsave(&ioapic_lock, flags); - for_each_irq_pin(entry, cfg->irq_2_pin) { - unsigned int reg; - int pin; - - pin = entry->pin; - reg = io_apic_read(entry->apic, 0x10 + pin*2); - /* Is the remote IRR bit set? */ - if (reg & IO_APIC_REDIR_REMOTE_IRR) { - raw_spin_unlock_irqrestore(&ioapic_lock, flags); - return true; - } - } - raw_spin_unlock_irqrestore(&ioapic_lock, flags); - - return false; -} - union entry_union { struct { u32 w1, w2; }; struct IO_APIC_route_entry entry; @@ -2406,6 +2383,29 @@ static void ack_apic_edge(struct irq_data *data) atomic_t irq_mis_count; #ifdef CONFIG_GENERIC_PENDING_IRQ +static bool io_apic_level_ack_pending(struct irq_cfg *cfg) +{ + struct irq_pin_list *entry; + unsigned long flags; + + raw_spin_lock_irqsave(&ioapic_lock, flags); + for_each_irq_pin(entry, cfg->irq_2_pin) { + unsigned int reg; + int pin; + + pin = entry->pin; + reg = io_apic_read(entry->apic, 0x10 + pin*2); + /* Is the remote IRR bit set? */ + if (reg & IO_APIC_REDIR_REMOTE_IRR) { + raw_spin_unlock_irqrestore(&ioapic_lock, flags); + return true; + } + } + raw_spin_unlock_irqrestore(&ioapic_lock, flags); + + return false; +} + static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) { /* If we are moving the irq we need to mask it */ ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:x86/apic] x86/apic: Only compile local function if used with !CONFIG_GENERIC_PENDING_IRQ 2012-05-08 7:24 ` Suresh Siddha @ 2012-05-08 10:04 ` tip-bot for Márton Németh 0 siblings, 0 replies; 4+ messages in thread From: tip-bot for Márton Németh @ 2012-05-08 10:04 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, hpa, mingo, yinghai, nagananda.chumbalkar, suresh.b.siddha, tglx, nm127 Commit-ID: d1ecad6eee8629c6b425580aad76cf99b85956e9 Gitweb: http://git.kernel.org/tip/d1ecad6eee8629c6b425580aad76cf99b85956e9 Author: Márton Németh <nm127@freemail.hu> AuthorDate: Tue, 8 May 2012 00:24:20 -0700 Committer: Ingo Molnar <mingo@kernel.org> CommitDate: Tue, 8 May 2012 11:23:15 +0200 x86/apic: Only compile local function if used with !CONFIG_GENERIC_PENDING_IRQ The local function io_apic_level_ack_pending() is only called from io_apic_level_ack_pending(). The later function is only compiled if CONFIG_GENERIC_PENDING_IRQ is defined. Move the io_apic_level_ack_pending() to the existing #ifdef CONFIG_GENERIC_PENDING_IRQ code block. This will remove the following warning message during compiling without CONFIG_GENERIC_PENDING_IRQ defined: * arch/x86/kernel/apic/io_apic.c:382: warning: ‘io_apic_level_ack_pending’ defined but not used Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Naga Chumbalkar <nagananda.chumbalkar@hp.com> Link: http://lkml.kernel.org/r/1336461860.2296.3.camel@sbsiddha-mobl2 Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/apic/io_apic.c | 46 ++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 973539c..e245365 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -346,29 +346,6 @@ void native_io_apic_modify(unsigned int apic, unsigned int reg, unsigned int val writel(value, &io_apic->data); } -static bool io_apic_level_ack_pending(struct irq_cfg *cfg) -{ - struct irq_pin_list *entry; - unsigned long flags; - - raw_spin_lock_irqsave(&ioapic_lock, flags); - for_each_irq_pin(entry, cfg->irq_2_pin) { - unsigned int reg; - int pin; - - pin = entry->pin; - reg = io_apic_read(entry->apic, 0x10 + pin*2); - /* Is the remote IRR bit set? */ - if (reg & IO_APIC_REDIR_REMOTE_IRR) { - raw_spin_unlock_irqrestore(&ioapic_lock, flags); - return true; - } - } - raw_spin_unlock_irqrestore(&ioapic_lock, flags); - - return false; -} - union entry_union { struct { u32 w1, w2; }; struct IO_APIC_route_entry entry; @@ -2519,6 +2496,29 @@ static void ack_apic_edge(struct irq_data *data) atomic_t irq_mis_count; #ifdef CONFIG_GENERIC_PENDING_IRQ +static bool io_apic_level_ack_pending(struct irq_cfg *cfg) +{ + struct irq_pin_list *entry; + unsigned long flags; + + raw_spin_lock_irqsave(&ioapic_lock, flags); + for_each_irq_pin(entry, cfg->irq_2_pin) { + unsigned int reg; + int pin; + + pin = entry->pin; + reg = io_apic_read(entry->apic, 0x10 + pin*2); + /* Is the remote IRR bit set? */ + if (reg & IO_APIC_REDIR_REMOTE_IRR) { + raw_spin_unlock_irqrestore(&ioapic_lock, flags); + return true; + } + } + raw_spin_unlock_irqrestore(&ioapic_lock, flags); + + return false; +} + static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) { /* If we are moving the irq we need to mask it */ ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-08 10:04 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-04-14 22:43 [PATCH] x86 apic: only compile local function if used Németh Márton 2012-05-07 13:12 ` Ingo Molnar 2012-05-08 7:24 ` Suresh Siddha 2012-05-08 10:04 ` [tip:x86/apic] x86/apic: Only compile local function if used with !CONFIG_GENERIC_PENDING_IRQ tip-bot for Márton Németh
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.