Message ID | 1320866946-28235-11-git-send-email-wd@denx.de |
---|---|
State | Accepted |
Commit | 8a2d1f246e14c6595642898568c54fbf1ef065ef |
Headers | show |
On Wednesday 09 November 2011 14:29:04 Wolfgang Denk wrote: > Convert custom debug code to use standard debug() facility. > This also fixes these build warning: > ct69000.c: In function 'FindAndSetPllParamIntoXrRegs': > ct69000.c:706:28: warning: variable 'new_pixclock' set but not used > [-Wunused-but-set-variable] > > --- a/drivers/video/ct69000.c > +++ b/drivers/video/ct69000.c > > #undef VGA_DEBUG > #undef VGA_DUMP_REG > #ifdef VGA_DEBUG > -#define PRINTF(fmt,args...) printf (fmt ,##args) > +#undef _DEBUG > +#define _DEBUG 1 > #else > -#define PRINTF(fmt,args...) > +#undef _DEBUG > +#define _DEBUG 0 > #endif so do you still need this ? since you've converted to debug(), looks like this logic can all go away. -mike
Dear Mike Frysinger, In message <201111091544.17111.vapier@gentoo.org> you wrote: > > > #undef VGA_DEBUG > > #undef VGA_DUMP_REG > > #ifdef VGA_DEBUG > > -#define PRINTF(fmt,args...) printf (fmt ,##args) > > +#undef _DEBUG > > +#define _DEBUG 1 > > #else > > -#define PRINTF(fmt,args...) > > +#undef _DEBUG > > +#define _DEBUG 0 > > #endif > > so do you still need this ? since you've converted to debug(), looks like > this logic can all go away. It's needed if I want to keep the original behaviour regarding VGA_DEBUG and VGA_DUMP_REG which were independent before. Best regards, Wolfgang Denk
On Thursday 10 November 2011 00:43:54 Wolfgang Denk wrote: > Mike Frysinger wrote: > > > #undef VGA_DEBUG > > > #undef VGA_DUMP_REG > > > #ifdef VGA_DEBUG > > > > > > -#define PRINTF(fmt,args...) printf (fmt ,##args) > > > +#undef _DEBUG > > > +#define _DEBUG 1 > > > > > > #else > > > > > > -#define PRINTF(fmt,args...) > > > +#undef _DEBUG > > > +#define _DEBUG 0 > > > > > > #endif > > > > so do you still need this ? since you've converted to debug(), looks > > like this logic can all go away. > > It's needed if I want to keep the original behaviour regarding > VGA_DEBUG and VGA_DUMP_REG which were independent before. ok, i see that now. i wonder if we need that though. i don't think there's any real difference between doing "#define DEBUG" and "#define VGA_DEBUG". -mike
Dear Mike Frysinger, In message <201111101121.38318.vapier@gentoo.org> you wrote: > > > It's needed if I want to keep the original behaviour regarding > > VGA_DEBUG and VGA_DUMP_REG which were independent before. > > ok, i see that now. i wonder if we need that though. i don't think there's > any real difference between doing "#define DEBUG" and "#define VGA_DEBUG". I agree. But I did not want to introduce any functional changes here. All I wanted was to get rid of the warnings. Please feel free to submit patches for further cleanup - if you look at that code, you will find plenty opportunity to get over some otherwise boring hours ;-) Best regards, Wolfgang Denk
Acked-by: Anatolij Gustschin <agust@denx.de>
Dear Wolfgang Denk, In message <1320866946-28235-11-git-send-email-wd@denx.de> you wrote: > Convert custom debug code to use standard debug() facility. > This also fixes these build warning: > ct69000.c: In function 'FindAndSetPllParamIntoXrRegs': > ct69000.c:706:28: warning: variable 'new_pixclock' set but not used > [-Wunused-but-set-variable] > > Signed-off-by: Wolfgang Denk <wd@denx.de> > --- > drivers/video/ct69000.c | 12 +++++++----- > 1 files changed, 7 insertions(+), 5 deletions(-) Applied, thanks. Best regards, Wolfgang Denk
diff --git a/drivers/video/ct69000.c b/drivers/video/ct69000.c index 3db614d..0ed5f41 100644 --- a/drivers/video/ct69000.c +++ b/drivers/video/ct69000.c @@ -35,9 +35,11 @@ #undef VGA_DEBUG #undef VGA_DUMP_REG #ifdef VGA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) +#undef _DEBUG +#define _DEBUG 1 #else -#define PRINTF(fmt,args...) +#undef _DEBUG +#define _DEBUG 0 #endif /* Macros */ @@ -740,7 +742,7 @@ FindAndSetPllParamIntoXrRegs (unsigned int pixelclock, } m += param->mn_diff; n += param->mn_diff; - PRINTF ("VCO %d, pd %d, m %d n %d vld %d \n", fvco, pd, m, n, vld); + debug("VCO %d, pd %d, m %d n %d vld %d\n", fvco, pd, m, n, vld); xr_cb = ((0x7 & PD) << 4) | (vld == param->vld_set ? 0x04 : 0); /* All four of the registers used for dot clock 2 (XRC8 - XRCB) must be * written, and in order from XRC8 to XRCB, before the hardware will @@ -751,7 +753,7 @@ FindAndSetPllParamIntoXrRegs (unsigned int pixelclock, ctWrite_i (CT_XR_O, 0xca, 0); /* because of a hw bug I guess, but we write */ ctWrite_i (CT_XR_O, 0xcb, xr_cb); /* 0 to it for savety */ new_pixclock = ReadPixClckFromXrRegsBack (param); - PRINTF ("pixelclock.set = %d, pixelclock.real = %d \n", + debug("pixelclock.set = %d, pixelclock.real = %d\n", pixelclock, new_pixclock); } @@ -1119,7 +1121,7 @@ video_hw_init (void) pGD->dprBase &= 0xfffff000; pGD->dprBase += 0x00001000; } - PRINTF ("Cursor Start %x Pattern Start %x\n", pGD->dprBase, + debug("Cursor Start %x Pattern Start %x\n", pGD->dprBase, PATTERN_ADR); pGD->vprBase = pci_mem_base; /* Dummy */ pGD->cprBase = pci_mem_base; /* Dummy */
Convert custom debug code to use standard debug() facility. This also fixes these build warning: ct69000.c: In function 'FindAndSetPllParamIntoXrRegs': ct69000.c:706:28: warning: variable 'new_pixclock' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk <wd@denx.de> --- drivers/video/ct69000.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)