]> git.baikalelectronics.ru Git - kernel.git/commit
kdb: kdb_support: Fix debugging information problem
authorStephen Zhang <stephenzhangzsd@gmail.com>
Thu, 4 Feb 2021 12:07:09 +0000 (20:07 +0800)
committerDaniel Thompson <daniel.thompson@linaro.org>
Thu, 4 Feb 2021 15:55:04 +0000 (15:55 +0000)
commit0759d8072843fe621b4d7abb31a7b7bc84ae4159
treebc2b11666410527419a8c7dd7465c95fde26fe7c
parentcbd026e1d84bd7ca18fd76883f7733ac72d44000
kdb: kdb_support: Fix debugging information problem

There are several common patterns.

0:
        kdb_printf("...",...);

which is the normal one.

1:
        kdb_printf("%s: "...,__func__,...)

We could improve '1' to this :

        #define kdb_func_printf(format, args...) \
                kdb_printf("%s: " format, __func__, ## args)

2:
        if(KDB_DEBUG(AR))
                kdb_printf("%s "...,__func__,...);

We could improve '2' to this :
        #define kdb_dbg_printf(mask, format, args...) \
                do { \
                        if (KDB_DEBUG(mask)) \
                                kdb_func_printf(format, ## args); \
                } while (0)

In addition, we changed the format code of size_t to %zu.

Signed-off-by: Stephen Zhang <stephenzhangzsd@gmail.com>
Link: https://lore.kernel.org/r/1612440429-6391-1-git-send-email-stephenzhangzsd@gmail.com
Reviewed-by: Douglas Anderson <dianders@chromium.org>
[daniel.thompson@linaro.org: Minor typo and line length fixes in the
patch description]
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_private.h
kernel/debug/kdb/kdb_support.c