>>>>> "Yasunori" == Yasunori Goto <[EMAIL PROTECTED]> writes:

Yasunori>     (Note: Mike Kravez-san's code was defined by MACRO like
Yasunori> this.  #ifndef MAX_DMA_PHYSADDR #if MAX_DMA_ADDRESS == ~0UL
Yasunori> : : However, MAX_DMA_ADDRESS is defined with cast "(unsigned
Yasunori> long)" in some architecture like i386. And, preprocessor
Yasunori> doesn't like this cast in #IF sentence and displays error
Yasunori> message as "missing binary operator befor token "long"".
Yasunori> So, I changed it to static inline function.)

Yasunori> +static inline unsigned long max_dma_physaddr(void) 
Yasunori> +{
Yasunori> + 
Yasunori> +  if (MAX_DMA_ADDRESS == ~0UL) 
Yasunori> +     return MAX_DMA_ADDRESS; 
Yasunori> +  else 
Yasunori> +     return __pa(MAX_DMA_ADDRESS); 
Yasunori> +} 

This code illustrates one of my pet coding-style hates:  there's no
need for the `else' as the return statement means it'll never be
reached.

        if (MAX_DMA_ADDRESS == ~0UL)
            return MAX_DMA_ADDRESS;
        return __pa(MAX_DMA_ADDRESS);

is all that's needed.

--
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to