mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Michal Suchanek <msuchanek@suse.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michal Suchanek <msuchanek@suse.de>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bootwrapper: mspsc.c: fix pointer-to-int-cast warnings
Date: Mon, 13 Nov 2017 22:05:44 +1100	[thread overview]
Message-ID: <87o9o6wi9j.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20171005112854.28115-1-msuchanek@suse.de>

Hi Michal,

Thanks for trying to fix this.

Michal Suchanek <msuchanek@suse.de> writes:
> I get these warnings:
>
> ../arch/powerpc/boot/mpsc.c: In function 'mpsc_get_virtreg_of_phandle':
> ../arch/powerpc/boot/mpsc.c:113:35: warning: cast from pointer to
> integer of different size [-Wpointer-to-int-cast]
>
> ../arch/powerpc/boot/mpsc.c: In function 'mpsc_console_init':
> ../arch/powerpc/boot/mpsc.c:147:12: warning: cast from pointer to
> integer of different size [-Wpointer-to-int-cast]
>
> Presumably the patch below fixes these, and presumably the DT defines
> that pointes and integers have the same size in the DT so this is fine

Actually no it doesn't. A device tree doesn't contain pointers, and it
doesn't say anything about the size of a pointer on a platform that uses
that device tree.

phandles are not pointers, they are handles, and they are always 32-bit.
So this code is just wrong on 64-bit, you can't safely cast from a
64-bit pointer to a phandle.

But I think this warning has actually been fixed differently by commit:

  866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers")

If you're still seeing the warning let me know.

cheers

      reply	other threads:[~2017-11-13 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 11:28 Michal Suchanek
2017-11-13 11:05 ` Michael Ellerman [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=87o9o6wi9j.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=msuchanek@suse.de \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®