lkml.org 
[lkml]   [2012]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC] dynamic_debug: introduce debug_hex_dump()
    From
    Date
    On Sun, 2012-11-18 at 11:47 +0200, Vladimir Kondratiev wrote:
    > I see 2 drivers that use dynamic prefix:
    >
    > - mentioned above drivers/tty/ipwireless/hardware.c
    > - drivers/isdn/hardware/mISDN/
    >
    > I see several options:
    >
    > 1) require prefix_str to be constant. Patch code mentioned. For example,
    > code above may reads:
    >
    > static void dump_data_bytes(const char *type, const unsigned char *data,
    > unsigned length)
    > {
    > pr_debug(IPWIRELESS_PCCARD_NAME ": %s %s\n",
    > type, data_type(data, length));
    > print_hex_dump_bytes(IPWIRELESS_PCCARD_NAME, 0, (void *)data,
    > length < DUMP_MAX_BYTES ? length : DUMP_MAX_BYTES);
    > }
    >
    > 2) introduce fixed format string in DEFINE_DYNAMIC_DEBUG_METADATA, like
    >
    > DEFINE_DYNAMIC_DEBUG_METADATA((descriptor, "hexdump");
    >
    > 3) remove print_hex_dump_bytes from this patch
    >
    > I think 1) is the best, opinions?

    Another option could be testing __builtin_constant_p(prefix)




    \
     
     \ /
      Last update: 2012-11-18 17:01    [W:3.317 / U:1.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site