[Beignet] [PATCH] fix typo for DEBUGP to avoid print extra empty line

Yang, Rong R rong.r.yang at intel.com
Mon Jan 18 22:46:17 PST 2016


Pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> He Junyan
> Sent: Friday, January 15, 2016 20:55
> To: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH] fix typo for DEBUGP to avoid print extra
> empty line
> 
> LGTM, thanks.
> 
> On Fri, Jan 15, 2016 at 06:58:43AM +0800, Guo Yejun wrote:
> > Date: Fri, 15 Jan 2016 06:58:43 +0800
> > From: Guo Yejun <yejun.guo at intel.com>
> > To: beignet at lists.freedesktop.org
> > Cc: Guo Yejun <yejun.guo at intel.com>
> > Subject: [Beignet] [PATCH] fix typo for DEBUGP to avoid print extra
> > empty  line
> > X-Mailer: git-send-email 1.9.1
> >
> > for the case without {}:
> >    if (...)
> >      DEBUGP(...)
> >
> > the second printf of DEBUGP is always enabled, fixed it.
> >
> > Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> > ---
> >  src/cl_utils.h | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/cl_utils.h b/src/cl_utils.h index 83f880e..311ba2a
> > 100644
> > --- a/src/cl_utils.h
> > +++ b/src/cl_utils.h
> > @@ -41,9 +41,11 @@ enum DEBUGP_LEVEL
> >    #define DEBUGP(...)
> >  #else
> >    //TODO: decide print or not with the value of level from environment
> > -  #define DEBUGP(level, fmt, ...)        \
> > -  fprintf(stderr, "Beignet: "#fmt, ##__VA_ARGS__);  \
> > -  fprintf(stderr, "\n");
> > +  #define DEBUGP(level, fmt, ...)                       \
> > +  do {                                                  \
> > +    fprintf(stderr, "Beignet: "#fmt, ##__VA_ARGS__);    \
> > +    fprintf(stderr, "\n");                              \
> > +  } while (0)
> >  #endif
> >
> >  /* Check compile time errors */
> > --
> > 1.9.1
> >
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list