From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc, mpc5xx: fix compiler warning
Date: Tue, 03 Feb 2015 12:19:28 +0100 [thread overview]
Message-ID: <54D0AEC0.2090903@denx.de> (raw)
In-Reply-To: <20150203195314.4542.AA925319@jp.panasonic.com>
Hello Masahiro,
Am 03.02.2015 11:53, schrieb Masahiro Yamada:
> Hi Heiko,
>
>
> On Tue, 3 Feb 2015 11:10:19 +0100
> Heiko Schocher <hs@denx.de> wrote:
>
>> executing "tools/buildman/buildman mpc5xx" drops this warning:
>>
>> common/spl/spl_nor.c: In function 'spl_nor_load_image':
>> common/spl/spl_nor.c:26:10: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
>>
>> fix this.
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> ---
>>
>> common/spl/spl_nor.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c
>> index 2c0e8e0..dcba2e0 100644
>> --- a/common/spl/spl_nor.c
>> +++ b/common/spl/spl_nor.c
>> @@ -23,7 +23,7 @@ void spl_nor_load_image(void)
>> * Load Linux from its location in NOR flash to its defined
>> * location in SDRAM
>> */
>> - header = (const struct image_header *)CONFIG_SYS_OS_BASE;
>> + header = (struct image_header *)CONFIG_SYS_OS_BASE;
>>
>> if (image_get_os(header) == IH_OS_LINUX) {
>> /* happy - was a Linux */
>> --
>> 2.1.0
>
>
>
> I think you are doing wrong to just suppress the warning.
>
>
> Both image_get_os() and spl_parse_image_header() expect
> "const struct image_header *" argument.
>
> Add "const" to "struct image_header *header;"
Yep, fixed, thanks!
waiting for more comments before posting v2
bye,
Heiko
>
>
>
>
> Best Regards
> Masahiro Yamada
>
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2015-02-03 11:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 10:10 [U-Boot] [PATCH] powerpc, mpc5xx: fix compiler warning Heiko Schocher
2015-02-03 10:53 ` Masahiro Yamada
2015-02-03 11:19 ` Heiko Schocher [this message]
2015-02-03 10:56 ` Masahiro Yamada
2015-02-03 11:21 ` Heiko Schocher
2015-02-03 11:39 ` Masahiro Yamada
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=54D0AEC0.2090903@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/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