Re: aperture_64: use symbolic constants

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dave Jones
Date: Tuesday, May 20, 2008 - 8:06 am

On Tue, May 20, 2008 at 04:27:17PM +0200, Pavel Machek wrote:


 > +static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size)
 > +{
 > +	if (!aper_base)
 > +		return 0;
 > +
 > +	if (aper_base + aper_size > 0x100000000ULL) {
 > +		printk(KERN_ERR "Aperture beyond 4GB. Ignoring.\n");
 > +		return 0;
 > +	}
 > +	if (e820_any_mapped(aper_base, aper_base + aper_size, E820_RAM)) {
 > +		printk(KERN_ERR "Aperture pointing to e820 RAM. Ignoring.\n");
 > +		return 0;
 > +	}
 > +	if (aper_size < min_size) {
 > +		printk(KERN_ERR "Aperture too small (%d MB) than (%d MB)\n",
 > +				 aper_size>>20, min_size>>20);
 > +		return 0;
 > +	}
 > +
 > +	return 1;
 > +}

Instead of making this an inline, we could add it to the agpgart code
and export it, and have the gart-iommu code call it.
You can't build the IOMMU code without agpgart anyway, and having this inlined
in both places seems a bit wasteful.
Additionally, it would mean not having a function in a header file,
which always strikes me as a wrong thing to do.

	Dave

-- 
http://www.codemonkey.org.uk
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: aperture_64: use symbolic constants, Pavel Machek, (Tue May 20, 7:27 am)
Re: aperture_64: use symbolic constants, Dave Jones, (Tue May 20, 8:06 am)
Re: aperture_64: use symbolic constants, Pavel Machek, (Tue May 20, 8:32 am)
Re: aperture_64: use symbolic constants, Dave Jones, (Tue May 20, 8:42 am)
Re: aperture_64: use symbolic constants, Ingo Molnar, (Tue May 20, 8:42 am)
Re: aperture_64: use symbolic constants, Andi Kleen, (Tue May 20, 6:23 pm)
Re: aperture_64: use symbolic constants, Yinghai Lu, (Tue May 20, 6:59 pm)