public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Bad cpu_data macro in include/asm-*/processor.h
@ 2001-11-15  9:52 Nathan Myers
  0 siblings, 0 replies; only message in thread
From: Nathan Myers @ 2001-11-15  9:52 UTC (permalink / raw)
  To: linux-kernel

In building 2.4.15-pre4 for non-SMP, I get a compile error at
kernel/i386/setup.c, line 2791.  This is traceable to 
include/asm-{i386,mips}/processor.h, the line

  #define cpu_data &boot_cpu_data

has a very stupid non-syntactic macro.  (This is line 54 in the mips 
header, 79 in the x86 header.) The minimal fix is obvious:

  #define cpu_data (&boot_cpu_data)

What stinky code, anyhow.  Why not make it a one-element array
to begin with?

I grepped for other similar macros with

  grep -n '#define[         ][      ]*[a-zA-Z_][a-zA-Z_0-9]*[       ][      ]*[^-A-Za-z0-9_\\{"(    ]' */*.h */*/*.h | less

and found more (mostly involving unary operator~) in 

  asm-m68k/bvme*.h
  asm-mips/asm.h,
  asm-mips64/asm.h
  asm-ppc/io.h
  asm-arm/arch-l7200/aug_reg.h
  linux/pci.h
  linux/ps2esdi.h
  net/irda/nsc-ircc.h
  net/irda/w83977af_ir.h

If you check for things like 
  #define FOO -1
which should be 
  #define FOO (-1)
you find zillions more.

Feh.

Nathan Myers
ncm@nospam.cantrip.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-15  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-15  9:52 Bad cpu_data macro in include/asm-*/processor.h Nathan Myers

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