Trinity fuzzer tool discussions
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Ildar Muslukhov <ildarm@google.com>
Cc: trinity@vger.kernel.org
Subject: Re: [PATCH] converted COLOR_ARG macro to a function
Date: Mon, 30 Sep 2013 21:10:34 -0400	[thread overview]
Message-ID: <20131001011034.GA2140@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1309301739430.17550@ildarm-linux.kir.corp.google.com>

On Mon, Sep 30, 2013 at 05:43:01PM -0700, Ildar Muslukhov wrote:
 > 
 > This patch converts COLOR_ARG macro to a function. The sole purpose is to 
 > make the code a bit more readable.
 > 
 > Signed-off-by: Ildar Muslukhov <ildarm@google.com>
 > 
 > ---
 >  include/log.h |   3 ++
 >  syscall.c     | 164 ++++++++++++++++++++++++++++++----------------------------
 >  2 files changed, 87 insertions(+), 80 deletions(-)
 > 
 > diff --git a/include/log.h b/include/log.h
 > index f3fc7c4..627985c 100644
 > --- a/include/log.h
 > +++ b/include/log.h
 > @@ -19,6 +19,9 @@
 >  #define WHITE if (monochrome == FALSE)	sptr += sprintf(sptr, "%s", ANSI_WHITE);
 >  #define CRESET if (monochrome == FALSE)	sptr += sprintf(sptr, "%s", ANSI_RESET);
 >  
 > +#define CYANPTR if (monochrome == FALSE)	*sptr += sprintf(*sptr, "%s", ANSI_CYAN);
 > +#define CRESETPTR if (monochrome == FALSE)	*sptr += sprintf(*sptr, "%s", ANSI_RESET);
 
We only use CYANPTR once. Might as well just inline it ?

 > --- a/syscall.c
 > +++ b/syscall.c
 > @@ -41,14 +41,14 @@ long syscall32(int num_args, unsigned int call,
 >  
 >  	if (num_args <= 6) {
 >  		long __res;
 > -#if defined( __i386__)
 > +#if defined(__i386__)
 >  		__asm__ volatile (
 >  			"pushl %%ebp\n\t"
 >  			"movl %7, %%ebp\n\t"
 >  			"int $0x80\n\t"
 >  			"popl %%ebp\n\t"
 >  			: "=a" (__res)
 > -			: "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
 > +			: "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
 >  			: "%ebp" /* mark EBP reg as dirty */
 >  			);
 >  #elif defined(__x86_64__)
 > @@ -58,7 +58,7 @@ long syscall32(int num_args, unsigned int call,
 >  			"int $0x80\n\t"
 >  			"popq %%rbp\n\t"
 >  			: "=a" (__res)
 > -			: "0" (call),"b" ((long)(a1)),"c" ((long)(a2)),"d" ((long)(a3)), "S" ((long)(a4)),"D" ((long)(a5)), "g" ((long)(a6))
 > +			: "0" (call), "b" ((long)(a1)), "c" ((long)(a2)), "d" ((long)(a3)), "S" ((long)(a4)), "D" ((long)(a5)), "g" ((long)(a6))
 >  			: "%rbp" /* mark EBP reg as dirty */
 >  			);
 >  #else
 > @@ -73,7 +73,7 @@ long syscall32(int num_args, unsigned int call,
 >  	UNUSED(a5);
 >  	UNUSED(a6);
 >  #endif
 > -		__syscall_return(long,__res);
 > +		__syscall_return(long, __res);
 >  	}
 
I suspect this belongs in a different diff ;)
 

Otherwise, looks ok.

	Dave

  reply	other threads:[~2013-10-01  1:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01  0:43 [PATCH] converted COLOR_ARG macro to a function Ildar Muslukhov
2013-10-01  1:10 ` Dave Jones [this message]
2013-10-01  1:21   ` Ildar Muslukhov
  -- strict thread matches above, loose matches on Subject: below --
2013-10-01 17:54 Ildar Muslukhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131001011034.GA2140@redhat.com \
    --to=davej@redhat.com \
    --cc=ildarm@google.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox