Message ID | 1341589767-9895-3-git-send-email-m.kozlov@samsung.com |
---|---|
State | New |
Headers | show |
On 6 July 2012 16:49, Maksim Kozlov <m.kozlov@samsung.com> wrote: > Subject: ARM: exynos4210_pmu: changes in PRINT_DEBUG macro set. This is a rather vague summary. > It make possible to set DEBUG_PMU and DEBUG_PMU_EXTEND "This makes it possible" > independently of each other The patch doesn't actually do this, though -- if you set DEBUG_PMU_EXTEND you always get DEBUG_PMU's effects even if DEBUG_PMU isn't set. Plus you have two versions of the "do nothing" version of PRINT_DEBUG_EXTEND, which isn't very pretty. The patch also introduces the new PRINT_ERROR without mentioning it in the commit message. > +#if DEBUG_PMU || DEBUG_PMU_EXTEND > + > + #define PRINT_DEBUG(fmt, args...) \ Indenting preprocessor defines with space before the "#" rather than after definitely puts you in the minority: $ git grep '^#\s\+define' | wc -l 862 $ git grep '^\s\+#define' | wc -l 126 -- PMM
diff --git a/hw/exynos4210_pmu.c b/hw/exynos4210_pmu.c index 2be7e08..26a726f 100644 --- a/hw/exynos4210_pmu.c +++ b/hw/exynos4210_pmu.c @@ -34,26 +34,37 @@ #define DEBUG_PMU_EXTEND 0 #endif -#if DEBUG_PMU -#define PRINT_DEBUG(fmt, args...) \ +#if DEBUG_PMU || DEBUG_PMU_EXTEND + + #define PRINT_DEBUG(fmt, args...) \ do { \ fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ } while (0) #if DEBUG_PMU_EXTEND -#define PRINT_DEBUG_EXTEND(fmt, args...) \ + + #define PRINT_DEBUG_EXTEND(fmt, args...) \ do { \ fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ } while (0) #else -#define PRINT_DEBUG_EXTEND(fmt, args...) do {} while (0) + #define PRINT_DEBUG_EXTEND(fmt, args...) \ + do {} while (0) #endif /* EXTEND */ #else -#define PRINT_DEBUG(fmt, args...) do {} while (0) -#define PRINT_DEBUG_EXTEND(fmt, args...) do {} while (0) + #define PRINT_DEBUG(fmt, args...) \ + do {} while (0) + #define PRINT_DEBUG_EXTEND(fmt, args...) \ + do {} while (0) #endif +#define PRINT_ERROR(fmt, args...) \ + do { \ + fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ + } while (0) + + /* * Offsets for PMU registers */
It make possible to set DEBUG_PMU and DEBUG_PMU_EXTEND independently of each other Signed-off-by: Maksim Kozlov <m.kozlov@samsung.com> --- hw/exynos4210_pmu.c | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-)