linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Rosen Penev <rosenp@gmail.com>,
	linux-gpio@vger.kernel.org, Linus Walleij <linusw@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] gpio: realtek-otto: use kernel_ulong_t
Date: Wed, 17 Dec 2025 22:56:08 +0000	[thread overview]
Message-ID: <20251217225608.1db1a51c@pumpkin> (raw)
In-Reply-To: <CAMRc=MdhXqO_b6DU8v6rkuNwsEVO-zY7UP0sXO=2P3tM+uFzHA@mail.gmail.com>

On Wed, 17 Dec 2025 10:34:26 +0100
Bartosz Golaszewski <brgl@kernel.org> wrote:

> On Wed, Dec 17, 2025 at 7:32 AM Rosen Penev <rosenp@gmail.com> wrote:
> >
> > Fixes compilation on 64-bit platforms as pointers needed a larger type.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> >  drivers/gpio/gpio-realtek-otto.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> > index de527f4fc6c2..efcddbe01308 100644
> > --- a/drivers/gpio/gpio-realtek-otto.c
> > +++ b/drivers/gpio/gpio-realtek-otto.c
> > @@ -372,7 +372,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> >         if (!ctrl)
> >                 return -ENOMEM;
> >
> > -       dev_flags = (unsigned int) device_get_match_data(dev);
> > +       dev_flags = (unsigned int)(kernel_ulong_t)device_get_match_data(dev);
> >
> >         ngpios = REALTEK_GPIO_MAX;
> >         device_property_read_u32(dev, "ngpios", &ngpios);
> > --
> > 2.52.0
> >  
> 
> Just make dev_flags an unsigned long and cast
> device_get_match_data(dev) to uintptr_t.

Or just cast the pointer to (unsigned long) and leave dev_flags alone.
'uintptr_t' is a 'user' type, not a kernel one.
The kernel tends to just use 'long' when pointers need to be in an integer
type.

	David

> 
> Bart
> 


  reply	other threads:[~2025-12-17 22:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-17  6:32 [PATCH 0/3] gpio: realtek-otto: compile fixes Rosen Penev
2025-12-17  6:32 ` [PATCH 1/3] gpio: realtek-otto: use kernel_ulong_t Rosen Penev
2025-12-17  9:34   ` Bartosz Golaszewski
2025-12-17 22:56     ` David Laight [this message]
2025-12-17  6:32 ` [PATCH 2/3] gpio: realtek-otto: add COMPILE_TEST Rosen Penev
2025-12-17  6:32 ` [PATCH 3/3] gpio: realtek-otto: use of instead of device handlers Rosen Penev
2025-12-17  9:30   ` Bartosz Golaszewski
2025-12-17 20:26     ` Rosen Penev
2025-12-18  8:31       ` Bartosz Golaszewski
2025-12-18  9:32         ` Rosen Penev
2025-12-18  9:58           ` Bartosz Golaszewski
2025-12-17  9:35 ` (subset) [PATCH 0/3] gpio: realtek-otto: compile fixes Bartosz Golaszewski

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=20251217225608.1db1a51c@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.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;
as well as URLs for NNTP newsgroup(s).