From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Linux Next Mailing List" <linux-next@vger.kernel.org>,
PowerPC <linuxppc-dev@lists.ozlabs.org>,
"Linux Kernel\
Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: changed messages in qemu boot
Date: Tue, 24 May 2022 12:41:27 +0530 [thread overview]
Message-ID: <1653375606.b65qo262yf.naveen@linux.ibm.com> (raw)
In-Reply-To: <87czg3mzyi.fsf@mpe.ellerman.id.au>
Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>> Stephen Rothwell wrote:
>
>> The below diff fixes it for me:
>>
>> diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
>> index 46c002a8388804..7418da705d43ac 100644
>> --- a/arch/powerpc/kernel/trace/ftrace.c
>> +++ b/arch/powerpc/kernel/trace/ftrace.c
>> @@ -746,7 +746,7 @@ int __init ftrace_dyn_arch_init(void)
>>
>> reladdr = addr - kernel_toc_addr();
>>
>> - if (reladdr >= SZ_2G || reladdr < -SZ_2G) {
>> + if (reladdr >= SZ_2G || reladdr < -_UL(SZ_2G)) {
>> pr_err("Address of %ps out of range of kernel_toc.\n",
>> (void *)addr);
>> return -1;
>
> I did:
>
> if (reladdr >= SZ_2G || reladdr < -(long)SZ_2G) {
That was my first attempt.
> Which more closely matches what the old code did, and I think is more
> obvious? ie. we don't want to negate the unsigned value, we want a
> signed value, and then the negative of that.
When you put it like that... :D
In hindsight, I agree though -- _UL() isn't necessarily better.
Thanks,
Naveen
prev parent reply other threads:[~2022-05-24 7:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 13:36 linux-next: changed messages in qemu boot Stephen Rothwell
2022-05-20 18:11 ` Naveen N. Rao
2022-05-24 2:22 ` Michael Ellerman
2022-05-24 7:11 ` Naveen N. Rao [this message]
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=1653375606.b65qo262yf.naveen@linux.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).