Re: [RFC/patch] macro_removal_agp_mtrr.diff

From: Arjan van de Ven
Date: Sat Sep 04 2004 - 05:38:29 EST


On Sat, Sep 04, 2004 at 11:30:40AM +0100, Dave Airlie wrote:
> so something like
> static inline int drm_core_has_AGP(struct drm_device *dev)
> {
> #if __OS_HAS_AGP
> return drm_core_check_feature(dev, DRIVER_USE_AGP);
> #else
> return 0;
> }
>
> or the macro one
>
> #if __OS_HAS_AGP
> #define drm_core_has_AGP(dev) drm_core_check_feature(dev, DRIVER_USE_AGP)
> #else
> #define drm_core_has_AGP(dev) (0)
> #endif
>
> if the inline will work I'll be happier using it.. I just need to know it
> works for the range of compilers we use...

please do not put ifdefs inside functions;
how about

#if __OS_HAS_AGP
static inline int drm_core_has_AGP(struct drm_device *dev)
{
return drm_core_check_feature(dev, DRIVER_USE_AGP);
}
#else
#define drm_core_has_AGP(dev) 0
#endif


where you can make the later an inline if you really want to but I don't see
the point.

Attachment: pgp00000.pgp
Description: PGP signature