From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28383C44508 for ; Wed, 15 Jul 2026 19:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=u6CS/ukqiEaRw61gBorME/9U4wKAg+V897GwvpDltrQ=; b=3zqaMmMu17ti2v xqpopW2cvx1KRW31WpSGOvjIXJMYLTWSSH9O+/H54Vvkt3jX8w22rQ9ZgSdfTS3mVCGhvwnmSuQwf 7hqidfyZOeuqINIFfVWXmm/fkTHtSUeiD0fdlgtPxB0DPrASabBZkKvCZz2L8wlGUUdmyrOT2tiDb 5egxS+w2645ODE2SrwC8jBFq2YZkBdtadDc3amzT5RgyktcaBmabpQe7Wm8W3NXyEeo1Fh+2/vxIv IR5kkBeIxNhI/bT+uBiHj9UUoAXHVmkikxBU+JCSGNVOuPo/gX3dIF6LciURGsdaoiuP8IJZMboUY WhOlKlBIiOnL2pmw+fag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wk5he-0000000FpYk-2Fh9; Wed, 15 Jul 2026 19:55:34 +0000 Received: from 82-65-109-163.subs.proxad.net ([82.65.109.163] helo=luna.linkmauve.fr) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wk5hb-0000000FpXE-0Wby; Wed, 15 Jul 2026 19:55:33 +0000 Received: by luna.linkmauve.fr (Postfix, from userid 1000) id 353A7F40D2B; Wed, 15 Jul 2026 21:55:24 +0200 (CEST) From: Link Mauve To: Srinivas Kandagatla Cc: Link Mauve , Andy Shevchenko , Sven Peter , Janne Grunau , Neal Gompa , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Vladimir Zapolskiy , =?UTF-8?q?Andr=C3=A9=20Draszik?= , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , Kalyani Akula , Michal Simek , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?UTF-8?q?Onur=20=C3=96zkan?= , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, rust-for-linux@vger.kernel.org Subject: [PATCH v2 0/2] nvmem: fix a const-unsoundness in reg_write Date: Wed, 15 Jul 2026 21:55:16 +0200 Message-ID: <20260715195520.25410-1-linkmauve@linkmauve.fr> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260715_125531_308553_5793C963 X-CRM114-Status: GOOD ( 11.00 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org This callback used to take a mutable void * for no reason, which causes the compiler to be unaware that the val buffer should never be modified by the callback. This was found while drafting the nvmem-provider Rust abstraction. Thanks to the guidance of Andy Shevchenko, this now introduces a new callback and deprecates the existing one, with the goal of renaming the new one into the old one once no user remains in the kernel. Changes since v1: - Link to v1: https://lore.kernel.org/rust-for-linux/20260715175229.24672-1-linkmauve@linkmauve.fr/ - Removed all changes to other subsystems than nvmem. - Added a new reg_write_const callback instead of changing the exisitng reg_write. - Deprecated the existing reg_write callback, it will get removed once all users in the kernel will be done migrating to the new one. Link Mauve (2): nvmem: core: deprecate reg_write callback and add reg_write_const nvmem: make all reg_write callbacks take const void * drivers/nvmem/apple-spmi-nvmem.c | 2 +- drivers/nvmem/bcm-ocotp.c | 6 +++--- drivers/nvmem/core.c | 26 +++++++++++++++++--------- drivers/nvmem/imx-ocotp-scu.c | 6 +++--- drivers/nvmem/imx-ocotp.c | 6 +++--- drivers/nvmem/internals.h | 1 + drivers/nvmem/lan9662-otpc.c | 6 +++--- drivers/nvmem/lpc18xx_eeprom.c | 6 +++--- drivers/nvmem/max77759-nvmem.c | 4 ++-- drivers/nvmem/meson-efuse.c | 6 +++--- drivers/nvmem/qcom-spmi-sdam.c | 4 ++-- drivers/nvmem/qfprom.c | 6 +++--- drivers/nvmem/rave-sp-eeprom.c | 6 +++--- drivers/nvmem/snvs_lpgpr.c | 4 ++-- drivers/nvmem/sprd-efuse.c | 6 +++--- drivers/nvmem/stm32-bsec-optee-ta.c | 2 +- drivers/nvmem/stm32-bsec-optee-ta.h | 4 ++-- drivers/nvmem/stm32-romem.c | 10 +++++----- drivers/nvmem/zynqmp_nvmem.c | 6 +++--- include/linux/nvmem-provider.h | 6 +++++- 20 files changed, 68 insertions(+), 55 deletions(-) -- 2.55.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic