From: "Arnd Bergmann" <arnd@arndb.de>
To: "Yunhui Cui" <cuiyunhui@bytedance.com>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Dennis Zhou" <dennis@kernel.org>, "Tejun Heo" <tj@kernel.org>,
"Christoph Lameter (Ampere)" <cl@gentwo.org>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>, "Björn Töpel" <bjorn@kernel.org>,
pulehui@huawei.com, puranjay@kernel.org,
"Thomas Huth" <thuth@redhat.com>,
"Andrew Jones" <ajones@ventanamicro.com>,
"Ben Dooks" <ben.dooks@codethink.co.uk>,
"Radim Krčmář" <rkrcmar@ventanamicro.com>,
"Samuel Holland" <samuel.holland@sifive.com>,
"Zong Li" <zong.li@sifive.com>,
"Conor.Dooley" <conor.dooley@microchip.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Deepak Gupta" <debug@rivosinc.com>,
seanwascoding@gmail.com, "Andy Chiu" <andybnac@gmail.com>,
menglong8.dong@gmail.com, cyrilbur@tenstorrent.com,
"Vivian Wang" <wangruikang@iscas.ac.cn>,
"Atish Patra" <atishp@rivosinc.com>,
"Anup Patel" <apatel@ventanamicro.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, bpf@vger.kernel.org,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
qingfang.deng@siflower.com.cn,
Linux-Arch <linux-arch@vger.kernel.org>,
llvm@lists.linux.dev
Subject: Re: [PATCH v5 1/3] riscv: io: avoid null-pointer arithmetic in PIO helpers
Date: Wed, 01 Jul 2026 08:24:35 +0200 [thread overview]
Message-ID: <ea525a80-1e6f-4304-a371-3ec17d91ee96@app.fastmail.com> (raw)
In-Reply-To: <7988df83f6341ea045ebd7294af2e8907dbd5ee7.1782877663.git.cuiyunhui@bytedance.com>
On Wed, Jul 1, 2026, at 06:20, Yunhui Cui wrote:
> @@ -56,6 +56,8 @@
> #define __io_pbw() RISCV_FENCE(iow, o)
> #define __io_paw() RISCV_FENCE(o, io)
>
> +#define PCI_IO_ADDR(addr) ((void __iomem *)((unsigned long)PCI_IOBASE
> + (addr)))
This does not seem to have any purpose, is this just left over
from the previous version?
>
> +#ifdef CONFIG_HAS_IOPORT
> __io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr))
> __io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr))
> __io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr))
> -#define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
> -#define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count)
> -#define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
> +#define insb(addr, buffer, count) __insb(PCI_IO_ADDR(addr), buffer, count)
> +#define insw(addr, buffer, count) __insw(PCI_IO_ADDR(addr), buffer, count)
> +#define insl(addr, buffer, count) __insl(PCI_IO_ADDR(addr), buffer, count)
> +#endif
As far as I can tell, just adding the #ifdef here should be sufficient.
Arnd
next prev parent reply other threads:[~2026-07-01 6:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 4:20 [PATCH v5 0/3] riscv: improve percpu helpers and PIO mapping Yunhui Cui
2026-07-01 4:20 ` [PATCH v5 1/3] riscv: io: avoid null-pointer arithmetic in PIO helpers Yunhui Cui
2026-07-01 6:24 ` Arnd Bergmann [this message]
2026-07-01 11:57 ` [External] " yunhui cui
2026-07-01 4:20 ` [PATCH v5 2/3] riscv: introduce percpu.h into include/asm Yunhui Cui
2026-07-01 4:20 ` [PATCH v5 3/3] riscv: store percpu offset into thread_info Yunhui Cui
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=ea525a80-1e6f-4304-a371-3ec17d91ee96@app.fastmail.com \
--to=arnd@arndb.de \
--cc=ajones@ventanamicro.com \
--cc=alex@ghiti.fr \
--cc=andrii@kernel.org \
--cc=andybnac@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=ast@kernel.org \
--cc=atishp@rivosinc.com \
--cc=ben.dooks@codethink.co.uk \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cl@gentwo.org \
--cc=conor.dooley@microchip.com \
--cc=cuiyunhui@bytedance.com \
--cc=cyrilbur@tenstorrent.com \
--cc=daniel@iogearbox.net \
--cc=debug@rivosinc.com \
--cc=dennis@kernel.org \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=menglong8.dong@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=pulehui@huawei.com \
--cc=puranjay@kernel.org \
--cc=qingfang.deng@siflower.com.cn \
--cc=rkrcmar@ventanamicro.com \
--cc=samuel.holland@sifive.com \
--cc=seanwascoding@gmail.com \
--cc=song@kernel.org \
--cc=tglx@kernel.org \
--cc=thuth@redhat.com \
--cc=tj@kernel.org \
--cc=wangruikang@iscas.ac.cn \
--cc=yonghong.song@linux.dev \
--cc=zong.li@sifive.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