public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: imunsie@au1.ibm.com
Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	paulus@samba.org, mingo@elte.hu, acme@redhat.com,
	kosaki.motohiro@jp.fujitsu.com, mitake@dcl.info.waseda.ac.jp,
	rusty@rustcorp.com.au, fweisbec@gmail.com, ebmunson@us.ibm.com,
	Valdis.Kletnieks@vt.edu, amwang@redhat.com, tfransosi@gmail.com,
	mhiramat@redhat.com, xiaoguangrong@cn.fujitsu.com,
	jaswinderrajput@gmail.com, arjan@linux.intel.com,
	hirofumi@mail.parknet.co.jp, efault@gmx.de, tzanussi@gmail.com,
	anton@samba.org, jkacur@redhat.com, lizf@cn.fujitsu.com,
	rostedt@goodmis.org
Subject: Re: [PATCH] perf: Fix endianness argument compatibility
Date: Tue, 13 Apr 2010 01:48:21 -0700 (PDT)	[thread overview]
Message-ID: <20100413.014821.34906166.davem@davemloft.net> (raw)
In-Reply-To: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>

From: "Ian Munsie" <imunsie@au1.ibm.com>
Date: Tue, 13 Apr 2010 18:37:33 +1000

> From: Ian Munsie <imunsie@au.ibm.com>
> 
> Parsing an option from the command line with OPT_BOOLEAN on a bool data
> type would not work on a big-endian machine due to the manner in which
> the boolean was being cast into an int and incremented. For example,
> running 'perf probe --list' on a PowerPC machine would fail to properly
> set the list_events bool and would therefore print out the usage
> information and terminate.
> 
> This patch makes OPT_BOOLEAN work as expected with a bool datatype. For
> cases where the original OPT_BOOLEAN was intentionally being used to
> increment an int each time it was passed in on the command line, this
> patch introduces OPT_INCR with the old behaviour of OPT_BOOLEAN (the
> verbose variable is currently the only such example of this).
> 
> I have reviewed every use of OPT_BOOLEAN to verify that a true C99 bool
> was passed. Where integers were used, I verified that they were only
> being used for boolean logic and changed them to bools to ensure that
> they would not be mistakenly used as ints. The major exception was the
> verbose variable which now uses OPT_INCR instead of OPT_BOOLEAN.
> 
> Signed-off-by: Ian Munsie <imunsie@au.ibm.com>

Thanks for finding and fixing this bug.

  reply	other threads:[~2010-04-13  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  8:37 [PATCH] perf: Fix endianness argument compatibility Ian Munsie
2010-04-13  8:48 ` David Miller [this message]
2010-04-14  9:28   ` Ingo Molnar
2010-04-14  9:52     ` Jeff King
2010-04-14  9:36 ` [tip:perf/core] perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() tip-bot for Ian Munsie
2010-04-14 15:12   ` Erik Faye-Lund

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=20100413.014821.34906166.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=amwang@redhat.com \
    --cc=anton@samba.org \
    --cc=arjan@linux.intel.com \
    --cc=ebmunson@us.ibm.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=imunsie@au1.ibm.com \
    --cc=jaswinderrajput@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tfransosi@gmail.com \
    --cc=tzanussi@gmail.com \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /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