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: <20081202122222.5873ee86.akpm@linux-foundation.org>
Date:	Tue, 2 Dec 2008 12:22:22 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Matthew Garrett <mjg59@...f.ucam.org>
Cc:	linux-kernel@...r.kernel.org, Matt_Domsch@...l.com, greg@...ah.com,
	linux-acpi@...r.kernel.org, rpurdie@...ys.net, ivdoorn@...il.com
Subject: Re: [PATCH 2/2] misc: Add dell-laptop driver

On Tue, 2 Dec 2008 20:05:45 +0000
Matthew Garrett <mjg59@...f.ucam.org> wrote:

> > > +#ifdef CONFIG_ACPI
> > > +	if (acpi_video_backlight_support())
> > > +		return 0;
> > > +#endif
> > 
> > Do we need the ifdefs here?  It looks like include/linux/acpi.h tries
> > to provide a suitable 0-returning stub?
> 
> They're protected by #ifdef CONFIG_ACPI_VIDEO, but it looks like acpi.h 
> is empty if CONFIG_ACPI isn't set?

No, acpi.h has a _few_ ACPI=n stubs:

: static inline int early_acpi_boot_init(void)
: {
: 	return 0;
: }
: static inline int acpi_boot_init(void)
: {
: 	return 0;
: }
: 
: static inline int acpi_boot_table_init(void)
: {
: 	return 0;
: }
: 
: static inline int acpi_mps_check(void)
: {
: 	return 0;
: }
: 
: static inline int acpi_check_resource_conflict(struct resource *res)
: {
: 	return 0;
: }
: 
: static inline int acpi_check_region(resource_size_t start, resource_size_t n,
: 				    const char *name)
: {
: 	return 0;
: }
: 
: static inline int acpi_check_mem_region(resource_size_t start,
: 					resource_size_t n, const char *name)
: {
: 	return 0;
: }

So it seems that acpi_video_backlight_support() should be added to this
list.  Except it already has a stub, in the wrong place.  This whole block:

: #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)
: 
: extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle);
: extern long acpi_is_video_device(struct acpi_device *device);
: extern int acpi_video_backlight_support(void);
: extern int acpi_video_display_switch_support(void);
: 
: #else
: 
: static inline long acpi_video_get_capabilities(acpi_handle graphics_dev_handle)
: {
: 	return 0;
: }
: 
: static inline long acpi_is_video_device(struct acpi_device *device)
: {
: 	return 0;
: }
: 
: static inline int acpi_video_backlight_support(void)
: {
: 	return 0;
: }
: 
: static inline int acpi_video_display_switch_support(void)
: {
: 	return 0;
: }
: 
: #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
: 

needs to be moved outside the `#ifdef CONFIG_ACPI' altogether.  Then you
can drop the ifdef.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ