lkml.org 
[lkml]   [2018]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 02/23] linux/device.h: use unique identifier for each struct _ddebug
    Date
    Changes on x86-64 later in this series require that all struct _ddebug
    descriptors in a translation unit uses distinct identifiers. Realize
    that for dev_dbg_ratelimited by generating such an identifier via
    __UNIQUE_ID and pass that to an extra level of macros.

    No functional change.

    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Acked-by: Jason Baron <jbaron@akamai.com>
    Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    ---
    include/linux/device.h | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/include/linux/device.h b/include/linux/device.h
    index 0d8ed2adfc73..81108db013e4 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -1497,7 +1497,7 @@ do { \
    dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
    #if defined(CONFIG_DYNAMIC_DEBUG)
    /* descriptor check is first to prevent flooding with "callbacks suppressed" */
    -#define dev_dbg_ratelimited(dev, fmt, ...) \
    +#define _dev_dbg_ratelimited(descriptor, dev, fmt, ...) \
    do { \
    static DEFINE_RATELIMIT_STATE(_rs, \
    DEFAULT_RATELIMIT_INTERVAL, \
    @@ -1508,6 +1508,8 @@ do { \
    __dynamic_dev_dbg(&descriptor, dev, dev_fmt(fmt), \
    ##__VA_ARGS__); \
    } while (0)
    +#define dev_dbg_ratelimited(dev, fmt, ...) \
    + _dev_dbg_ratelimited(__UNIQUE_ID(ddebug), dev, fmt, ##__VA_ARGS__)
    #elif defined(DEBUG)
    #define dev_dbg_ratelimited(dev, fmt, ...) \
    do { \
    --
    2.19.1.3.g1d92a00e68
    \
     
     \ /
      Last update: 2018-10-09 13:23    [W:4.114 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site