From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-a6-smtp.messagingengine.com (flow-a6-smtp.messagingengine.com [103.168.172.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D0283AFD1B; Wed, 1 Jul 2026 06:25:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782887135; cv=none; b=b2TyRtnUtoIWQMlInmEVjeXgz1s+7wtg5OE4WJcd36bDOh5K0Q41v5MmuDSFAG0isd+Swe5pq6kYd1PO3U0L68dRsRtXik+bRG2W+VlSMXqjqMJ+kUosj4RiO/FMd5tdkvWYeCq9Zv/X+9k1xWzHJ4DqlAQjd3QVw0kiYwcM//E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782887135; c=relaxed/simple; bh=pF/rjHiAr/zdI8E9ZhuLz/uX+1p5q007BELgMZ5YKpU=; h=MIME-Version:Date:From:To:Message-Id:In-Reply-To:References: Subject:Content-Type; b=RUzrfz8jeZLMk4yDI/8cXMRmxcX0qbkuRmAMPJHid6kRlnwTreYjm05I7HkHquX5VHIIPD7fhqGwkNz7OfzMEnU98mHMg9VD/u+DcUlqZ/V3kS0JzbA8r6PL7f8HMFIF/Od4tby4towDhXy3TOZ/z5FzyV5cCtSy+6mG6+tm9bE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=ZAEo/ZNk; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=KH4gK04V; arc=none smtp.client-ip=103.168.172.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="ZAEo/ZNk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KH4gK04V" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailflow.phl.internal (Postfix) with ESMTP id 35EDA1380326; Wed, 1 Jul 2026 02:25:32 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-04.internal (MEProxy); Wed, 01 Jul 2026 02:25:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1782887132; x=1782894332; bh=b44fp/Xs200vmVmERTgFd09AZSIVEJbxoZ/zLTkjWAs=; b= ZAEo/ZNklCq7HmQEk3ZyRkEqqp0NAs1NuYnrrERijClIWx+s19L6FuvIXKdtFruy 4V89DusI3RY+PWxVDApjhWzHTyjpdA2xSUWFPAsFdcFupvmlqwaUhmnKBG1Qj+A3 aGgtYpFNkgAjsd/I4/5LLU/QklAxLdmIa7rQMcIiR6atyFIFZJTE5nOy6AMIH0RE lyvdf1uqqx8qwClvFZS3mWbrktvGFtDL2wj+5vdLJTyzu++JTDl0jY/qaQFuTovj gDaDaoC/5siXjVCoY0jI7GyPsU8yQM2K39vtKFpR3GQQ9wMuIymhBSRBRIY9A719 BH0I0QP55BkqHPusExFKyg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1782887132; x=1782894332; bh=b 44fp/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zXvL8ZbM9Sz3uNVKGMexSSDT9buVIexiEfkw X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 5CAE8182007E; Wed, 1 Jul 2026 02:25:29 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AFAd_idRoH9R Date: Wed, 01 Jul 2026 08:24:35 +0200 From: "Arnd Bergmann" To: "Yunhui Cui" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "Alexandre Ghiti" , "Dennis Zhou" , "Tejun Heo" , "Christoph Lameter (Ampere)" , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , =?UTF-8?Q?Bj=C3=B6rn_T=C3=B6pel?= , pulehui@huawei.com, puranjay@kernel.org, "Thomas Huth" , "Andrew Jones" , "Ben Dooks" , =?UTF-8?Q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , "Samuel Holland" , "Zong Li" , "Conor.Dooley" , "Thomas Gleixner" , "Deepak Gupta" , seanwascoding@gmail.com, "Andy Chiu" , menglong8.dong@gmail.com, cyrilbur@tenstorrent.com, "Vivian Wang" , "Atish Patra" , "Anup Patel" , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, "Nathan Chancellor" , "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , qingfang.deng@siflower.com.cn, Linux-Arch , llvm@lists.linux.dev Message-Id: In-Reply-To: <7988df83f6341ea045ebd7294af2e8907dbd5ee7.1782877663.git.cuiyunhui@bytedance.com> References: <7988df83f6341ea045ebd7294af2e8907dbd5ee7.1782877663.git.cuiyunhui@bytedance.com> Subject: Re: [PATCH v5 1/3] riscv: io: avoid null-pointer arithmetic in PIO helpers Content-Type: text/plain Content-Transfer-Encoding: 7bit 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