mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [git pull] x86: declaration fixes
@ 2008-07-22 19:36 Jaswinder Singh
  0 siblings, 0 replies; 5+ messages in thread
From: Jaswinder Singh @ 2008-07-22 19:36 UTC (permalink / raw)
  To: Ingo Molnar, LKML

Hello Ingo,

Here is updated patches for x86-tip.

The following changes since commit a099a9b18ab434594bb01ed920e8c58574203fa9:
  Ingo Molnar (1):
        Merge branch 'out-of-tree'

are available in the git repository at:

  git://git.infradead.org/users/jaswinder/linux-2.6-tip.git master

Jaswinder Singh (8):
      x86: apic_XX.c declare functions before they get used
      x86: vm86_32.c declare functions before they get used
      x86: mm/init_XX.c declare functions before they get used
      x86: mm/fault.c declare do_page_fault before they get used
      x86: mm/ioremap.c declare early_ioremap_debug and early_ioremap_nested as static
      x86: mm/pageattr.c declare arch_report_meminfo before they get used
      x86: mm/pgtable_32.c declare set_pmd_pfn before they get used
      x86: mach-default/setup.c declare no_broadcast before they get used

 arch/x86/mach-default/setup.c |    4 +++-
 arch/x86/mm/fault.c           |    3 +--
 arch/x86/mm/init_32.c         |    1 +
 arch/x86/mm/ioremap.c         |    4 ++--
 include/asm-x86/apic.h        |    5 +++++
 include/asm-x86/hw_irq.h      |   10 ++++++++++
 include/asm-x86/page_32.h     |    1 +
 include/asm-x86/page_64.h     |    1 +
 include/asm-x86/pgtable.h     |    2 ++
 include/asm-x86/pgtable_32.h  |    1 +
 include/asm-x86/syscalls.h    |    5 ++++-
 include/asm-x86/traps.h       |    4 ++++
 12 files changed, 35 insertions(+), 6 deletions(-)



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

* Re: [git pull] x86: declaration fixes
  2008-07-21 18:04 ` Ingo Molnar
  2008-07-22  3:18   ` Jaswinder Singh
@ 2008-07-22  5:57   ` Jaswinder Singh
  1 sibling, 0 replies; 5+ messages in thread
From: Jaswinder Singh @ 2008-07-22  5:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML

Hello Ingo,

On Mon, 2008-07-21 at 20:04 +0200, Ingo Molnar wrote:
> * Jaswinder Singh <jaswinder@infradead.org> wrote:
> 

> another thing:
> 
> --- a/include/asm-x86/signal.h
> +++ b/include/asm-x86/signal.h
> 
> +void do_notify_resume(struct pt_regs *, void *, __u32);
> +
> 
> please add "extern" to each such prototype declaration. (the same is 
> true for a handful of other prototypes you've added - please re-review 
> and fix them)
> 

I was trying to follow other functions declaration in the file.

function declaration without extern :-

http://git.infradead.org/users/jaswinder/linux-2.6-tip.git?a=commitdiff;h=f740a1e1bbee2ce8a0b1b97361771db40afc37d2
http://git.infradead.org/users/jaswinder/linux-2.6-tip.git?a=commitdiff;h=b7b5113220da95eaa8b75ebd5bbd5278eed122e5

function declaration with extern :-

http://git.infradead.org/users/jaswinder/linux-2.6-tip.git?a=commitdiff;h=8cac4294a5e9b036c30d30e2e894e74201ee1c6b
http://git.infradead.org/users/jaswinder/linux-2.6-tip.git?a=commitdiff;h=e7d3d48dbf3e517e2e827a2adc6a2f861b16e6a6
http://git.infradead.org/users/jaswinder/linux-2.6-tip.git?a=commitdiff;h=feb49274338051ddf11d16f67b08ee6cafb32dbf

But you are emphasizing to use extern for all function declarations.

With current gcc, I think using extern with function declaration is :-
1. Wastage of time
2. Wastage of energy
3. Increase file size with 7 bytes for each extern.

If there is any secret behind using extern in kernel header files.
Please let me know.

Thank you,

Jaswinder Singh.


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

* Re: [git pull] x86: declaration fixes
  2008-07-21 18:04 ` Ingo Molnar
@ 2008-07-22  3:18   ` Jaswinder Singh
  2008-07-22  5:57   ` Jaswinder Singh
  1 sibling, 0 replies; 5+ messages in thread
From: Jaswinder Singh @ 2008-07-22  3:18 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML

Hello Ingo,

On Mon, 2008-07-21 at 20:04 +0200, Ingo Molnar wrote:
> * Jaswinder Singh <jaswinder@infradead.org> wrote:
> 
> > Hello Ingo,
> > 
> > 2. [PATCH] x86: process_32.c declare cpu_number before they get used
> 
> why is cpu_number moved over from smp.h to current.h? I think it's more 
> logical in smp.h. If it's missing somewhere then add an #include 
> <asm/smp.h> to that file?
> 

Because cpu_number is used by everyone independent of smp.

In smp.h It was declared under #ifdef CONFIG_X86_32_SMP which was wrong.

> also, this change:
> 
> +++ b/include/linux/timer.h
> @@ -6,6 +6,10 @@
>  #include <linux/stddef.h>
>  #include <linux/debugobjects.h>
> 
> +#ifdef CONFIG_X86
> +#include <asm/timer.h>
> +#endif /* CONFIG_X86 */
> 
> is not really acceptable in a generic header, nor is:
> 
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -65,6 +67,10 @@ struct getcpu_cache;
>  #include <linux/quota.h>
>  #include <linux/key.h>
> 
> +#ifdef CONFIG_X86
> +#include <asm/syscalls.h>
> +#endif /* CONFIG_X86 */
> 
> i'd suggest we just do asm-x86/syscall.h and asm-x86/timer.h changes and 
> add #include <asm/syscall.h> and #include <asm/timer.h> to the affected 
> x86 .c files. Once every architecture has it, linux/syscall.h can be 
> extended with an unconditional asm/syscall.h include.
> 

Because checkpatch.pl raise objection for it.

$ ./scripts/checkpatch.pl ../test.patch 
WARNING: Use #include <linux/timer.h> instead of <asm/timer.h>
#9: FILE: arch/x86/kernel/time_32.c:40:
+#include <asm/timer.h>


>  +#ifdef CONFIG_X86_32
>   extern int timer_ack;
>  -extern int no_timer_check;
>   extern int recalibrate_cpu_khz(void);
>  +#endif /* CONFIG_X86_32 */
>  +
>  +extern int no_timer_check;
> 
> hm, why was this needed?
> 

Because timer_ack is only required for X86_32
and int recalibrate_cpu_khz(void) is declared inside #ifdef
CONFIG_X86_32 in arch/x86/kernel/tsc.c

Thank you,

Jaswinder Singh.


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

* Re: [git pull] x86: declaration fixes
  2008-07-21 17:47 Jaswinder Singh
@ 2008-07-21 18:04 ` Ingo Molnar
  2008-07-22  3:18   ` Jaswinder Singh
  2008-07-22  5:57   ` Jaswinder Singh
  0 siblings, 2 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-21 18:04 UTC (permalink / raw)
  To: Jaswinder Singh; +Cc: LKML


* Jaswinder Singh <jaswinder@infradead.org> wrote:

> Hello Ingo,
> 
> Please pull the declaration fixes for x86-tip from :
> 
> git://git.infradead.org/users/jaswinder/linux-2.6-tip.git

pulled this into tip/x86/prototypes, thanks Jaswinder.

Btw., when sending pull requests it's best to use git-request-pull. I.e. 
something like:

git-request-pull tip/master git://git.infradead.org/users/jaswinder/linux-2.6-tip.git

would have generated the proper output.

The changes still need some fixing though. For example, this change:

> 2. [PATCH] x86: process_32.c declare cpu_number before they get used

why is cpu_number moved over from smp.h to current.h? I think it's more 
logical in smp.h. If it's missing somewhere then add an #include 
<asm/smp.h> to that file?

also, this change:

+++ b/include/linux/timer.h
@@ -6,6 +6,10 @@
 #include <linux/stddef.h>
 #include <linux/debugobjects.h>

+#ifdef CONFIG_X86
+#include <asm/timer.h>
+#endif /* CONFIG_X86 */

is not really acceptable in a generic header, nor is:

--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -65,6 +67,10 @@ struct getcpu_cache;
 #include <linux/quota.h>
 #include <linux/key.h>

+#ifdef CONFIG_X86
+#include <asm/syscalls.h>
+#endif /* CONFIG_X86 */

i'd suggest we just do asm-x86/syscall.h and asm-x86/timer.h changes and 
add #include <asm/syscall.h> and #include <asm/timer.h> to the affected 
x86 .c files. Once every architecture has it, linux/syscall.h can be 
extended with an unconditional asm/syscall.h include.

Or, like Matthew has suggested, a 'complete' collection of all syscalls 
should be assembled into linux/syscall.h. In that case it has extra 
documentation value if there's an #ifdef CONFIG_X86 for certain 
syscalls. (say the LDT or VM86 syscalls make only sense on x86 
platforms)

another thing:

--- a/include/asm-x86/signal.h
+++ b/include/asm-x86/signal.h

+void do_notify_resume(struct pt_regs *, void *, __u32);
+

please add "extern" to each such prototype declaration. (the same is 
true for a handful of other prototypes you've added - please re-review 
and fix them)

 +#ifdef CONFIG_X86_32
  extern int timer_ack;
 -extern int no_timer_check;
  extern int recalibrate_cpu_khz(void);
 +#endif /* CONFIG_X86_32 */
 +
 +extern int no_timer_check;

hm, why was this needed?

	Ingo

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

* [git pull] x86: declaration fixes
@ 2008-07-21 17:47 Jaswinder Singh
  2008-07-21 18:04 ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Jaswinder Singh @ 2008-07-21 17:47 UTC (permalink / raw)
  To: Ingo Molnar, LKML

Hello Ingo,

Please pull the declaration fixes for x86-tip from :

git://git.infradead.org/users/jaswinder/linux-2.6-tip.git

This includes following patches after commit 087115517d43c2 (Merge branch 'xen-64bit') :-

1. [PATCH] x86: Introducing asm/syscalls.h
2. [PATCH] x86: process_32.c declare cpu_number before they get used
3. [PATCH] x86: signal_XX.c declare do_notify_resume before they get used
4. [PATCH] x86: time_XX.c declare functions before they get used
5. [PATCH] x86: setup.c declare saved_video_mode before they get used
6. [PATCH] x86: e820.c declare pci_mem_start before they get used
7. [PATCH] x86: pci-dma.c declare iommu_bio_merge before they get used
8. [PATCH] x86: pci-nommu.c declare nommu_dma_ops before they get used
9. [PATCH] x86: i387.c declare dump_fpu() before they get used
10. [PATCH] x86: ptrace.c declare functions before they get used
11. [PATCH] x86: proc.c declare cpuinfo_op before they get used
12. [PATCH] x86: common.c declare idle_regs before they get used
13. [PATCH] x86: mtrr/main.c declare range_state as static


Thank you,

Jaswinder Singh


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

end of thread, other threads:[~2008-07-22 19:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-22 19:36 [git pull] x86: declaration fixes Jaswinder Singh
  -- strict thread matches above, loose matches on Subject: below --
2008-07-21 17:47 Jaswinder Singh
2008-07-21 18:04 ` Ingo Molnar
2008-07-22  3:18   ` Jaswinder Singh
2008-07-22  5:57   ` Jaswinder Singh

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®