lkml.org 
[lkml]   [2007]   [Sep]   [25]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 25 Sep 2007 08:45:50 +0400
FromAndrey Panin <>
SubjectRe: [PATCH] Patches for tiny 386 kernels, again. Linux kernel 2.6.22.7
On 267, 09 24, 2007 at 03:09:17PM -0400, Dave Jones wrote:
> On Mon, Sep 24, 2007 at 01:51:17AM -0700, Jonathan Campbell wrote:
> 
> 
>  > +#if defined(__i386__) && defined(CONFIG_DMI)
>  >  	dmi_check_system(acpi_dmi_table);
>  >  #endif
>  > 
>  > +#ifdef CONFIG_DMI
>  >  	dmi_scan_machine();
>  > +#endif
>  > 
>  > +#ifdef CONFIG_DMI
>  >  	/* Check and install the TSC clocksource */
>  >  	dmi_check_system(bad_tsc_dmi_table);
>  > +#endif
>  > 
>  > +#ifdef CONFIG_DMI
>  >  	dmi_check_system(acpi_osl_dmi_table);
>  > +#endif
> 
> Instead of adding all these ifdefs, we could just define
> add something along the lines of..
> 
> #ifndef CONFIG_DMI
> #define dmi_check_system do {} while (0)
> #endif
> 
> in some header, which hides the uglies away from the code
> whilst having the same net effect.

Let take a look at linux/dmi.h:

#ifdef CONFIG_DMI

extern int dmi_check_system(struct dmi_system_id *list);
extern char * dmi_get_system_info(int field);
extern struct dmi_device * dmi_find_device(int type, const char *name,
	struct dmi_device *from);
extern void dmi_scan_machine(void);
extern int dmi_get_year(int field);
extern int dmi_name_in_vendors(char *str);

#else

static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
static inline char * dmi_get_system_info(int field) { return NULL; }
static inline struct dmi_device * dmi_find_device(int type, const char *name,
	struct dmi_device *from) { return NULL; }
static inline int dmi_get_year(int year) { return 0; }
static inline int dmi_name_in_vendors(char *s) { return 0; }
#endif

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@donpac.ru		| PGP key: wwwkeys.pgp.net[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-09-25 06:49    [from the cache]
©2003-2008