lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070925044550.GA5419@pazke.donpac.ru>
Date:	Tue, 25 Sep 2007 08:45:50 +0400
From:	Andrey Panin <pazke@...pac.ru>
To:	Dave Jones <davej@...hat.com>,
	Jonathan Campbell <jon@...dgrounds.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [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@...pac.ru		| PGP key: wwwkeys.pgp.net

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ