From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Subject: Re: Re: [PATCH 2/2] tracing/probes: Fix basic print type functions
Date: Fri, 22 Nov 2013 17:10:02 +0900 [thread overview]
Message-ID: <528F115A.8020602@hitachi.com> (raw)
In-Reply-To: <87k3g1t1hw.fsf@sejong.aot.lge.com>
(2013/11/22 15:05), Namhyung Kim wrote:
> Hi Oleg,
>
> On Wed, 20 Nov 2013 16:22:45 +0100, Oleg Nesterov wrote:
>> On 11/18, Namhyung Kim wrote:
>>>
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(u8, "%x", unsigned int)
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(u16, "%x", unsigned int)
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(u32, "%lx", unsigned long)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(u8 , "%x", unsigned char)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(u16, "%x", unsigned short)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(u32, "%x", unsigned int)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(s8, "%d", signed char)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(s16, "%d", short)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(s32, "%d", int)
>>> +#if BITS_PER_LONG == 32
>>> DEFINE_BASIC_PRINT_TYPE_FUNC(u64, "%llx", unsigned long long)
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(s8, "%d", int)
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(s16, "%d", int)
>>> -DEFINE_BASIC_PRINT_TYPE_FUNC(s32, "%ld", long)
>>> DEFINE_BASIC_PRINT_TYPE_FUNC(s64, "%lld", long long)
>>> +#else /* BITS_PER_LONG == 64 */
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(u64, "%lx", unsigned long)
>>> +DEFINE_BASIC_PRINT_TYPE_FUNC(s64, "%ld", long)
>>> +#endif
>>
>> I must have missed something... Not only I do not understand why
>> do we need "#if BITS_PER_LONG", I can't understand why
>> DEFINE_BASIC_PRINT_TYPE_FUNC() needs "cast" argument.
>>
>> IOW, how about the patch below instead?
>
> Looks good to me.
>
> Masami, did you have any issue regarding the casts?
Hm, unless compiler doesn't complain about it,I'm OK for that.
And as far as I tested on x86/x86-64/arm(32), this has no problem. :)
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Thank you!
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2013-11-22 8:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 4:40 [PATCH 1/2] tracing/uprobes: Fix documentation of uprobe registration syntax Namhyung Kim
2013-11-18 4:40 ` [PATCH 2/2] tracing/probes: Fix basic print type functions Namhyung Kim
2013-11-20 15:22 ` Oleg Nesterov
2013-11-22 6:05 ` Namhyung Kim
2013-11-22 8:10 ` Masami Hiramatsu [this message]
2013-11-20 15:19 ` [PATCH 1/2] tracing/uprobes: Fix documentation of uprobe registration syntax Oleg Nesterov
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=528F115A.8020602@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.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
all inboxes | Powered by JetHome®