Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rustam Adilov" <adilov@disroot.org>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH] pinctrl: single: add big endian support
Date: Sat, 10 Oct 2026 16:32:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-166741@kernel.org> (raw)
In-Reply-To: <20261010161545.62959-1-adilov@disroot.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] api: undefined readl_be/writel_be macros break generic build
--

commit 37f4a78fd7a9ab63fc123070591147a5473d3fdf
Author: Rustam Adilov <adilov@disroot.org>

pinctrl: single: add big endian support

This commit adds big-endian support for pinctrl-single to handle big-endian
device tree properties. It implements custom I/O accessor functions for 
big-endian MMIO access, intended to support MIPS platforms like RTL930X.

> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index e0eb7240a9859..001a0c157d6a0 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -265,6 +265,26 @@ static void pcs_writel(unsigned int val, void __iomem *reg)
>  	writel(val, reg);
>  }
>  
> +static unsigned int pcs_readw_be(void __iomem *reg)
> +{
> +	return readw_be(reg);
> +}
> +
> +static unsigned int pcs_readl_be(void __iomem *reg)
> +{
> +	return readl_be(reg);
> +}
> +
> +static void pcs_writew_be(unsigned int val, void __iomem *reg)
> +{
> +	writew_be(val, reg);
> +}
> +
> +static void pcs_writel_be(unsigned int val, void __iomem *reg)
> +{
> +	writel_be(val, reg);
> +}

[Severity: Low]
Will this break the build on architectures like ARM and ARM64?

The macros readw_be, readl_be, writew_be, and writel_be are strictly
architecture-specific and do not exist in standard generic headers like
<asm-generic/io.h>. Since pinctrl-single is a generic driver heavily used on
architectures like ARM and ARM64, compiling these macros will result in build
failures due to undefined reference or implicit declaration errors.

Should this use the generic kernel APIs ioread32be / iowrite32be (and their
16-bit equivalents ioread16be / iowrite16be) for big-endian MMIO access
instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261010161545.62959-1-adilov@disroot.org?part=1

  reply	other threads:[~2026-10-10 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 16:15 [PATCH] pinctrl: single: add big endian support Rustam Adilov
2026-10-10 16:32 ` sashiko-bot [this message]
2026-10-10 17:47   ` Rustam Adilov

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=sashiko-outbox-166741@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=adilov@disroot.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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