Re: [PATCH] a more efficient BUG() macro

From: J . A . Magallon (jamagallon@able.es)
Date: Sat Feb 17 2001 - 10:14:26 EST

  • Next message: Gregory Maxwell: "[OT]Re: Linux stifles innovation..."

    On 02.17 J . A . Magallon wrote:
    > #if 1
    > extern void *__io_virt_debug(unsigned long x, const char *file, int line);
    > extern unsigned long __io_phys_debug(unsigned long x, const char *file, int
    > li
    > ne);
    > #define __io_virt(x) __io_virt_debug((unsigned long)(x), __FILE__, __LINE__)
    > //#define __io_phys(x) __io_phys_debug((unsigned long)(x), __FILE__, __LINE__)
    > #else
    > #define __io_virt(x) ((void *)(x))
    > //#define __io_phys(x) __pa(x)
    > #endif
    > ..

    Loking at it (arch/i386/lib/iodebug.c):
    void * __io_virt_debug(unsigned long x, const char *file, int line)
    {
        if (x < PAGE_OFFSET) {
            printk("io mapaddr 0x%05lx not valid at %s:%d!\n", x, file, line);
            return __va(x);
        }
        return (void *)x;
    }

    is changed (if you turn off the #if 1), from 1_function_call+1_if+cache
    pollution with the function code to nothing (just a cast).
    This will make some difference in performance, won't it ?
     

    -- 
    J.A. Magallon                                                      $> cd pub
    mailto:jamagallon@able.es                                          $> more beer
    

    Linux werewolf 2.4.1-ac17 #1 SMP Sat Feb 17 01:47:56 CET 2001 i686

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



    This archive was generated by hypermail 2b29 : Sat Feb 17 2001 - 10:15:54 EST