From: Dave Penkler <dpenkler@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [GIT PULL] Staging driver changes for 6.13-rc1
Date: Mon, 2 Dec 2024 10:50:07 +0100 [thread overview]
Message-ID: <Z02Cz6GbdtGNPywE@egonzo> (raw)
In-Reply-To: <7d7e65af-b818-45de-a92c-ee59a864dbdb@roeck-us.net>
On Sat, Nov 30, 2024 at 09:07:39AM -0800, Guenter Roeck wrote:
> On 11/30/24 08:15, Greg KH wrote:
> > On Sat, Nov 30, 2024 at 08:10:55AM -0800, Guenter Roeck wrote:
> > > Hi,
> > >
> > > On Fri, Nov 29, 2024 at 05:27:53AM +0100, Greg KH wrote:
> > > > The following changes since commit 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b:
> > > >
> > > > Linux 6.12-rc2 (2024-10-06 15:32:27 -0700)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git tags/staging-6.13-rc1
> > > >
> > > > for you to fetch changes up to 114eae3c9fde35220cca623840817a740a2eb7b3:
> > > >
> > > > Staging: gpib: gpib_os.c - Remove unnecessary OOM message (2024-11-10 08:04:18 +0100)
> > > >
> > > > ----------------------------------------------------------------
> > > [ ...]
> > >
> > > > Dave Penkler (33):
> > > > staging: gpib: Add common include files for GPIB drivers
> > > > staging: gpib: Add user api include files
> > > > staging: gpib: Add GPIB common core driver
> > > > staging: gpib: Add tms9914 GPIB chip driver
> > > > staging: gpib: Add nec7210 GPIB chip driver
> > > > staging: gpib: Add HP/Agilent/Keysight 8235xx PCI GPIB driver
> > > > staging: gpib: Add Agilent/Keysight 82357x USB GPIB driver
> > > > staging: gpib: Add Computer Boards GPIB driver
> > >
> > > I seem to be unable to find the patch introducing the problem (the link
> > > provided with the patch is invalid), so I report it here.
> > >
> > > With i386 allmodconfig builds:
> > >
> > > Building i386:allyesconfig ... failed
> > > --------------
> > > Error log:
> > > drivers/staging/gpib/cec/cec_gpib.c: In function 'cec_pci_attach':
> > > drivers/staging/gpib/cec/cec_gpib.c:300:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > > 300 | nec_priv->iobase = (void *)(pci_resource_start(cec_priv->pci_device, 3));
> > > | ^
> > > drivers/staging/gpib/ines/ines_gpib.c: In function 'ines_common_pci_attach':
> > > drivers/staging/gpib/ines/ines_gpib.c:783:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> > > 783 | nec_priv->iobase = (void *)(pci_resource_start(ines_priv->pci_device,
> > > | ^
> > >
> > > pci_resource_start() returns resource_size_t, which is not a pointer, and thus
> > > can not be cast to one.
> >
> > This is odd, why hasn't 0-day or any other build testing found this?
>
> Good question. Another good question is why I see this only with i386 builds,
> but not with other 32-bit builds. It should be easy to reproduce, though.
>
> make ARCH=i386 allmodconfig
> make ARCH-i386 drivers/staging/gpib/cec/cec_gpib.o
>
> does it for me, independent of gcc version (I tried 11.4 and 13.3).
> I don't see it with clang.
>
> Having said this, using the return value from pci_resource_start() directly as pointer
> is quite unusual. Typically drivers use ioremap(), request_region(), pci_iomap(), or
> a similar function on it to get a pointer.
>
> Guenter
>
That is weird: the type of resource.start is resource_size_t which resolves to u32 via phys_addr_t on i386 which should be the same size as void *
For compile check purposes simply changing iobase type to phys_addr_t the following error message appears:
drivers/staging/gpib/ines/ines_gpib.c: In function 'ines_common_pci_attach':
drivers/staging/gpib/ines/ines_gpib.c:783:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
783 | nec_priv->iobase = (void *)(pci_resource_start(ines_priv->pci_device,
| ^
drivers/staging/gpib/ines/ines_gpib.c:783:26: error: assignment to 'phys_addr_t' {aka 'long long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
783 | nec_priv->iobase = (void *)(pci_resource_start(ines_priv->pci_device,
| ^
It would seem that for some reason phys_addr_t resolves to long long unsigned int
-Dave
next prev parent reply other threads:[~2024-12-02 9:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 4:27 [GIT PULL] Staging driver changes for 6.13-rc1 Greg KH
2024-11-29 20:30 ` pr-tracker-bot
2024-11-30 16:10 ` Guenter Roeck
2024-11-30 16:15 ` Greg KH
2024-11-30 17:07 ` Guenter Roeck
2024-12-02 9:50 ` Dave Penkler [this message]
2024-12-02 14:52 ` Guenter Roeck
2024-12-02 15:35 ` Dave Penkler
2024-12-02 17:02 ` Guenter Roeck
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=Z02Cz6GbdtGNPywE@egonzo \
--to=dpenkler@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@roeck-us.net \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.