Re: [RFC/patch] macro_removal_agp_mtrr.diff

From: Dave Airlie
Date: Sat Sep 04 2004 - 05:32:10 EST


> it looks you can nuke most of those.
> > -#if __REALLY_HAVE_AGP
> > +#if __OS_HAS_AGP
> > drm_agp_head_t *agp; /**< AGP data */
> > #endif
>
> for example does this extra pointer really hurt in the *really* unlikely
> case you don't have AGP ?

actually it's not just the pointer it is the structure drm_agp_head_t I
think it needs some agp includes to work ..

> if you make a drm_core_has_AGP and drm_core_has_MTRR wrapper around
> these then...

Will using inlines work in this case if the inline returns 0 will the
compiler still do the removal...

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...

Dave.

--
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DECstation / Linux VAX / ILUG person

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/