Changeset d28bdbe in mainline


Ignore:
Timestamp:
2023-10-26T11:58:44Z (7 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
da13982
Parents:
95fc538
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-26 11:50:41)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-26 11:58:44)
Message:

Verify arguments of empty log calls

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/debug.h

    r95fc538 rd28bdbe  
    3838#include <log.h>
    3939#include <symtab_lookup.h>
     40#include <printf/verify.h>
    4041
    4142#define CALLER  ((uintptr_t) __builtin_return_address(0))
     43
     44/* An empty printf function to ensure syntactic correctness of disabled debug prints. */
     45_HELENOS_PRINTF_ATTRIBUTE(1, 2)
     46static inline void dummy_printf(const char *fmt, ...)
     47{
     48}
    4249
    4350#ifdef CONFIG_LOG
     
    5360        do { \
    5461                log(LF_OTHER, LVL_DEBUG, \
    55                     "%s() from %s at %s:%u: " format,__func__, \
     62                    "%s() from %s at %s:%u: " format, __func__, \
    5663                    symtab_fmt_name_lookup(CALLER), __FILE__, __LINE__, \
    5764                    ##__VA_ARGS__); \
     
    6067#else /* CONFIG_LOG */
    6168
    62 #define LOG(format, ...)
     69#define LOG(format, ...) dummy_printf(format, ##__VA_ARGS__)
    6370
    6471#endif /* CONFIG_LOG */
  • kernel/generic/src/main/main.c

    r95fc538 rd28bdbe  
    193193        version_print();
    194194
    195         LOG("\nconfig.base=%p config.kernel_size=%zu"
    196             "\nconfig.stack_base=%p config.stack_size=%zu",
    197             (void *) config.base, config.kernel_size,
    198             (void *) config.stack_base, config.stack_size);
     195        LOG("\nconfig.base=%p config.kernel_size=%zu",
     196            (void *) config.base, config.kernel_size);
    199197
    200198#ifdef CONFIG_KCONSOLE
Note: See TracChangeset for help on using the changeset viewer.